Forum Moderators: open

Message Too Old, No Replies

Universal Script?

Cross browser scripts?

         

Mr_N

5:04 pm on Apr 23, 2004 (gmt 0)

10+ Year Member



I've been looking around for scripts that allow visitors to email the page their looking at on a site to a friend. The thing I've noticed though is that all of the scripts I've come across favor IE. Is it even possible to make a javascript that does this function or allows visitors to add the page to bookmarks that can work on multiple browsers besides just IE or is there just too many fundamental differences between the browsers in these circumstances to make a bookmarking or email script work universally?

Bernard Marx

10:11 pm on Apr 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm fairly sure that non-IE browsers don't do boomarks etc via script.

The fact that no one else has replied adds weight to this suspicion.

bgrobe

12:47 am on Apr 25, 2004 (gmt 0)

10+ Year Member



Use a cgi that uses SMTP to send the message.
Something like this...

<html><head>
<script language=javascript>
function mail()
{
var email_address=document.form.eml.value;
document.location="http://www.yoursite.com/send_mail.php?address=" + email_address;
}
</script></head>
<body>
<form name=form>
Type Friend's E-Mail Address Here: <input type=text name=eml> <input type=button value="Go!" onClick="mail()"></form></body></html>

Make sure you change the values of "http://www.yoursite.com/send_mail.php" to whatever.
The code in send_mail.php would be:

<?php
$email=$_GET['address'];
$subject="subject";
$text="body text";
send($email,$subject,$text);
?>

Be sure to change the subject and body text variables ($subject & $text, respectively).