Jump to content

Recommended Posts

<?PHP
SESSION_START();
include('connect.php');
$Member1 = mysql_query("SELECT * FROM members WHERE username='$username'");
$Member = mysql_fetch_array($Member1);
//Variables
$username = $_SESSION[username];
$Dir = $_GET["Dir"];
$Value_X = $Member[map_pos_X]; //Right or Left
$Value_Y = $Member[map_pos_Y]; //Up or Down


if($Dir == "Down") //If user chose to go Down
{
$Value_Y = $Value_Y--;
    mysql_query("UPDATE members SET map_pos_Y='$Value_Y' WHERE username='$username'");
}
elseif($Dir == "Up") //If user chose to go Up
{
$Value_Y = $Value_Y++;
mysql_query("UPDATE members SET map_pos_Y='$Value_Y' WHERE username='$username'");
}
elseif($Dir == "Right") //If user chose to go Right
{	
$Value_X = $Value_X--;
mysql_query("UPDATE members SET map_pos_X='$Value_X' WHERE username='$username'");
}
elseif($Dir == "Left") //If user chose to go Left
{
$Value_X = $Value_X++;
mysql_query("UPDATE members SET map_pos_X='$Value_X' WHERE username='$username'");
}

header("Location: http://tpfrpg.ghostblade.us/bmap.php"); // This is to prevent refreshing

?>

How can I make the page redirect the user to http://tpfrpg.ghostblade.us/bmap.php after it has done the if statements? Any help will be appreciated.

Link to comment
https://forums.phpfreaks.com/topic/88978-solved-help-please/
Share on other sites

You should just use a <meta> tag - If that's what i think you mean.

 

Example:

<?php
echo '<meta http-equiv="refresh" content="5;directory/file.php">';
echo 'You will now be re-directed in 5 seconds. <br />';
echo 'If you are not re-directed, please <a href="directory/file.php">Click Here</a>.';
?>

Link to comment
https://forums.phpfreaks.com/topic/88978-solved-help-please/#findComment-455682
Share on other sites

Change

$username = $_SESSION[username];

 

to

 

$username = $_SESSION['username'];

 

 

What sets "Dir" here, a URL or a Form?

 

$Dir = $_GET["Dir"];

 

echo $Dir after you set it and see what it contains.

 

A url sets "Dir".

Link to comment
https://forums.phpfreaks.com/topic/88978-solved-help-please/#findComment-455710
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.