$POST variables
Moderator: General Moderators
$POST variables
I have to redirect a page and I need the variables from that page.How can I include them in the redirect page.I read there is a posibility to use a session on the server.Either way could you help me?
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
Code: Select all
$var = $_POST['var'];
$other = $_POST['other'];
header("location: somepage.php?var=$var&other=$other");Code: Select all
session_start();
$_SESSION['var'] = $_POST['var'];
$_SESSION['other'] = $_POST['other'];
header("location: somepage.php");Code: Select all
session_start();
echo $_SESSION['var'];//will echo what $_POST['var'] was originally
echo $_SESSION['other'];//will echo what $_POST['other'] was originallySorry I asked stupid questions but based on your example I wrote:
<a href="<?php echo("moduli_contatto.php?name=$cname")?>"
and it's not working for the first two results,for the other 100 it works.All it's put in:
while($data=mysql_fetch_array($result)){
<table>
...
<a href="<?php echo("moduli_contatto.php?name=$cname")?>"
...
</table>
Is there a problem if the string are something like "A B C Plane"?
I think it has no sense
<a href="<?php echo("moduli_contatto.php?name=$cname")?>"
and it's not working for the first two results,for the other 100 it works.All it's put in:
while($data=mysql_fetch_array($result)){
<table>
...
<a href="<?php echo("moduli_contatto.php?name=$cname")?>"
...
</table>
Is there a problem if the string are something like "A B C Plane"?
I think it has no sense
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
yes, there can be a problem. rawurlencode() can likely help you with it. Where does $cname come from?sebs wrote:Is there a problem if the string are something like "A B C Plane"?
I think it has no sense