samedi 12 septembre 2015

Php Wont accept file in folder when testing

Im testing for a file in a folder: /scoutTeams/$var.php Where $var is defined by a argument in the URL:

$var = $_GET['team']; Lets say that the "Team variable" is 118. And 118.php is in /scoutTeams/ But when I run the code, it keeps returning that it doesn't exist.. Did I do something wrong? Thanks!

Code:

<code>$var = $_GET['team'];</code>

if (!file_exists("scoutTeams/$var.php")) {   
echo "<script type='text/javascript'>alert('Could not find team: $var');</script>";
} ELSE {
print "<p><div align='center'><font color='green'><h1>Loading team: '<font color='red'>$var<font color='green'>'</div></h1>'<p>";
print "<p><div align='center'><img src='/image/loading.gif'</div><p>";
print "<p><div align='center'>Please Wait...</div><p>";
header

Aucun commentaire:

Enregistrer un commentaire