This is my php file:
<?php
$val_code=$_POST['val_code'];
$myDatabase = "kuuja_business";
$con = mysql_connect("localhost:3306","kuuja_admin","admin1");
if (!$con)
{
die('Could not connect to Database: ' . mysql_error());
}
@mysql_select_db($myDatabase, $con) or die("Unable to select database");
$result_code = mysql_query("SELECT * FROM user WHERE rand_no = '$val_code'");
If (mysql_fetch_array($result_code))
{
echo "Congratulations!!You are now a registered member of Dozentips Home Business!!"";
echo "To continue please click here..";
}
else
{
echo "The code you entered is not valid, please click the back button on your browser and retry!!";
}
mysql_close($con);
?>
But when I execute it on a button click it says :
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/kuuja/public_html/test/validate.php on line 371
Can someone please help?
Thanks in advance.
Can someone please help me??
Moderator: General Moderators
Re: Can someone please help me??
Where is validate.php and line 371?Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/kuuja/public_html/test/validate.php on line 371
-
sudip_dg77
- Forum Newbie
- Posts: 4
- Joined: Thu Jan 24, 2008 1:14 pm
Re: Can someone please help me??
Line number 371 is highlighed in red below.
echo "<a href="http://www.google.com">To continue please click here..</a>";
Code: Select all
<?php
$val_code=$_POST['val_code'];
$myDatabase = "business";
$con = mysql_connect("localhost:3306","admin","admin");
if (!$con)
{
die('Could not connect to Database: ' . mysql_error());
}
@mysql_select_db($myDatabase, $con) or die("Unable to select database");
$result_code = mysql_query("SELECT * FROM user WHERE rand_no = '$val_code'");
If (mysql_fetch_array($result_code))
{
echo "Congratulations!!You are now a registered member of Dozentips Home Business!!"";
[b][i]echo "<a href="http://www.google.com">To continue please click here..</a>";[/i][/b]
}
else
{
echo "The code you entered is not valid, please click the back button on your browser and retry!!";
}
mysql_close($con);
?>
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
Re: Can someone please help me??
The line before has a double " on the end. Often error messages are triggered by code that directly precedes it. It's a good habit to always look *around* the line that fails 
Re: Can someone please help me??
Code: Select all
echo "<a href="http://www.google.com">To continue please click here..</a>";
// Notice the Highlighter messing upCode: Select all
echo "<a href=\"http://www.google.com\">To continue please click here..</a>";
// OR
echo '<a href="http://www.google.com">To continue please click here..</a>';