Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 06-04-2006, 01:26 PM   #1 (permalink)
lukeburns
Luke
 
Join Date: Jun 2006
Posts: 1
lukeburns is on a distinguished road
Unexpected $

Parse error: parse error, unexpected '}' in /home/[removed]/public_html/register.php on line 86

????

Ive been staring for ever... help me out please.

heres the code:
PHP Code:
  <?php
  
//Start Script
  //Function
  
function checkOK($field)
{
if (
eregi("\r",$field) || eregi("\n",$field)){
die(
"Invalid Input!");
}
}
  
//Function End
  //Variables
$username $_post['username'];
checkOK($username);
$pass $_post['pass'];
checkOK($pass);
$passrep $_post['passrep'];
checkOK($passrep);
$email $_post['email'];
checkOK($email);
$name $post['name'];
checkOK($name);
$database "[removed]";
$dbusername "[removed]";
$dbpassword "[removed]";
   
//Variables End
   //Password Check
   
if ($pass==$passrep){
   
   
//Mail
$message = ('--'.$name.'has registered at [removed].com with the email'.$email.' and the username'.$username.'!');
if(
mail('[removed]','Register',$message)) {
print 
"Thank you for registering at [removed].com! Please return to home and log on!";
} else {
print 
"Were sorry for the inconvenience but you are currently unavailable to register on [removed].com. Please try again later.";
}
   
//Mail End
   //MySQL
mysql_connect(localhost,$dbusername,$dbpassword);
@
mysql_select_db($database) or die( "Unable to select database");
mysql_query($query);
$query "INSERT INTO users VALUES ($name,$username,$pass,$email)";

mysql_close();
   
//End Script
?>
lukeburns is offline   Reply With Quote
Old 06-04-2006, 01:58 PM   #2 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,166
Belisarius is on a distinguished road
Are you sure this is the right code segment? There isn't a line 86.

That aside - granted, I'm kinda new to PHP, but the syntax looks kinda odd. Those "print" statements don't need parenthesis? And you can reference variables while inside quotes (like you do when forming the query)? Even if it's legal, it's poor syntax.
__________________
GitS
Belisarius is offline   Reply With Quote
Old 06-04-2006, 02:16 PM   #3 (permalink)
Redline
PHP Student
 
Join Date: Oct 2004
Location: Forest Grove, OR
Posts: 151
Redline is on a distinguished road
Send a message via AIM to Redline Send a message via MSN to Redline
There's no line 86 here, and your code would be easier to read (and diagnose problems) if you tabbed it properly
__________________
Current Project
Redline is offline   Reply With Quote
Old 06-04-2006, 03:09 PM   #4 (permalink)
teknomage1
Jack of all trades
 
teknomage1's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 598
teknomage1 is on a distinguished road
Send a message via AIM to teknomage1
As far as I can tell you're short one '}' . 'if ($pass==$passrep){' doesn't have a mate.
__________________
Stop intellectual property from infringing on me
teknomage1 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Well this is unexpected! Redline Lounge 18 11-09-2004 02:58 PM


All times are GMT -8. The time now is 05:14 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting