Jump to content

Unexpected parse code '='


Schlo_50

Recommended Posts

[b]Parse error[/b]: parse error, unexpected '=' in [b]/home/www/dombar0.freehostia.com/adduser2.php [/b] on line [b]29[/b]

I keep getting this message after i submit my user registration form. This is my first proper go at a script so i am a n00b to it, although i just can't figure out whats wrong.

Line 29 is this:

[color=blue]£conn=@mysql_connect( "localhost","databaseusername","databasepassword" )[/color]

This is the main script:

<?php
$self=$_SERVER['PHP_SELF'];
$firstname=$_POST['first_name'];
$surname=$_POST['sur_name'];
$username=$_POST['user_name'];
$password=$_POST['password'];

?>

<form action="http://dombar0.freehostia.com/adduser2.php" method="post">
First Name: <input type="text" name="first_name"><br>
Last Name: <input type="text" name="sur_name"><br>
Username: <input type="text" name="user_name"><br>
Password: <input type="text" name="password"><br>
<input type="Submit">
</form>

<?php
if( $firstname and $surname and $username and $password )

{           
             £conn=@mysql_connect( "localhost","databaseusername","databasepassword" )
or die( "Err:Conn" );
$rs = @mysql_select_db( "dombar0_work", $conn )
or die( "Err:Db" );
$sql="INSERT INTO users ( first_name, sur_name, user_name, password)
values ( $firstname, \"surname\", \"username\", \"password\" )";

$rs = mysql_query( $sql, $conn );
if ($rs){ echo( "Records Added:$firstname $surname $username $password" ); }
}
?>

Also, while im here can someone tell me simply what '<form action' is and what i should type after it?

Thanks for any help with either questions guys ;)

Schlo_50
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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