Jump to content


Photo

Unexpected $end But i seriously cant find the error


  • Please log in to reply
12 replies to this topic

#1 scheols

scheols
  • Members
  • PipPipPip
  • Advanced Member
  • 113 posts

Posted 25 June 2006 - 03:39 PM

<?php

$newun = $_POST["newun"];
$newpw = $_POST["newpw"];
$newem = $_POST["newem"];
$chkpw = $_POST["chkpw"];'
$checkform = $_POST["addnu"];

//Make a Connection to the Database
mysql_connect("localhost","bulletin","danger84") or die(mysql_error());
mysql_select_db("scheols_bulletinboard") or die(mysql_error());

//Insert Info information into table
mysql_query("INSERT INTO bmembers(uname,upass,email) VALUES("$newun","$newpw","$newem",)");
or die(mysql_error());

if(isset($checkform)){
echo "Thank You $newun For Joining";

}
else    {
echo "Sorry Press Back and Re\'Enter The Form";
}
?>

last line

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Parse error: syntax error, unexpected $end in /home/scheols/public_html/checkregistration.php on line 24[/quote]
Dont Piss me Off today

#2 Orio

Orio
  • Staff Alumni
  • Advanced Member
  • 2,491 posts

Posted 25 June 2006 - 03:46 PM

Change this:
mysql_query("INSERT INTO bmembers(uname,upass,email) VALUES("$newun","$newpw","$newem",)");

To:
mysql_query("INSERT INTO bmembers(uname,upass,email) VALUES('$newun','$newpw",'$newem')");

And it should do the trick.

Orio.
Think you're smarty?

(Gone until 20 to November)

#3 scheols

scheols
  • Members
  • PipPipPip
  • Advanced Member
  • 113 posts

Posted 25 June 2006 - 03:52 PM

mysql_query("INSERT INTO bmembers(uname,upass,email) VALUES('$newun','$newpw",'$newem')");

error on that line

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Parse error: syntax error, unexpected T_VARIABLE in /home/scheols/public_html/checkregistration.php on line 14[/quote]

Dont Piss me Off today

#4 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 25 June 2006 - 03:55 PM

Pay close attention to ' and " ...

mysql_query("INSERT INTO bmembers(uname,upass,email) VALUES('$newun','$newpw','$newem')");

Legend has it that reading the manual never killed anyone.
My site

#5 scheols

scheols
  • Members
  • PipPipPip
  • Advanced Member
  • 113 posts

Posted 25 June 2006 - 03:57 PM

