Jump to content

PHP header(Location:) looping only in IE


doby_p

Recommended Posts

Hi,

Im new to all this coding stuff but get by ok with help from the wealth of info on the internet however in this instance i cant solve a PHP redirect issue im having.

Ive got a very simple php script to redirect to a secure paypal item link using the header function.

 

header("Location:https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XYX96W3MSFQZ6");

 

The problem is when the script is called upon in IE it loops endlessly however works perfectly in Chrome, Firefox, Opera and the Andriod stock browser.

I originally tried the redirect directly within the meta tag although this failed on all browsers so now i have the meta tag point to this PHP file. (The meta tag is in a script that submits form data and displays a temporary 'redirecting...' page.

 

Has anyone expirenced this problem before or know of ways to fix it for IE? Could it be an issue with security in IE because the paypal link is secure?

Any help would be greatly appreciated.

 

 

 

Link to comment
Share on other sites

After clicking to submit the form data it displays the  'redirecting' page for 2 seconds, emails me the form data and the meta tab calls on a php script to redirect to the paypal link however in IE it just loops the 'redirecting' page and never resolves to paypal. Im not sure what you mean by having the code on the target page, see the process below.

 

Form submit script

 

<?php

   

    /* subject and email variables */

 

$emailSubject = 'LightFold Order';

$webMaster = 't.pogodin@herts.ac.uk';

 

/* gathering data variables */

 

$nameField = $_POST['name'];

$surnameField = $_POST['surname'];

$emailField = $_POST['email'];

$phoneField = $_POST['phone'];

$address1Field = $_POST['address1'];

$address2Field = $_POST['address2'];

$cityField = $_POST['city'];

$countyField = $_POST['county'];

$postcodeField = $_POST['postcode'];

$countryField = $_POST['country'];

 

$body = <<<EOD

<br><hr><br>

Name: $nameField <br>

Surname: $surnameField <br>

Email: $emailField <br>

Phone: $phoneField <br>

Address1: $address1Field <br>

Address2: $address2Field <br>

City: $cityField <br>

County: $countyField <br>

Postcode: $postcodeField <br>

Country: $countryField <br>

EOD;

$headers = "From: $email\r\n";

$headers = "Content-type: text/html\r\n";

$success = mail($webMaster, $emailSubject, $body, $headers);

 

/* results renderd as HTML */

 

$theResults = <<<EOD

 

<html>

<head>

<title>Redirecting To Paypal</title>

<meta http-equiv="refresh" content="2;paypalredirect.php">

<style type="text/css">

<!--

body {

font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 20px;

font-style: normal;

line-height: normal;

font-weight: normal;

text-decoration: none;

padding-top: 200px;

margin-left: 120px;

width: 520px;

background-image: url(bg.gif);

background-repeat: repeat;

text-align: center;

}

-->

</style>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>

<div align="center" id="message">

  <p><img src="redirectingtopaypal.png" width="240" height="22"></p>

  <p><img src="spinner.gif" width="32" height="32"></p>

</div>

</div>

</body>

</html>

 

EOD;

echo "$theResults";

 

?>

 

Paypal Redirect Script

 

<?php

 

header("Location:https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XYX96W3MSFQZ6");

 

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.