Jump to content

[SOLVED] Pass Var - simple question


JMair

Recommended Posts

I didnt clearify my problem. Here's is an example of my problem. It's getting php return to be sent over to page2.php along with the form action. The _Get or _POST works fine with the form, but not the php...

 

 

1.php


<form action= "subdirectory/2.php" method="post">

<?php

$YourGayUserName = 'Burt';
echo $YourGayUserName;

?>
  </p>
  <p>Select User: 
    <select name="guser">
<option value="Select User">UnSelected</option>
<option value="User1">Gay User One</option>
<option value="User2">Gay User Two</option>
<option value="User3">Gay Three</option>
</select>


<input type="submit" />
  </p>
</form>

 

 

 

2.php

<?php
echo $_GET['$YourGayUserName'] ."and " .$_POST['guser'];;
?>

In this case you can just use a hidden field.

 

page1.php

 

</pre>
<form action="subdirectory/2.php" method="POST">

$YourGayUserName = 'Burt';
echo $YourGayUserName;
?>
  
  
Select User:
    
UnSelected
Gay User One
Gay User Two
Gay Three



  
<

 

 

2.php

Use the POST method for both vars: (You had an extra ';' here)

 

echo $_POST['$YourGayUserName'] ." and " .$_POST['guser'];
?>

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.