Jump to content

Archived

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

scheols

Unexpected $end But i seriously cant find the error

Recommended Posts

[code]
<?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";
}
?>
[/code]

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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
Pay close attention to ' and " ...

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

Share this post


Link to post
Share on other sites
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 :(

Share this post


Link to post
Share on other sites
[!--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 :(

[code]
<?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";
}
?>
[/code]

linke 14

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

Share this post


Link to post
Share on other sites
[!--quoteo(post=387790:date=Jun 25 2006, 12:09 PM:name=scheols)--][div class=\'quotetop\']QUOTE(scheols @ Jun 25 2006, 12:09 PM) [snapback]387790[/snapback][/div][div class=\'quotemain\'][!--quotec--]
heres what i got :(

[code]
<?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";
}
?>
[/code]

linke 14

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


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

Change that to

[code]$chkpw = $_POST['chkpw'];[/code]

Share this post


Link to post
Share on other sites
Plus you have a ; after your query, between the or. Change it to...
[code]
mysql_query("INSERT INTO bmembers(uname,upass,email) VALUES('$newun','$newpw','$newem')") or die(mysql_error());
[/code]

Share this post


Link to post
Share on other sites
[!--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:
[code]
mysql_connect("localhost","bulletin","PASSWORD") or die(mysql_error());[/code]

Share this post


Link to post
Share on other sites
well then your username/pw is probably wrong. or you may have to specify the mysql server name instead of using 'localhost'

Share this post


Link to post
Share on other sites
... or your database name is wrong. With shared webhosting, database names are normally in the form [i]your-username_your-database-name[/i].

The [b]right[/b] 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?

Share this post


Link to post
Share on other sites
[!--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) [snapback]387801[/snapback][/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 :(

[code]
<?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";
}
?>[/code]


WOOT I GOT IT THANKS TO EERY ONE WOOT THANKS :D

Share this post


Link to post
Share on other sites

×

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.