Jump to content

http and post array


Mantis_61

Recommended Posts

I've noticed when I send form requests to a file that stores the form input into variables I cannot use include this file with other files. Why is that? Can I not store the input into variables?

[code]
<?php
echo <<<end
<form action=".../process.php" method="post">
<select name="type">
<option value="a">A</option>
<option value=a+">A pos</option>
</select>
</form>
end;
?>[/code]
process...

[code]
<?php
$type = "{$_POST['type']}";
echo $type;
?>[/code]
however when I use an isset() it returns true?
Is this due to the state or security?
Link to comment
https://forums.phpfreaks.com/topic/15639-http-and-post-array/
Share on other sites

First off, you dont need the "" or the {} around the $var assignment

$type = $_POST['type'];

And it will return true always because you will always have one value selected since you did not provide a null option in the form (even so you'd have to use empty() to test for a null value)
Link to comment
https://forums.phpfreaks.com/topic/15639-http-and-post-array/#findComment-63777
Share on other sites

I have the extra q marks and brackets prepending for a sql statement but it still isn't storing my values from the form? and I know I got typos up there it isn't the original script but the original gives no errors. I was just wanting to know if I do store these values from the post array into variables and include that file will it work? I'm trying to send data from a form to 2 different form processors. Is there another method to do this? 
Link to comment
https://forums.phpfreaks.com/topic/15639-http-and-post-array/#findComment-63787
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.