LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-27-2011, 08:15 AM   #1
Ibrahim B
LQ Newbie
 
Registered: Jan 2011
Posts: 1

Rep: Reputation: 0
Post Parse error message


I'm creating a comment form for a website but when I try to connect the page with a database it gives me a parse error.

here are the codes I wrote:


<?php require_once('Connections/localhost.php'); ?>
<?php
//Define Initial Values for Controls
$Name = "";
$Email = "";
$Comment = "";

if(isset($_POST['btnSubmit']))
{
$Error = CheckInput($errEmail,$errName,$Comment);

$Email = mysql_real_escape_string($_POST['txtEmail']);
$Name = mysql_real_escape_string($_POST['txtName']);
$Comment = mysql_real_escape_string($_POST['txtComments']);

if(!$Error)
{

$connections = mysqli_connect($hostname_localhost,$username_localhost,$password_localhost,$database_localhost);
mysql_select_db($database_localhost, $localhost);
$query_Exist = "CALL UserExist('$Name')";
$rslt = mysqli_query($connections,$query_Exist) or die(mysql_error());
$row = mysqli_fetch_row($rslt) ;
mysqli_free_result($rslt);
mysqli_close($Connections);
if ($Email =="" )
{
$lbSuccess ="<font color=red>Error:The User ID [$Uname], is already taken by other staff.";
$lbSuccess .="please write ur user name and email to send your Comment.</font>";
}
else
{
mysql_select_db($database_localhost, $localhost);
$query_Comments = "CALL Comments('$Username','$Email','$Comment'";
$query_Comments .="'$Username','$Email','$Comment'";
$result = mysql_query($query_Comments, $localhost) or die(mysql_error());
$lbSuccess ="Your Comments was successfuly Sent.";
}

}
?>
 
Old 01-27-2011, 10:22 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Hi, welcome to LQ!

Can you please paste the actual error message here?
And please use CODE tags for code, makes it so much more readable.



Cheers,
Tink



P.S.: Moving this to programming.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Parse error: parse error, unexpected '/' - can anyone see the error in this code? v@ny@ Programming 8 04-03-2010 04:07 PM
What's the meaning of "PHP Parse error: parse error, unexpected $ in..." frandalla Programming 23 03-04-2009 12:34 PM
PHP Error Parse error: parse error, unexpected $ in /home/content/S/k/i/SkinCare4U/h CowanServices Programming 2 12-09-2008 08:26 PM
Parse error: parse error, unexpected '}' in /home/content jouvert Linux - Newbie 3 05-17-2008 06:55 PM
Parse error: parse error, unexpected $ in /home/content/d/o/m/domain/html/addpuppy2.p Scooby-Doo Programming 3 10-25-2007 09:41 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration