Jump to content

Parse error unexpected '$' on line 202


smitty03

Recommended Posts

I'm not sure but I think line 202 is the end of my code. I have php embedded in an html document and it gives me this error.

the snippet of php looks like this and the rest is standard html.

I'ts the page that shows up after the user signs up and is inserted in the database.

 

<?php 

include("config.php"); 

// connect to the mysql server
$link = mysql_connect($server, $db_user, $db_pass)
or die ("Could not connect to mysql because ".mysql_error());

// select the database
mysql_select_db($database)
or die ("Could not select database because ".mysql_error());

// check if the username is taken
$check = "select userid from $table where username = '".$_POST['myusername']."';"; 
$qry = mysql_query($check) or die ("Could not match data because ".mysql_error());
$num_rows = mysql_num_rows($qry); 
if ($num_rows != 0) { 
echo "Sorry, there the username $myusername is already taken.<br>";
echo "<a href=signup.html>Try again</a>";
exit; 
} else {

// insert the data
$insert = mysql_query("insert into $table values ('NULL', '".$_POST['name']."','".$_POST['myusername']."',
'".$_POST['mypassword']."','".$_POST['myemail']."','".$_POST['mygender']."')")
or die("Could not insert data because ".mysql_error());

// print a success message
echo 
"<h1><big>Thanks For Signing up!</big></h1>
<p>
Start here by <a href=\"login.html\">Logging in</a> </p>
<p>
Or go <a href=\"tapdat.html\">tap dat</a> and rate someones pictures</p>
<p>But if you really want to have fun and start racking up points for your gender <br />
Then go <a href=\"argue.html\">Start some Arguments</a>
</p>"; ?>
?>

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.