php redirection..

Started on the old forum in February 2010 · view the original in the archive · old links redirect here

11 replies · 788 views · started 16 years ago · 1 min read

5 participants
icedroplet1987 Senior · 258 posts #1

hi friends, i am tired of using header or meta tag.. it works fine but when i use $_SERVER[HTTP_REFERER] , it sometimes repeats the same action.. i want an effective redirection.. i want my users to complete an action .. and start from the same place where they left.. i want my user to continue browsing without action completed msg (topic posted successfully) . can anybody guide me for perfect redirection.. somehow tell me how i take my user back to same place after finish action.

icedroplet1987 Senior · 258 posts #5

mate, meta tag fails sometimes when i use $_SERVER[HTTP_REFERER]

icedroplet1987 Senior · 258 posts #7

not getting what you wanna say.. be more clear n tell with example if possible.

icedroplet1987 Senior · 258 posts #9

but nooob to understand.. pls tell how i use this

kiLLeR-eyEd_14 Senior · 382 posts #10

Do u mean something like this..

$action = $_GET["action"];
$post = $_GET["post"];
if($action=="viewtpc")
{
if($post=="yes")
{
//codes here for inserting topic to the database
}
//the topics being viewed here
//then let's say the page is forum.php..in the form action, put forum.php?action=viewtpc&post=yes
}
icedroplet1987 Senior · 258 posts #11
else if($fc=="shout")
{
  $shtxt = $_POST["shtxt"];
    addonline(getuid_sid($sid),"Roaring","");

$pstyle = gettheme($sid);
      echo xhtmlhead("Roar",$pstyle);
    echo "<p align=\"left\">";
    if(getplusses(getuid_sid($sid))<1)
    {
        echo "<img src=\"images/notok.gif\" alt=\"X\"/>You should have at least 1 plusses to Roar!";
    }else{
      $shtxt = $shtxt;
    $uid = getuid_sid($sid);
    $shtm = (time() - $timeadjust) + $timeadjust;
    $res = mysql_query("INSERT INTO shouts SET shout='".$shtxt."', shouter='".$uid."', shtime='".$shtm."'");
    if($res)
    {
    $shts = mysql_fetch_array(mysql_query("SELECT shouts from users WHERE id='".$uid."'"));
    $shts = $shts[0]+1;
    mysql_query("UPDATE hfjgn_users SET shouts='".$shts."' WHERE id='".$uid."'");
	 echo "<meta http-equiv=\"refresh\" content=\"0;url=$_SERVER[HTTP_REFERER]\">";
	

like m using meta tag n http server redirect.. but it sometimes repeats action only.. doesnt take user for where they clicked

ori Lead · 512 posts #12

make like a

 
if (!isset($_SERVER['HTTP_REFERRER'])) $referrer = $_SERVER['HTTP_HOST']."/index.php?action=main&sid=$sid";

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close