Page 1 of 1

Problem with post

Posted: Mon Aug 18, 2003 9:35 am
by fozzy
I've a really problem.....
look my exemple:
###################teste.php
<html>
<body>
<form action="teste2.php" method="post" enctype="multipart/form-data">
<input type="text" name="texto">
<input type="submit" value="ok">
</form>
</body>
</html>

######################teste2.php
<?php
$string = $_POST['texto'];
echo "Var em post: ".$string."<br>";
echo "Var em get: ".$_GET['texto']."<br>";


//phpinfo();
?>


I dont can get the value from the posted variable....
What I can do?? :?: :?: :?: :?:

TNX
Klaus Kaiser

Posted: Mon Aug 18, 2003 9:55 am
by JayBird
If you have regitster globals off, an easy way of reading all the variables from a submitted form is to use this:

Code: Select all

extract($_POST);
This function is used to import variables from an array. It takes an associative array and treats keys as variable names and values as variable values.

Posted: Mon Aug 18, 2003 10:23 am
by Jean-Yves
Hi Klaus,

Are you sure that you mean the $_POST array variable? Your code works fine for me. However, the $_GET array variable won't display since nothing is coming across on the URL. Or was that just for debugging?

If you did mean $_POST, then I'm guessing that there's a problem in your php.ini file

try also:

Code: Select all

if(!isset($_POST&#1111;"texto"]))
  die("NOT SET!");
this will determine if the variable is actually being passed to the second page.