Page 1 of 1

Can someone please help me??

Posted: Thu Jan 24, 2008 1:14 pm
by sudip_dg77
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.

Re: Can someone please help me??

Posted: Thu Jan 24, 2008 1:42 pm
by Zoxive
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/kuuja/public_html/test/validate.php on line 371
Where is validate.php and line 371?

Re: Can someone please help me??

Posted: Thu Jan 24, 2008 1:46 pm
by sudip_dg77
Line number 371 is highlighed in red below.

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);
 
 
 
?>
 
echo "<a href="http://www.google.com">To continue please click here..</a>";

Re: Can someone please help me??

Posted: Thu Jan 24, 2008 2:01 pm
by Kieran Huggins
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??

Posted: Thu Jan 24, 2008 2:18 pm
by Zoxive

Code: Select all

echo "<a href="http://www.google.com">To continue please click here..</a>";
// Notice the Highlighter messing up
->

Code: 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>';