Jump to content
php.lv forumi
Sign in to follow this  
newnew

aiziet uz iepriekšējo lapu

Recommended Posts

Man ir tabulā poga "delete". Nospiežot uz pogu izpildās JS, kas pajautā - vai tiešām dzēst? Ja dzēst, tad tiek pārmests ar windows.location uz lapu delete.php. Šī lapa izdzēš un tad ir nepieciešams atgriezties atpakaļ, iepriekšējā lapā.

HTTP_REFERER nestrādā, jo šāds nav nez kāpēc pieejams masīvā SERVER.

Share this post


Link to post
Share on other sites

Ja uz delete.php var aiziet no vairākām vietām, tad drošvien vienkāršākais variants būtu padot uz delete.php vēl vienu mainīgo, kas nosaka return ceļu.

Share this post


Link to post
Share on other sites

Nū... To jau gan pats varēji izdomāt

<a href="delete.php?id=xx&return=<?=$_SERVER['REQUEST_URI'];?>">Dzēst</a>

delete.php

// visas dzēšanas darbības, etc
header("Location: ".$_GET['return']);
exit;

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...