Jump to content

syntax error, trying to add page link, How to recode


wayland

Recommended Posts

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>";

-----------------------------------------------------------------

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.