[thelist] Form Mail

Keith Davis cache at dowebs.com
Fri May 25 11:38:55 CDT 2001


Ritwik Patra wrote:

> Yes! We can manage with the PHP script. I was wondering whether the "pop up"  thing and "close window" can be
> used without java script. Since you said no...where do I find the script for this purpose? Another question....can there
> be alternative ...Like if some has disabled java script ..Then he/she is provided with a simple format...I hope I am able
> to explain my requirement. Please do mention about the required java script....

The javascript you should use for closing your emailer window goes in
the body of the page that PHP will return after sending your email:

<script language=JavaScript>
document.write('<a href=javascript:window.close()>CLOSE</a>')
</script>

only a javascript enabled browser will see it, barbarians who run around
the web with javascript turned off will have to kill the window the old
fashioned way with their axe, but that's their choice.

As for opening the emailer window, the following will use the HTML
target to open a full size window for those same barbarians. Those with
javascript enabled will get a properly tailored and well mannered pop-up

<html>
<head>
<script language=javascript>
function emailer(){
wid=400;hei=400;
LeftPos = (screen.width) ? (screen.width-wid)/2 : 0;
TopPos = (screen.height) ? (screen.height-hei)/2 : 0;
url="URL_of_your_PHP"
window.open(url,"EMAIL","scrollbars=1,top="+TopPos+",left="+LeftPos+",width="+wid+",height="+hei)
}
</script>
</head>
<body>

<font size=2 face=Verdana,Arial,Geneva,sans-serif>
<script language=javascript>
document.write('<a href=javascript:emailer()>Send Us Email</a>')
</script>
<NOSCRIPT><a href="URL_of_your_PHP" target="EMAIL">Send Us
Email</a></NOSCRIPT>
</font>

</body>
</html>




More information about the thelist mailing list