Jump to content

email friend form problem


verN

Recommended Posts

hi, I created a link where a user can click on and a new browser opens which allows the user to fill in the form and email a friend.

 

before code:

echo '<a href="http://localhost/test/test" target="_blank">Email friend</a>';

 

 

This was working perfectly but I then decided to use javascript to reduce the the size of the screen that apears without the addressbar. I used javascript however, this gets rendered perfectly in firefox it recognises the website the user wants to email a firend.

 

 

<script language="JavaScript"> 
function newwindow() {   
window.open('http://localhost/test/test,'jav','width=380,height=500,resizable=yes'); 
} 
</script> 

 

 

echo "<a href='javascript:newwindow()'>Email friend</a>"; 

 

However, when using exporer it gives me the following error: Undefined index: HTTP_REFERER in filename.php and i can't see where i'm going wrong. Here's the php code that doesn't recngnise the url address.

 

 

<?php $recommend_URL = $_SERVER['HTTP_REFERER']; ?> 

 

part of the form for emailing a freind:

 

 

<h2>Email this page to a friend</h2> 
<form name="form" method="post" action="email_form.php" onSubmit="return validate()"> 

  <p><?php echo "<a href=\"".$recommend_URL."\" target=\"_blank\">".$recommend_URL."</a>"; ?>  </p> 

 

thnaks

Link to comment
https://forums.phpfreaks.com/topic/46243-email-friend-form-problem/
Share on other sites

However, when using exporer it gives me the following error: Undefined index: HTTP_REFERER in filename.php and i can't see where i'm going wrong. Here's the php code that doesn't recngnise the url address. Problem lies in the following.

 

 

 

Code:

<?php $recommend_URL = $_SERVER['HTTP_REFERER']; ?> 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.