EOSERV Forum > Lounge > php error
Topic is locked.
Page: << 1 >>
php error
Author Message
Post #81936 php error
I'm getting an error on line 28.  Its telling me its missing a , or a ;  but im not exactly sure.  Does anyone see a mistake they may want to point out?  This isn't the entire script, its basically making sure theres input on some of the feilds and its connecting to the database.

<?php include("database_info.php");
//Variables
$gamertag = $_POST['gamertag'];
$email = $_POST['email'];
$kino_der_toten = $_POST['KinoDerToten'];
$call_of_the_dead = $_POST['CallOfTheDead'];
$ascension = $_POST['Ascension'];

if(isset($_POST[submit]))
{
  if ( $gamertag == "" ) 
  {
   echo "You left your "gamertag" blank.  Go back and try again.";
  }
  if ( $email == "" )
  {
   echo "You left your "email" blank.  Go back and try again.";
  }
 else
  {
    mysql_connect($host, $username, $password) or die(mysql_error());
   echo "Successfully connect on host ="; echo $host;
  }
}
14 years, 2 weeks ago
Post #81954 Re: php error


There isnt even 28 lines posted. Which line is 28.

 

Maybe here, echo "You left your "gamertag" blank.  Go back and try again.";

and the email one.

remove the "" marks

 

Heres a better way for (echo "Successfully connect on host ="; echo $host;)

echo "Successfully connect on host ={$host}";

---
Andrewbob - I would be on the fucking copter of rofls

Programmer, Web Developer, and Graphics Designer
14 years, 2 weeks ago
Post #82058 Re: php error

If you're using double quotes to create a string any double quotes inside of that string need to be escaped with backslashes.

Also, depending on how high your error reporting is you might not get an error for it, but you should have quotes around "submit" ($_POST[submit]). Unless of course "submit" is a defined constant, which I doubt.

14 years, 2 weeks ago
Post #82059 Re: php error

Oh didnt see that.

---
Andrewbob - I would be on the fucking copter of rofls

Programmer, Web Developer, and Graphics Designer
14 years, 2 weeks ago
Page: << 1 >>
Topic is locked.
EOSERV Forum > Lounge > php error