Entry
How can I redirect the user to a relevant page after executing PHP code?
Jan 19th, 2000 18:45
Chris Kings-Lynne, Rio Bautista, Les Cole, Nathan Wallace, fsockopen()
A much better way is to have a php script like this...
<?php
// This script takes a zipcode and redirectst the visitor
// to a relevant website.
$url = getURL($zipcode); // This is implemented somehow...
Header("Location: $url");
?>
The location header will simply redirect the visitor's browser. It is
the perfect way to do this.
Old Answer
----------
I can think of 3 ways:
1. Crude way: make a php3 that displays a "click-here-to-continue"
page that automatically refreshes to the site of the store.
2. Using JavaScript w/ PHP: something like this
<?php
print '
<html>
<script language="JavaScript">
window.location.href = "'. $yourstoresURL .'"
</script>';
?>
3. fsockopen() way: use fsockopen() passing the URL of the store,
read from that socket and display the results. The example provided in
the manual should give you enough ideas for this.