The scripts which were written for php 4.3.0 do not seem to work with php 5.1.2 Or did I forget something when I configured php 5.1.2? With php 4.3.0 writing something in the password field produces whatever I wrote and "OK", but with 5.1.2 the variable does not pass. <?php echo $var.<br>; if (!$var){ echo "<form name=login method=post action='test.php'>"; echo "<input type=password name=var>"; echo "<br><input type=submit value='click'>"; echo "</form>"; } else{ echo "OK"; } ?>
you can do something like this <? if(isset($_POST['submit'])) { $var = $_POST[var]; echo "OK"; } else { echo 'Your html form'; } ?> PHP:
Use this :- <? if(isset($_POST['click'])) { echo $_POST['var']; exit; } else { echo "OK"; } echo "<form name='login' method='post' action='test.php'>"; echo "<input type='password' name='var'>"; echo "<br><input type='submit' value='click' name='click'>"; echo "</form>"; ?> PHP:
Also, there are quite a few changes implied in the change from PHP4 to PHP5. Have a look at the PHP manual.
Thank you, this problem was solved. But I could not find any mention of this in the PHP manual in the chapter which dealt with changes in migrating from 4 to 5. Now I) ran into something else (which wasn't mentioned in the manual, either). This is about error messages. If I write a script with a mistake in it (an extra parenthesis), <?php echo "This is a php-script"; { ?> PHP 4 gives an error message: Parse error: parse error, unexpected $ in /server/apache/htdocs/errormessage.php on line 3 PHP 5 returns a blank page. This is quite inconvenient, when trying to locate something extra or someting missing in a 300 line script.