Solved

CGI: 'mailto' & internal server error

Posted on 2000-05-09
10
189 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
Comment Utility
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
Comment Utility
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
Comment Utility
try

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


instead of

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


note the backslash
0
 

Author Comment

by:celere
Comment Utility
Hero! Thank You!
0
 

Author Comment

by:celere
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:celere
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
This tutorial will discuss the log-in process using WhizBase. In this article I assume you already know HTML. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you might look at some of my other articles abo…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now