SitePoint Sponsor |
|
User Tag List
Results 1 to 10 of 10
-
Apr 10, 2009, 00:09 #1
- Join Date
- Jul 2006
- Posts
- 73
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
interstitial page- saving post/get variables and sending them to next page
Hi,
I have page- form.php . It sends say- var1, var2 ... var n variables to interstitial.php . interstitial.php will show an advertisement and there will be a button to skip the ad. I want to send all variables then to post.php.
How do I do that? I thought of hidden variables but for every request the variables might change.
Can you guys help!
Thanks,
Nishant
-
Apr 10, 2009, 00:28 #2
You might create the querystring to send to post.php (they will be visible), or you can put them in a session (they won't be visible).
I don't think hidden variables (= a form) is the way to go, unless one always has to press the button to continue.Guido - Community Team Leader
The Votes Are In: The Winners of the 2013 Community Awards are...
Blog - Free Flash Slideshow Widget
-
Apr 10, 2009, 00:32 #3
- Join Date
- Jul 2006
- Posts
- 73
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Creating a query string means- sending variables by GET method? Am I right! So if I send the variables by get method then I have to somehow send all the variables to the final page.
Suppose inter.php?var1=name&var2=place&var3=animal
then clicking on SKIP button must open final.php?var1=name&var2=place&var3=animal
How to do this?
-
Apr 10, 2009, 00:36 #4
If the variables always arrive to inter.php in the querystring, then you might use
$_SERVER['QUERY_STRING'] and paste it to final.php.
If they can also arrive by POST, then you'll have to loop through $_POST and create the querystring yourself.Guido - Community Team Leader
The Votes Are In: The Winners of the 2013 Community Awards are...
Blog - Free Flash Slideshow Widget
-
Apr 10, 2009, 00:59 #5
- Join Date
- Jul 2006
- Posts
- 73
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks! But is there a limit to the amount of data you can send through a querystring?
-
Apr 10, 2009, 01:01 #6
I don't know. I'm sure there is
If you have too much data to send, then you might want to think about using sessions.Guido - Community Team Leader
The Votes Are In: The Winners of the 2013 Community Awards are...
Blog - Free Flash Slideshow Widget
-
Apr 10, 2009, 01:03 #7
- Join Date
- Jul 2006
- Posts
- 73
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Actually I am using this to make a facebook app. So I dont want to get into sessions thing. I am thinking of using this function to build hidden fields.
<?php
while (list($key,$value) = each($_POST)){
echo "Key: ".$key . "Value: ".$value."<br />";
}
?>
-
Apr 10, 2009, 01:12 #8
- Join Date
- Jul 2006
- Posts
- 73
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Actually I am using this to make a facebook app. So I dont want to get into sessions thing. I am thinking of using this function to build hidden fields.
<?php
while (list($key,$value) = each($_POST)){
echo "Key: ".$key . "Value: ".$value."<br />";
}
?>
-
Apr 10, 2009, 01:17 #9
- Join Date
- Jul 2006
- Posts
- 73
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
OK heres the working code. Hope it helps someone! Thanks quido for your help!
<form action="result.php" method="post">
<?php
while (list($key,$value) = each($_POST)){
echo "<input type=hidden name=\"$key\" value=\"$value\">";
}
?>
<input class=inputbutton type=submit value="Skip This Advertisement">
</form>
-
Apr 10, 2009, 05:56 #10
- Join Date
- Apr 2009
- Posts
- 248
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Completely OT, but for future reference:
The spec for URL length does not dictate a minimum or maximum URL length, but implementation varies by browser. On Windows: Opera supports ~4050 characters, IE 4.0+ supports exactly 2083 characters, Netscape 3 -> 4.78 support up to 8192 characters before causing errors on shut-down, and Netscape 6 supports ~2000 before causing errors on start-up.
Bookmarks