I am having a very hard time figuring out how to pass a dynamic url to a popup window.
I have a link on my site to send this page to a friend. When you click you open a new window I can't figure out how to pull the dynamic url from the page into the form that should send the particular page to a friend.
IS there anyway to do this. I've search all the posts regarding send to a friend issues, but none of them have quite the right solution for my problem.
The link for the pop up window is as follows:
<a href="#" onClick="NewWindow('sendpage.php','Send','455','300','yes'); return false">
send this page to<BR>someone SUPER HOT!</a>
The sendpage.php is as follows:
<html><head>
<style type="text/css">
<!--
td {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
body {
margin: 0px;
padding: 0px;
}
.menu {
color: #FFFFFF;
text-decoration: underline;
}
-->
</style>
<link rel="stylesheet" href="kontrive_style.css" type="text/css">
<script language="JavaScript" src="w4ftell.js"></script>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<?php
if (!$friendemail1) {
?>
<br>
<form action="" method=POST>
<table width="459" border="0" cellspacing="0" cellpadding="3">
<tr>
<td width="129" align="left" valign="top"> </td>
<td width="10"> </td>
<td width="102">Name: </td>
<td width="194"> E-mail:</td>
</tr>
<tr>
<td class="right" valign="top" width="129"><b>I am </b><span class="extrasmall">(a
sexy bitch)</span><b>:</b></td>
<td width="10"> </td>
<td width="102">
<input type="text" name="name" class="specialpink" size="15">
</td>
<td width="194">
<input type="text" name="email" class="specialpink" size="20">
</td>
</tr>
<tr>
<td class="right" valign="top" width="129"><b>Hot Friend #1:</b></td>
<td width="10"> </td>
<td width="102">
<input type="text" name="friendname1" class="specialgreen" size="15">
</td>
<td width="194">
<input type="text" name="friendemail1" class="specialgreen" size="20">
</td>
</tr>
<tr>
<td class="right" valign="top" width="129"><b>Hot Friend #2:</b></td>
<td width="10"> </td>
<td width="102">
<input type="text" name="friendname2" class="specialorange" size="15">
</td>
<td width="194">
<input type="text" name="friendemail2" class="specialorange" size="20">
</td>
</tr>
<tr>
<td width="129" class="right" valign="top"><b>Message:</b></td>
<td valign="right" width="10"></td>
<td colspan="2">
<textarea name="text" class="specialred" cols="36" rows="6">
This site rocks. Check it out NOW! <? echo$QUERY_STRING; ?>
</textarea>
</td>
</tr>
<tr width="135">
<td width="129"><b></b></td>
<td width="10"> </td>
<td width="102" align="left">
<input type="submit" value=" Send " name="Submit" onClick="MM_validateForm('name','','R','email','','RisEmail','friendname1','','R','friendemail1','','RisEmail','friendemail2','','NisEmail','friendemail3','','NisEmail','text','','R');return document.MM_returnValue">
</td>
<td width="194"> </td>
</tr>
</table>
</form>
<?php
}
else {
if ($friendemail1) { mail( $friendemail1, "Message from $name", "$friendname1, \n\n".$text ."\n\nYour friend,\n $name", "From: $email"); }
if ($friendemail2) { mail( $friendemail2, "Message from $name", "$friendname2, \n\n".$text ."\n\nYour friend,\n $name", "From: $email"); }
echo "<center><br><br>Thanks crazy kid! Your friends have been notified.<br><br><hr=size=1>
<br><br><a href='javascript:window.close();'>Close this window</a>";
}
?>
</body>
</html>
the w4ftell.js is as follows: (you most likely don't need this info)
function newWindow(mypage,myname,w,h,features) {
if(screen.width){
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
}else{winl = 0;wint =0;}
if (winl < 0) winl = 0;
if (wint < 0) wint = 0;
var settings = 'height=' + h + ',';
settings += 'width=' + w + ',';
settings += 'top=' + wint + ',';
settings += 'left=' + winl + ',';
settings += features;
win = window.open(mypage,myname,settings);
win.window.focus();
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}
If anyone can help me find a solution, it would be greatly appreciated. I am really uneducated in terms of coding language,so the simpler the response, the better.
my page is https://secure.kontriveshop.com