Click to See Complete Forum and Search --> : Displaying new URL?
SuzanneB
03-31-2005, 03:46 AM
I have a window that currently displays the result of some PHP. I need the window to display "Please wait" and then a few second later jump to a new URL, passing the new URL some parameters ( it is also generated by PHP).
The please wait part is fine ( ha ha!) but I am having trouble with the rest. Far as I can see, the only way to do this is to use PHP to place some JavaScript in the page???????????
scragar
03-31-2005, 05:45 AM
what exactly is it you want help with?
the redirecting?(in which case use a meta-redirect tag and a link, just in case)
the transfering of the info?(in which case use sessions to carry them from page to page, or store and then pull them from a DB)
solomon
03-31-2005, 02:47 PM
is it that the PHP results take a while to be generated - therefore you need a 'please wait' page to be polite?
The ideal solution would be to use a single html/javascript/php page - get the javascipt to ask the visitor to 'please wait' whilst the php is doing it's thing. I'm sure the guys in the javascript forum would be able to help you with this one.
Alternatively you could use an html iframe element in your page - the parent window saying 'please wait' whilst the php page is being parsed into the aframe.
*edit*
I couldn't help myself - this isn't a serious suggestion but at least it 'looks' like it's doing the right thing :D
<?php
echo "Please wait<p />";
$start = time();
while (time() < $start + 3) {
echo "<!---->";
}
echo "<h1>thanks</h1>";
?>
I think I've created a monster! :eek: the source code is horrific! I would show you buy I don't want you to eat my bandwidth :p
MarkL
03-31-2005, 03:27 PM
I have had to do this in the past where because of the environment I was not able to use a single page with php/javascript/html combined, which is the best way IMHO.
If you are in a similar situation, try the following:
Consruct the main page with an HTML form and Iframe, something like this -
<form action="http://your.site.net/subdir/redr_test.php" method="post" target="main"><input name="zip" /><input type="submit" value="Go" /></form>
<iframe name="main" src="" frameborder="yes" width="100%" scrolling="yes" height="350"></iframe>
Now construct redr_test.php to display the wait message and then redirect to the PHP page with the real code in it -
<?php
echo "<http>";
echo "<head>";
echo '<META HTTP-EQUIV="Refresh" CONTENT="1;URL=http://your.site.net/subdir/final_dest.php?zip='.$zip.'">';
echo "</head>";
echo "<body>";
echo "Please Wait, loading.....";
echo "</body>";
?>
final_dest.php will be whatever PHP file you already have to handle the input.
bokeh
03-31-2005, 06:24 PM
Is this the type of thing you are looking for? (http://myhomewebserver.co.uk/loading.php)
SuzanneB
04-01-2005, 02:19 AM
Hi there!
Sorry about the delay in getting back.
I have a window that is generated by PHP, but I need to display "wait" and pass control over to some PHP on another site (url) that I have no control over. The wait is because it often takes a few seconds for the other site to wake up! I need to pass some params to the other site as I go.
How then do I get PHP to jump to the other site and pass the parameters? I can't seem to find that in my book...:-)
solomon
04-01-2005, 11:55 AM
Are you looking too hard for a clever solution? Maybe you simply need something like this:
<a href="http://www.theothersite.com?var1=foo&var2=bar">
click here to proceed to next page - it may take a moment to load
</a>
or this
<form name="form1" method="post" action="http://www.theothersite.com">
<input name="var1" type="hidden" id="var1" value="foo">
<input name="var2" type="hidden" id="var2" value="bar">
<input name="click_me" type="submit" id="click_me" value="Click here to go to the next site. Please be patient. ">
</form>