Jump to content

what wrong ????


adamriley

Recommended Posts

(im new to php)

 

error log

 

---------------------------------------------------------------------------------------------------------------

Parse error: syntax error, unexpected '{' in C:\xampp\htdocs\Game\Check.php  on line 9

---------------------------------------------------------------------------------------------------------------

<?php
$Spot_id = $_GET["Spot"]; // get name of spot from url
include($_SERVER["DOCUMENT_ROOT"]."/Counter/Visitors.php"); // counter file
$file_for_game = $_SERVER["DOCUMENT_ROOT"]."/Game/Places/$Spot_id.txt";

if(!file_exists("$file_for_game")) {
die("Error: Please contact webmaster " . $file_for_game . " Is not found!");
}
else(file_exists("$file_for_game")) { = $stop == 'true'; }



// first of all there would be 1 more php elseif due to the first if
// being for the error due to the spot already being taken by someone else


if ($stop == 'true'){
/* CLOSE PHP HERE BECAUSE WE WANT TO OUTPUT HTML */ ?>
<html>
<body>
<h2>Taken</h2>
<?php }elseif ($visitors_online == '2') { /* OPEN PHP FOR THE if THEN CLOSE IT FOR HTML AGAIN */ ?>
<html>
<body>
<h2>This spot is free why not snap it up quickly before some one else does</h2>
<?php echo $Spot_id ?>
<?php } else { // OPEN PHP AGAIN FOR THE CLOSING BRACE?>
<h2>This spot is free why not snap it up quickly before some one else does</h2>
<?php } ?>

 

if you need the rest of the files ask (3 files)

Link to comment
https://forums.phpfreaks.com/topic/201121-what-wrong/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.