ahh thank u ORIO did that :(

Parse error: syntax error, unexpected T_VARIABLE in /home/scheols/public_html/checkregistration.php on line 14


same error still same line also :(
Dont Piss me Off today

#6 scheols

scheols
  • Members
  • PipPipPip
  • Advanced Member
  • 113 posts

Posted 25 June 2006 - 04:09 PM

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]
Parse error: syntax error, unexpected T_VARIABLE in /home/scheols/public_html/checkregistration.php on line 14


same error still same line also :(
[/quote]

heres what i got :(

<?php

$newun = $_POST["newun"];
$newpw = $_POST["newpw"];
$newem = $_POST["newem"];
$chkpw = $_POST["chkpw"];'
$checkform = $_POST["addnu"];

//Make a Connection to the Database
mysql_connect("localhost","bulletin","danger84") or die(mysql_error());
mysql_select_db("scheols_bulletinboard") or die(mysql_error());

//Insert Info information into table
mysql_query("INSERT INTO bmembers(uname,upass,email) VALUES('$newun','$newpw','$newem')");
or die(mysql_error());

if(isset($checkform)){
echo "Thank You $newun For Joining";

}
else    {
echo "Sorry Press Back and Re\'Enter The Form";
}
?>

linke 14

mysql_query("INSERT INTO bmembers(uname,upass,email) VALUES('$newun','$newpw','$newem')");

Dont Piss me Off today

#7 Eugene

Eugene
  • Members
  • PipPipPip
  • Advanced Member
  • 126 posts

Posted 25 June 2006 - 04:29 PM

[!--quoteo(post=387790:date=Jun 25 2006, 12:09 PM:name=scheols)--][div class=\'quotetop\']QUOTE(scheols @ Jun 25 2006, 12:09 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
heres what i got :(

<?php

$newun = $_POST["newun"];
$newpw = $_POST["newpw"];
$newem = $_POST["newem"];
$chkpw = $_POST["chkpw"];'
$checkform = $_POST["addnu"];

//Make a Connection to the Database
mysql_connect("localhost","bulletin","danger84") or die(mysql_error());
mysql_select_db("scheols_bulletinboard") or die(mysql_error());

//Insert Info information into table
mysql_query("INSERT INTO bmembers(uname,upass,email) VALUES('$newun','$newpw','$newem')");
or die(mysql_error());

if(isset($checkform)){
echo "Thank You $newun For Joining";

}
else    {
echo "Sorry Press Back and Re\'Enter The Form";
}
?>

linke 14

mysql_query("INSERT INTO bmembers(uname,upass,email) VALUES('$newun','$newpw','$newem')");
[/quote]


Your Error =
$chkpw = $_POST["chkpw"];'

Change that to

$chkpw = $_POST['chkpw'];


#8 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 25 June 2006 - 04:44 PM

Plus you have a ; after your query, between the or. Change it to...
mysql_query("INSERT INTO bmembers(uname,upass,email) VALUES('$newun','$newpw','$newem')") or die(mysql_error());


#9 scheols

scheols
  • Members
  • PipPipPip
  • Advanced Member
  • 113 posts

Posted 25 June 2006 - 04:50 PM

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]

Warning: mysql_connect(): Access denied for user 'bulletin'@'localhost' (using password: YES) in /home/scheols/public_html/newregistration.php on line 10
Access denied for user 'bulletin'@'localhost' (using password: YES)
[/quote]

did every thing you'all told me i get this new error heres the line:
mysql_connect("localhost","bulletin","PASSWORD") or die(mysql_error());

Dont Piss me Off today

#10 scheols

scheols
  • Members
  • PipPipPip
  • Advanced Member
  • 113 posts

Posted 25 June 2006 - 05:34 PM

Bump
Dont Piss me Off today

#11 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 25 June 2006 - 05:40 PM

well then your username/pw is probably wrong. or you may have to specify the mysql server name instead of using 'localhost'
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#12 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 25 June 2006 - 05:59 PM

... or your database name is wrong. With shared webhosting, database names are normally in the form your-username_your-database-name.

The right information on database name, username, and password is what you wrote down when you created the database and user. You did write it down, didn't you?
Legend has it that reading the manual never killed anyone.
My site

#13 scheols

scheols
  • Members
  • PipPipPip
  • Advanced Member
  • 113 posts

Posted 25 June 2006 - 06:01 PM

[!--quoteo(post=387801:date=Jun 25 2006, 12:40 PM:name=Crayon Violent)--][div class=\'quotetop\']QUOTE(Crayon Violent @ Jun 25 2006, 12:40 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
well then your username/pw is probably wrong. or you may have to specify the mysql server name instead of using 'localhost'
[/quote]


so if my database is wrong wtf :(

<?php

$newun = $_POST["newun"];
$newpw = $_POST["newpw"];
$newem = $_POST["newem"];
$chkpw = $_POST["chkpw"];
$checkform = $_POST["addnu"];

//Make a Connection to the Database
mysql_connect("localhost","bulletin","danger84") or die(mysql_error());
mysql_select_db("scheols_bulletinboard") or die(mysql_error());

//Insert Info information into table
mysql_query("INSERT INTO bmembers(uname,upass,email) VALUES('$newun','$newpw','$newem')")
or die(mysql_error());

if(isset($checkform)){
echo "Thank You $newun For Joining";

}
else    {
echo "Sorry Press Back and Re\'Enter The Form";
}
?>


WOOT I GOT IT THANKS TO EERY ONE WOOT THANKS :D
Dont Piss me Off today




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users