Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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