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