Jump to content

Passing variable


teknospr

Recommended Posts

Im trying to pass two variables to a page that will insert into a database some info. I can pass one but when  I code it to pass two I get a wrong redirect page and an error. Here is the part of the code giving me trouble, including the get variables

 

<?php
$aid = $_GET['aid'];
$page='insertvisits.php';
$urbid = $_POST['urbid'];
?>
<form action="<?php echo $page."?aid=".$aid&"uid=".$urbid; ?>" method="post">  

 

Any help will be appreciated

Link to comment
https://forums.phpfreaks.com/topic/242592-passing-variable/
Share on other sites

hey you will encounter problem passing variable like that

<?php echo $page."?aid=".$aid."&uid=".$urbid; ?>

if that variable holds lots and lots of info inside it. there's limit to how much info you can passing.

but if your variable hold little info, should be fine. otherwise, your browser will freak out!!!

Link to comment
https://forums.phpfreaks.com/topic/242592-passing-variable/#findComment-1246337
Share on other sites

The code for passing should be like this:

 

<?php echo $page."?aid=".$aid."&uid=".$urbid;?>

 

you need an & after the first variable inbetween the 1st variable value and the 2nd variable name.

 

and you just needed to add another period before the uid variable name being passed.

 

 

Link to comment
https://forums.phpfreaks.com/topic/242592-passing-variable/#findComment-1246428
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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