Solved

CGI: 'mailto' & internal server error

Posted on 2000-05-09
10
194 Views
Last Modified: 2013-12-25
I am trying to define a footer so that the same links appear at the bottom of every page, eg: Home, Disclaimer, Contact, etc.  The problem is that when I include the href for mailto, the page comes up with an internal server error.

Yes, the HTML is escaped. Yes, I tried escaping special characters in addition to escaping the block of html, and I've tried several different combinations of each: escaping HTML as a block and escaping individual characters.

The HTML is in the same footer with the other footer links, and they're fine. If I take out the href for mailto, the script is fine. Add the href for mailto, and it results in an error.

For example, this works just fine:

<a href="sitemap.shtml>Sitemap</a>&nbsp; |&nbsp;
<a href="http://www.mysite.net">Home</a>&nbsp; |&nbsp;

But if I immediately add

<a href="mailto:info@mysite.net">Contact</a>

just below the other two links, I get an internal server error.

Anyone have any idea why? Thank you for your time.
0
Comment
Question by:celere
  • 5
  • 3
  • 2
10 Comments
 
LVL 16

Expert Comment

by:maneshr
ID: 2793519
from the looks of it, the problem seems more to do with the email client that is fired up when the user clicks on mailto than anything else.

lets say the email client that is kicked up is netscape Email client.
i would suggest you try to fire up the same client directly and see if you still get the same error.

me feeling is that you will.

let me know.
0
 

Author Comment

by:celere
ID: 2793564
If I understand you correctly, you think it could be a browser issue?  I am not getting the internal server error after clicking mailto.  The error comes up before the page even loads, so the user doesn't have the opportunity to click on mailto.
0
 
LVL 6

Accepted Solution

by:
christopher sagayam earned 200 total points
ID: 2793779
try

a href="mailto:info\@mysite.net">Contact</


instead of

a href="mailto:info@mysite.net">Contact</


note the backslash
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

by:celere
ID: 2793828
Hero! Thank You!
0
 

Author Comment

by:celere
ID: 2794243
FYI -- I posted another question for 100 points here

http://www1.experts-exchange.com/Computers/WWW/CGI/Q_10341470.html

Thanks for your help!
0
 

Author Comment

by:celere
ID: 2797280
Greetings!

For the record, I just found that if I have my footer as a separate HTML file called into the cgi script:

#Footer
undef $/;
open(FILE, "footer.html")|| die print "case closed";
$footer=<FILE>;
close(FILE);
$/="\n";

straight HTML works, and none of the characters need escaping.
Note this works with the footer.html in the same directory as the cgi script. I have yet to figure out how to use references outside of the directory.

Cheers!
0
 
LVL 6

Expert Comment

by:christopher sagayam
ID: 2797298
open(FILE, "footer.html")|| die print "case closed";


In the above statement .. you have to give the absolute path to footer.html .. if you want to refer to files oustside your directory
0
 

Author Comment

by:celere
ID: 2797315
I tried that, it didn't work.

If I have the footer in the parent directory, and use either

#Footer
undef $/;
open(FILE, "http://www.mysite.net/footer.html")|| die print "case closed";
$gfootbody=<FILE>;
close(FILE);
$/="\n";

-OR-

open(FILE, "/footer.html")|| die print "case closed";

I get a 500 error every time.

0
 
LVL 16

Expert Comment

by:maneshr
ID: 2797393
i dont think you can use open(FILE, "http://www.mysite.net/footer.html")

Also i would suggest you check the permissions of the CGI user under whom the script is executed. Chances are that person might not have read access to the / directory.
0
 
LVL 6

Expert Comment

by:christopher sagayam
ID: 2798431
open(FILE, "http://www.mysite.net/footer.html")|| die print "case closed";


absolute path will be something like this ..

for eg ..

open(FILE, "/home/celere/public_html/footer.html")|| die print "case closed";


0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Ever wondered how to display how many visitors you have online. In this tutorial I will show you an easy but effective way to display the number of online visitors in WhizBase. In this article I assume you have read my previous articles and know …
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question