GIDForums

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 14-Apr-2008, 09:25
oggie oggie is offline
New Member
 
Join Date: Nov 2007
Location: tattershall, UK
Posts: 23
oggie is on a distinguished road
Smile

syntax error


I cannot see the problem. I got this code from looking at a book. Any solutions.

PHP Code:

// Check for the existence of that email address.
[color="Red"]$query ="SELECT user_id FROM registration WHERE email='". escape_data($_POST['email'] . "'"; line 21[/color]
$result = mysql_query ($query) or trigger_error("Query: $query\n<br />mysql Error: " . mysql_error());
if (mysql_num_rows($result) == 1 ) { 



Parse error: syntax error, unexpected ';' in /home/ogl10b7/public_html/EricsCarRepairs/forgot_password.php on line

kind regards

Ian
Last edited by LuciWiz : 15-Apr-2008 at 12:30. Reason: Please insert your Php code between [php] & [/php] tags
  #2  
Old 14-Apr-2008, 12:09
TurboPT's Avatar
TurboPT TurboPT is online now
Regular Member
 
Join Date: Feb 2006
Location: Atlanta, GA
Posts: 871
TurboPT is a jewel in the roughTurboPT is a jewel in the roughTurboPT is a jewel in the rough

Re: syntax error


escape_data appears to missing a closing ).
__________________
Use the force...read the source!!
WYCIWYG -- what you code is what you get!
  #3  
Old 14-Apr-2008, 14:54
oggie oggie is offline
New Member
 
Join Date: Nov 2007
Location: tattershall, UK
Posts: 23
oggie is on a distinguished road
Smile

Re: syntax error


thanx for that. thats sorted. but I am getting this now.


This is what I got from the link you sent.

PHP Code:

// start output buffering.
ob_start();
// Initialise a session.
session_start()
$_SESSION['sid'] = "sid";
setcookie("sid", sid, time()+3600);
setcookie("sid", $_GET["uname"], time()+3600);
$CheckInTime = Time();
$query="INSERT INTO `NetImOn` (`U_Name`, `LoginTime`, `SessionId`) VALUES ('".$_GET["uname"]."', '".$CheckInTime."', '".session_id()."')"  or die(mysql_error()); 
mysql_query($query);

And this is what is happening still.

Parse error: syntax error, unexpected T_VARIABLE in /home/ogl10b7/public_html/EricsCarRepairs/includes/header.html on line 8


<?php # header.html
// This page begins the HTML header for the site.

// start output buffering.
ob_start();
// Initialise a session.
session_start()
$_SESSION['sid'] = "sid";
setcookie("sid", sid, time()+3600);
setcookie("sid", $_GET["uname"], time()+3600);
$CheckInTime = Time();
$query="INSERT INTO `NetImOn` (`U_Name`, `LoginTime`, `SessionId`) VALUES ('".$_GET["uname"]."', '".$CheckInTime."', '".session_id()."')"  or die(mysql_error()); 
mysql_query($query);


// Check for a $page_title value.
if (!isset($page_title)) {
   $page_title = 'Register';
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">                                    
<head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    <title><?php echo $page_title; ?>
    </title>
<style type="text/css" media="screen"> @import url(./includes/layout.css);</style>
</head>  

<body>
<div id="Header">User Registration</div>
<div id="Content">
<!-- End of Header --> 

Last edited by LuciWiz : 15-Apr-2008 at 12:31. Reason: Please insert your Php code between [php] & [/php] tags
  #4  
Old 14-Apr-2008, 15:09
TurboPT's Avatar
TurboPT TurboPT is online now
Regular Member
 
Join Date: Feb 2006
Location: Atlanta, GA
Posts: 871
TurboPT is a jewel in the roughTurboPT is a jewel in the roughTurboPT is a jewel in the rough

Re: syntax error


Refer to your other post, titled: "Session error", where you've already asked about that.
__________________
Use the force...read the source!!
WYCIWYG -- what you code is what you get!
  #5  
Old 14-Apr-2008, 15:22
oggie oggie is offline
New Member
 
Join Date: Nov 2007
Location: tattershall, UK
Posts: 23
oggie is on a distinguished road

Re: syntax error


where abouts do I refer to this in the code and sort it out. Sorry to be a complete dunce.!!
  #6  
Old 14-Apr-2008, 16:50
TurboPT's Avatar
TurboPT TurboPT is online now
Regular Member
 
Join Date: Feb 2006
Location: Atlanta, GA
Posts: 871
TurboPT is a jewel in the roughTurboPT is a jewel in the roughTurboPT is a jewel in the rough

Re: syntax error


See this post.
__________________
Use the force...read the source!!
WYCIWYG -- what you code is what you get!
 

Recent GIDBlogUpdates On The All New Toyota VIOS - Part III by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Two-Tier data dissemination code installation problem nidhibansal1984 Computer Software Forum - Linux 6 16-Sep-2007 10:13
Major newbie problem cynack MS Visual C++ / MFC Forum 1 08-Apr-2007 11:25
Winsock error when compiling FLTK 2.0 Projects mauriciorossi FLTK Forum 3 16-Aug-2005 10:18
Help with syntax errors PeteGallo C Programming Language 7 08-Aug-2005 20:30
Can enum have same name as class? crystalattice CPP / C++ Forum 3 08-Dec-2004 16:43

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 12:53.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.