wayland Posted May 14, 2010 Share Posted May 14, 2010 I keep getting syntax when I try to change addresses. The top address works great, I want to delete this top address and use the bottom address so when a user forgets password the user is sent to the lost password page instead of sending email to Admin. <a href=\"mailto:$config{'admin_address'}\">$config{'admin_address'}</a> <a href="http://mysale2.com/cgi-bin/auction/auction.pl?action=lostpass">Forgot Your Password</a> Does anyone know how to change the code to make the bottom address work with the website? I deleted and added Print to the front, tried the \ and several other changes and I still get syntax error. Here is the total code from my website in the Sub I am working on. Thanks ------------------------------------------------------------------------------------- sub oops { print "<table align=\"center\" border=\"0\" width=\"90%\" cellspacing=0 cellpadding=0>"; print "<tr><td width=\"90%\" bgcolor=\"$config{'colortablehead'}\">"; print "<center><h2>User Error</center></h2>"; print "</td></td>"; print "<tr><td width=\"90%\" bgcolor=\"$config{'colortablebody'}\">"; print "<p><font color=\"#FF0000\"><h3>Error:</font><br>$_[0]</h3><P>Please hit the back < button on your browser to try again or contact the auction administrator at <a href=\"mailto:$config{'admin_address'}\">$config{'admin_address'}</a> if you believe this to be a server problem.<p>\n"; print "</td></tr>"; print "</table>"; ----------------------------------------------------------------- Quote Link to comment https://forums.phpfreaks.com/topic/201772-syntax-error-trying-to-add-page-link-how-to-recode/ Share on other sites More sharing options...
Muddy_Funster Posted May 14, 2010 Share Posted May 14, 2010 What exactly is the error? What is $_['0']? And is $config an array? Quote Link to comment https://forums.phpfreaks.com/topic/201772-syntax-error-trying-to-add-page-link-how-to-recode/#findComment-1058390 Share on other sites More sharing options...
gwolgamott Posted May 14, 2010 Share Posted May 14, 2010 What exactly are you wanting to change, guess lost in that I'm not sure what you want to change. But sounds like just a change and replace? And what's wrong with deleting the old line and replacing it with the new one? Quote Link to comment https://forums.phpfreaks.com/topic/201772-syntax-error-trying-to-add-page-link-how-to-recode/#findComment-1058393 Share on other sites More sharing options...
wayland Posted May 14, 2010 Author Share Posted May 14, 2010 Here is what I get when I upload the sub this way. The requested URL /cgi-bin/auction/auction.pl was not found on this server. Additionally, a 301 Moved Permanently error was encountered while trying to use an ErrorDocument to handle the request. Now if I change 1 code of the script (print ) I get this, Software error: syntax error at auction.pl line 21875, near ""<p><a href="http" Execution of auction.pl aborted due to compilation errors. sub oops { print "<table align=\"center\" border=\"0\" width=\"90%\" cellspacing=0 cellpadding=0>"; print "<tr><td width=\"90%\" bgcolor=\"$config{'colortablehead'}\">"; print "<center><h2>User Error</center></h2>"; print "</td></td>"; print "<tr><td width=\"90%\" bgcolor=\"$config{'colortablebody'}\">"; print "<p><a href="http://mysale2.com/cgi-bin/auction/auction.pl?action=lostpass">Forgot Your Password</a><p>\n"; print "</td></tr>"; print "</table>"; Thanks, Wayland Quote Link to comment https://forums.phpfreaks.com/topic/201772-syntax-error-trying-to-add-page-link-how-to-recode/#findComment-1058432 Share on other sites More sharing options...
kenrbnsn Posted May 14, 2010 Share Posted May 14, 2010 This looks like Perl, not PHP. Ken Quote Link to comment https://forums.phpfreaks.com/topic/201772-syntax-error-trying-to-add-page-link-how-to-recode/#findComment-1058433 Share on other sites More sharing options...
wayland Posted May 14, 2010 Author Share Posted May 14, 2010 Hi, I think it's a little of both, My auction website is built with java, perl and php and I think css so i am really learning Quote Link to comment https://forums.phpfreaks.com/topic/201772-syntax-error-trying-to-add-page-link-how-to-recode/#findComment-1058438 Share on other sites More sharing options...
gwolgamott Posted May 14, 2010 Share Posted May 14, 2010 need \ before your " print "<p><a href="http://mysale2.com/cgi-bin/auction/auction.pl?action=lostpass">Forgot Your Password</a><p>\n"; Needs to be this instead: print "<p><a href=\"http://mysale2.com/cgi-bin/auction/auction.pl?action=lostpass\">Forgot Your Password</a><p>\n"; EDIT: Explanation is that the print pukes because it thinks the print ends early with the " before the http and flips out because there is no semi-colon after it. So What you need to do is within a print either use single quotes around the print statement or if using double quotes and and double quote within the print statement to make sure you escape it with a backslash. print" "BOB" "; <-- WILL NOT WoRK print' "BOB" '; <-- SHould work print" \"BOB" "; <-- will not work print" \"BOB\" "; <-- Will Work and will print "BOB" print " BOB "; <-- Will work and will print BOB Quote Link to comment https://forums.phpfreaks.com/topic/201772-syntax-error-trying-to-add-page-link-how-to-recode/#findComment-1058441 Share on other sites More sharing options...
gwolgamott Posted May 14, 2010 Share Posted May 14, 2010 And yes this looks like PERL but that should still work for you. Quote Link to comment https://forums.phpfreaks.com/topic/201772-syntax-error-trying-to-add-page-link-how-to-recode/#findComment-1058447 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.