sudip_dg77 Posted January 24, 2008 Share Posted January 24, 2008 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 "<a href="http://www.google.com">To continue please click here..</a>"; } 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. Quote Link to comment Share on other sites More sharing options...
Stooney Posted January 24, 2008 Share Posted January 24, 2008 First off, put your code in code blocks (use the # button above) to make it easy to read. And the error occurs on line 371, you should mark that line for us. I did find one error though, you have two double ending this line when it should only be one. echo "Congratulations!!You are now a registered member of Dozentips Home Business!!""; so just change it to echo "Congratulations!!You are now a registered member of Dozentips Home Business!!"; Quote Link to comment Share on other sites More sharing options...
sudip_dg77 Posted January 24, 2008 Author Share Posted January 24, 2008 <?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 "<a href="http://www.google.com">To continue please click here..</a>"; } else { echo "The code you entered is not valid, please click the back button on your browser and retry!!"; } mysql_close($con); ?> Now I get this error "Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/kuuja/public_html/test/validate.php on line 370" Quote Link to comment Share on other sites More sharing options...
p2grace Posted January 24, 2008 Share Posted January 24, 2008 What's line 370? Quote Link to comment Share on other sites More sharing options...
sudip_dg77 Posted January 24, 2008 Author Share Posted January 24, 2008 Line 370 is: echo "<a href="http://www.google.com">To continue please click here..</a>"; Quote Link to comment Share on other sites More sharing options...
sudip_dg77 Posted January 24, 2008 Author Share Posted January 24, 2008 Line 370: echo "<a href="http://www.google.com">To continue please click here..</a>"; Quote Link to comment Share on other sites More sharing options...
p2grace Posted January 24, 2008 Share Posted January 24, 2008 Try this: echo "<a href=\"http://www.google.com\">To continue please click here..</a>"; Quote Link to comment Share on other sites More sharing options...
Stooney Posted January 24, 2008 Share Posted January 24, 2008 When you echo data, you should use single quotes if you are not outputting any variables. It's faster and you don't have to escape double quotes. I would suggest echo '<a href="http://www.google.com">To continue please click here..</a>'; Quote Link to comment Share on other sites More sharing options...
sudip_dg77 Posted January 24, 2008 Author Share Posted January 24, 2008 Yes it works with no errors. I mean both the codes echo '<a href="http://www.google.com">To continue please click here..</a>'; echo "<a href=\"http://www.google.com\">To continue please click here..</a>"; But on the output page the nothing is displayed. Only "Congratulations!!You are now a registered member of Dozentips Home Business!!" Whereas it should display "Congratulations!!You are now a registered member of Dozentips Home Business!! Click here to continue" I am basically try to give the user an option to click on "Click here" link to redirect them to a different webpage. Can you please help again? Or is there any other option? Quote Link to comment Share on other sites More sharing options...
p2grace Posted January 24, 2008 Share Posted January 24, 2008 Can you give us the html code for that output Quote Link to comment Share on other sites More sharing options...
sudip_dg77 Posted January 24, 2008 Author Share Posted January 24, 2008 Yes sure!! Here it is. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD><TITLE>Home Based Business That Pays....</TITLE> <META content="Home Based Business that really pays." name=description> <META content="home based business, money, pay, income, extra income, life long payment, work from home, best home based business opportunities,home based businesses" name=keywords> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1"><LINK href="css/site.css" rel=stylesheet> <META content="MSHTML 6.00.6000.16587" name=GENERATOR></HEAD> <BODY leftMargin=0 topMargin=0 marginheight="0" marginwidth="0"> <TBODY><TR border="0" ><TD border="0" > <TABLE cellSpacing=0 cellPadding=0 width=780 border=0 > <TBODY> <TR border="0" > <TD height=5 border="0" ></TD></TR> <TR border="0" > <TD border="0" > <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0 > <TBODY> <TR border="0" > <TD border="0" > </TD> <TD align=center width=720 border="0" > <TABLE cellSpacing=0 cellPadding=0 width=720 border=0 > <TBODY> <TR border="0" > <TD background=images/h_bg.jpg border="0" > <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0 > <TBODY> <TR border="0" > <TD width=81 border="0" ><IMG height=219 alt="" src="images/h_1.jpg" width=81></TD> <TD vAlign=center align=right background=images/h_bg.jpg border="0" > <TABLE cellSpacing=0 cellPadding=0 width="90%" border=0 > <TBODY> <TR border="0" > <TD height=54 border="0" > </TD></TR> <TR border="0" > <TD border="0" ><SPAN class=style8><FONT face="Monotype Corsiva" size=7>Dozen Tips</FONT></SPAN></TD></TR> <TR border="0" > <TD border="0" ><SPAN class=style10>The Home Business that pays....</SPAN></TD></TR></TBODY></TABLE></TD> <TD align=right width=368 border="0" ><IMG height=219 alt="" src="images/h_2.jpg" width=250></TD></TR></TBODY></TABLE></TD></TR> <TR border="0" > <TD border="0" > <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0 > <TBODY> <TR border="0" > <TD border="0" ><IMG height=6 alt="" src="images/box_top.gif" width=720></TD></TR> <TR border="0" > <TD border="0" > <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0 > <TBODY> <TR border="0" > <TD vAlign=top align=center width=195 bgColor=#aff7fa border="0" ><BR> <TABLE cellSpacing=0 cellPadding=0 width="87%" border=0 > <TBODY> <TR border="0" > <TD vAlign=top align=center border="0" > <TABLE height=256 cellSpacing=2 cellPadding=0 width=166 border=0 > <TBODY> <TR border="0" > <TD class=stylel15 width=159 bgColor=#32b4b9 height=40 border="0" > <TABLE cellSpacing=0 cellPadding=4 width="100%" border=0 > <TBODY> <TR border="0" > <TD align=center width=28 border="0" ><IMG height=7 alt="" src="images/arrow.gif" width=13></TD> <TD border="0" ><SPAN class=style1><A href="javascript:void(0);">Login</A></SPAN></TD></TR></TBODY></TABLE></TD></TR> <TR border="0" > <TD class=stylel15 width=159 bgColor=#32b4b9 height=40 border="0" > <TABLE height=25 cellSpacing=0 cellPadding=4 width=157 border=0 > <TBODY> <TR border="0" > <TD align=center width=28 height=23 border="0" ><IMG height=7 alt="" src="images/arrow.gif" width=13></TD> <TD width=107 height=23 border="0" ><SPAN class=style1><A href="javascript:void(0);">How</A></SPAN></TD></TR></TBODY></TABLE></TD></TR> <TR border="0" > <TD class=stylel15 width=158 bgColor=#32b4b9 height=40 border="0" > <TABLE height=25 cellSpacing=0 cellPadding=4 width=157 border=0 > <TBODY> <TR border="0" > <TD align=center width=28 height=23 border="0" ><IMG height=7 alt="" src="images/arrow.gif" width=13></TD> <TD width=107 height=23 border="0" ><SPAN class=style1><A href="javascript:void(0);">Testimonials</A></SPAN></TD></TR></TBODY></TABLE></TD></TR> <TR border="0" > <TD class=stylel15 width=159 bgColor=#32b4b9 height=40 border="0" > <TABLE cellSpacing=0 cellPadding=4 width="100%" border=0 > <TBODY> <TR border="0" > <TD align=center width=28 border="0" ><IMG height=7 alt="" src="images/arrow.gif" width=13></TD> <TD border="0" ><SPAN class=style1><A href="javascript:void(0);">Privacy</A> </SPAN></TD></TR></TBODY></TABLE></TD></TR> <TR border="0" > <TD class=stylel15 width=159 bgColor=#32b4b9 height=40 border="0" > <TABLE cellSpacing=0 cellPadding=4 width="100%" border=0 > <TBODY> <TR border="0" > <TD align=center width=28 border="0" ><IMG height=7 alt="" src="images/arrow.gif" width=13></TD> <TD border="0" ><SPAN class=style1><A href="javascript:void(0);">Link</A> </SPAN></TD></TR></TBODY></TABLE></TD></TR> <TR border="0" > <TD class=stylel15 width=159 bgColor=#32b4b9 height=40 border="0" > <TABLE cellSpacing=0 cellPadding=4 width="100%" border=0 > <TBODY> <TR border="0" > <TD align=center width=28 border="0" ><IMG height=7 alt="" src="images/arrow.gif" width=13></TD> <TD border="0" ><SPAN class=style1><A href="javascript:void(0);">Contact Us </A></SPAN></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><BR><BR></TD></TR> <TR border="0" > <TD vAlign=top align=left border="0" > </TD></TR></TBODY></TABLE></TD> <TD vAlign=top align=center width=517 bgColor=#ffffff border="0" > <TABLE cellSpacing=0 cellPadding=0 width="92%" border=0 > <TBODY> <TR border="0" ></TR> <TR border="0" > <TD class=style11 vAlign=top align=left border="0" > <P><STRONG><BR><BR><BR[color=red]><?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 '<a href="http://www.google.com">To continue please click here..</a>'; } else { echo "The code you entered is not valid, please click the back button on your browser and retry!!"; } mysql_close($con); ?>[/color] <P align=justify> </P></STRONG></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR> <TR border="0" > <TD border="0" ><IMG height=6 alt="" src="images/box_bottom.gif" width=720></TD></TR></TBODY></TABLE><FONT face=Verdana color=#ffffff size=1> Copyright © 2008 Dozen Tips. Home Based Business.</FONT></TD></TR></TBODY></TABLE></TD> <TD border="0" > </TD></TR></TBODY></TABLE></TD></TR> <TR border="0" > <TD align=center height=30 border="0" ><SPAN class=style7> </SPAN></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></BODY></HTML> Quote Link to comment Share on other sites More sharing options...
resago Posted January 24, 2008 Share Posted January 24, 2008 check to see if you've done something silly like assign the a tag the same color as the background in your css Quote Link to comment Share on other sites More sharing options...
Stooney Posted January 24, 2008 Share Posted January 24, 2008 try this, it's basically the same thing, just cleaned up. if (mysql_fetch_array($result_code)){ echo 'Congratulations!!You are now a registered member of Dozentips Home Business!! <a href="http://www.google.com">To continue please click here..</a>'; } Quote Link to comment Share on other sites More sharing options...
sudip_dg77 Posted January 24, 2008 Author Share Posted January 24, 2008 Great it worked now.!! Thanks a ton to all. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.