carlmartin10 Posted August 2, 2009 Share Posted August 2, 2009 I know this is probably a simple question, but I am on almost no sleep, so I am frustrated, sorry to bother you with this, bt I am at my wits end. I have the following PHP code. I want to make the word "HERE" a hyperlink to another page in my website, but I can not figure out the best way to do it. Any ideas? mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query = "INSERT INTO contacts VALUES ('','$first','$last','$city','$state','$country','$gender')"; $runquery = mysql_query($query); if($runquery) { echo "You have successfully created an ExBrief !"; } else { echo "<center><strong>Your ExBrief was not created.<br />Please review the information you entered for accuracy.</strong><br><br /><br />Click HERE to go back and try again.</center>"; } mysql_close(); Quote Link to comment https://forums.phpfreaks.com/topic/168471-solved-need-some-php-help-related-to-href/ Share on other sites More sharing options...
snoll Posted August 2, 2009 Share Posted August 2, 2009 Why don't you just put an <a> tag around the HERE in your echo statement? Quote Link to comment https://forums.phpfreaks.com/topic/168471-solved-need-some-php-help-related-to-href/#findComment-888684 Share on other sites More sharing options...
carlmartin10 Posted August 2, 2009 Author Share Posted August 2, 2009 I tried that and I kept getting an error saying the syntax was incorrect. I thought that would work too, but no dice. Quote Link to comment https://forums.phpfreaks.com/topic/168471-solved-need-some-php-help-related-to-href/#findComment-888685 Share on other sites More sharing options...
snoll Posted August 2, 2009 Share Posted August 2, 2009 Are you escaping the <a> tag's double quotes with backslashes? Quote Link to comment https://forums.phpfreaks.com/topic/168471-solved-need-some-php-help-related-to-href/#findComment-888689 Share on other sites More sharing options...
carlmartin10 Posted August 2, 2009 Author Share Posted August 2, 2009 actually, no, not sure how to do that properly. Quote Link to comment https://forums.phpfreaks.com/topic/168471-solved-need-some-php-help-related-to-href/#findComment-888693 Share on other sites More sharing options...
.josh Posted August 2, 2009 Share Posted August 2, 2009 "<a href=\"http://...\">...</a>" //or "<a href='http://...'>...</a>" Quote Link to comment https://forums.phpfreaks.com/topic/168471-solved-need-some-php-help-related-to-href/#findComment-888694 Share on other sites More sharing options...
carlmartin10 Posted August 2, 2009 Author Share Posted August 2, 2009 duh, rookie mistake...I am so PHP'ed out that I forgot about simple HTML rules..lol. Anyway, thanks for the assistance. I am working on this site, so I am sure I will be back for more help. This issue is handled, though. Thanks all! Quote Link to comment https://forums.phpfreaks.com/topic/168471-solved-need-some-php-help-related-to-href/#findComment-888701 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.