Jump to content


Photo

http and post array


  • Please log in to reply
4 replies to this topic

#1 Mantis_61

Mantis_61
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 26 July 2006 - 12:30 AM

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?

<?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;
?>
process...

<?php
$type = "{$_POST['type']}";
echo $type;
?>
however when I use an isset() it returns true?
Is this due to the state or security?

#2 Mantis_61

Mantis_61
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 26 July 2006 - 01:01 AM

I'm sorry I didn't quite complete that. That does print there but when I include process.php in with
other php files and attempt to echo the variable it does not display the input.

#3 High_-_Tek

High_-_Tek
  • Members
  • PipPipPip
  • Advanced Member
  • 72 posts

Posted 26 July 2006 - 02:07 AM

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)

#4 Mantis_61

Mantis_61
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 26 July 2006 - 02:31 AM

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? 

#5 Mantis_61

Mantis_61
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 26 July 2006 - 03:37 AM

well I found other methods just requires more typing. I'd still like to know why my post elements aren't storing.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users