Hello Every one i am new to digitalpoint this is vary gr8 forum, All of user doing good job for providing good information i Need help with this PHP Script <? $refurl = $_SERVER['HTTP_REFERER']; ?> <? print $refurl;?> This Script is working fine with Firefox but with IE it can not get the address i am using it for "send this page to friend" Page. so any 1 help me with this ?
it has nothing to do with IE and Firefox its some mistake that is causing try this <? $refurl = $_SERVER['HTTP_REFERER']; echo $refurl; ?> This shd work Thanks Regards Alex
So far two people have given you code that is functionally identical to what you already had (assuming we can trust the "last edited" timestamp); not sure what that's about. Anyway, I doubt your problem has to do with Firefox vs IE, probably more to do with the means in which you are testing. HTTP_REFERER is an extremely fragile mechanism and I would say that depending on it for anything is a big mistake. You can better handle email-this-page by including an intercept function at the head of your template code, so that any time a page sees GET argument email_this_page=1 it will branch off to the email form.
$_SERVER['HTTP_REFERER'] not work in IE. I don't remember at 100% but try to use getenv() function...
with this script i get same Result it work with Firefox but nothing on IE <? $refurl = $_SERVER['HTTP_REFERER']; echo $refurl; ?> and with this <? $refurl = $_SERVER['HTTP_REFERER']; echo $refurl; ?> i get nothing on Firefox & IE well this is the full script i am using on form page <tr valign="top"> <td valign="middle" align="center"> <? $refurl = $_SERVER['HTTP_REFERER']; ?> <? print $refurl;?> <form name="tellafriend" action="tellafriend.php" method="post" onSubmit="return checkfields()"> <div align="center"> <center> <table border="0" cellpadding="10" cellspacing="0"> <tr> <td><span class="main">آپكا نام</span></td> <td> <input size="30" name="name" maxlength="45"> </td> </tr> <tr> <td><span class="main">آپكا ای میل</span></td> <td> <input size="30" name="email" maxlength="45"> </td> </tr> <tr> <td><span class="main">دوست كا ای میل</span></td> <td> <input size="30" name="fmail1" maxlength="50"> </td> </tr> <tr> <td><span class="main">دوست كا ای میل</span></td> <td> <input size="30" name="fmail2" maxlength="50"> </td> </tr> <tr> <td><span class="main">دوست كا ای میل</span></td> <td> <input size="30" name="fmail3" maxlength="50"> </td> </tr> <tr> <td colspan="2" align="center"> <span class="main"> پیغام (اگر ÛÛ’ تو)</span></td> </tr> <tr> <td colspan="2" align="center"> <textarea name="txtcoments" cols="50" rows="8"></textarea> </td> </tr> <tr> <td colspan="2"> <p align="center"> <input onClick="validate();" type="button" value="Send"> <input type=hidden name=refurl value="<? print $refurl;?>"> </td> </tr> and on PHP page <?php if(count($_POST)) { foreach(array('fmail1','fmail2','fmail3','email','name','txtcoments') as $key) $_POST[$key] = strip_tags($_POST[$key]); if(!is_secure($_POST)) { die("Hackers begone");} $emailto = "info@astrohope.com"; $esubject = "Astro Hope Page Recommendation"; $emailtext = " $_POST[name] has used your recommendation form using an email address of $_POST