LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Problems with php 4.2.1 form-data and hidden variables (http://www.linuxquestions.org/questions/programming-9/problems-with-php-4-2-1-form-data-and-hidden-variables-32407/)

coea77 10-10-2002 03:42 AM

Problems with php 4.2.1 form-data and hidden variables
 
I've experienced the following problem, using php 4.1.2, with mozilla 0.9.9 :

i've put in a simple html file the following form :

<html>
<head>
<title>Prova</title>
</head>
<body>
<form action="action.php" method="POST" enctype="multipart/form-data">
<input type="text" name="testo" />
<input type="hidden" name="var1" value="1" />
<input type="hidden" name="var2" value="2" />
<input type="submit" name="sub" value="ok" />
</form>
</body>
</html>

the action.php is a very simple script printing the values of the 'testo' var :

<?php

echo( "<p>" . $_POST["var1"] . $var1 . $testo . "</p>" );

?>

The result page is always the same : nothing printed on screen, even with register_globals=on.
Is this right ? There is something else i should aware of ?

I've done this experiment because i tried to run phpWebSite 0.8.3, but the admin pages contains a lot of forms mixing hidden vars, with enctype="multipart/form-data",
but the hidden vars seemed to be ignored, provoking an abnormal behaviour (the app return always to the main page).

coea77 10-10-2002 04:24 AM

Ok, i found the problem !
 
.... it was the file_uploads flag in php.ini turned off !! I apologize for this ingenuity ... after all i'm a newbie ...


All times are GMT -5. The time now is 07:27 AM.