Map Location Issue
Posted: Sat Aug 24, 2013 5:56 am
I noticed in your video where you put locations from your index instead of using another page. I decided to do another page, based upon my setup. When I switch it to an internet server, that may change, but in the meantime I want to use map.php, which I have the code below.
Now I didn't see any difference in my code and yours, so I'm lost on why I get the error.... This is what it shows:
Las Vegas
Reno Nevada
St Louis Missouri
Notice: Undefined index: mapname in C:\xampp\htdocs\game\map.php on line 25
You have traveled to .
To location
Code: Select all
<?php
session_start();
include("header.php");
if(!isset($_SESSION['uid'])){
$id=$_SESSION['id'];
echo "You must be logged in to view this page!";
}else{
?>
<?php
if(!isset($_GET['map'])){
$id = $user['id'];
$bypass=1;
echo "<a href='map.php?mapchange=1&mapname=Las Vegas'>Las Vegas</a><br /><br />";
echo "<a href='map.php?mapchange=1&mapname=Reno Nevada'>Reno Nevada</a><br /><br />";
echo "<a href='map.php?mapchange=1&mapname=St Louis Missouri'>St Louis Missouri</a><br /><br />";
}
if(!isset($_GET['mapchange'])){
$bypass=1;
$mapname = $_GET['mapname'];
$updateplayer="update stats set location='$mapname' WHERE id='$id'";
mysql_query($updateplayer) or die("Could not update player");
echo "You have traveled to " . $mapname . ".<br>";
echo "<a href='map.php'>To location</a><br>";
}
}
?>Las Vegas
Reno Nevada
St Louis Missouri
Notice: Undefined index: mapname in C:\xampp\htdocs\game\map.php on line 25
You have traveled to .
To location