Jump to content

Help with META tag?


kernelgpf

Recommended Posts

Basically, when a user visits a page, the DB logs the users last viewed page. When the user logs on, I want it to take them to the page they were last looking at.. this code seems to just refresh the page over and over again, not take them to the URL specified.. this is the top of my index.php file.

[code]<?php
session_start();
if($_SESSION['id']){
include "config.php";
$sid=$_SESSION['id'];
$query=mysql_query("select viewingpage from users where id='$sid'");
$row=mysql_fetch_array($query);
if(empty($row[viewingpage])){
$row[viewingpage]="/userarea.php";
}
print "<META HTTP-EQUIV=\"Refresh\" Content=0; URL=\"http://www.dragon-dynasty.com$row[viewingpage]\">";
exit; 
}

?>[/code]

..help?
Link to comment
Share on other sites

you could just use $_SERVER['HTTP_RERFERER'];

but try this:
[code=php:0]
print "<META HTTP-EQUIV=\"Refresh\" Content=0; URL=\"http://www.dragon-dynasty.com".$row['viewingpage']."\">";
[/code]

you should always use ' and ' in arrays and dont use them inside talking marks.
like this:
[code=php:0]echo "Hello there $row['username']";[/code]

Hope thats what your after though... Otherwise use HTTP_REFERER...
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.