Jump to content

[SOLVED] Is this an old version of PHP?


phpfanphp

Recommended Posts

Is this an old version of PHP because I keep getting blank screens.  I know the code is correct because it came straight from a book, work for work.  The book was written in 2002.

I am running PHP5 and downgraded to PHP4.  It didn't help.

 

Here's the PHP file (file 1 of 2)

<FORM ACTION="123.html" METHOD="POST">
  Input a name
  <br>
  <INPUT NAME="name" TYPE=TEXT>
  <br>
  <INPUT TYPE=SUBMIT VALUE="Search!">
</FORM>

 

Here's the HTML file 123.html (file 2 of 2)

<?php
echo $name;
?>

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/67385-solved-is-this-an-old-version-of-php/
Share on other sites

Yes, it's old. It's relying on register_global being enabled, which it is not by default for security.

Try $_POST['name'];

 

Also, add this to the top of your pages for error_reporting:

ini_set('display_errors', 1);

error_reporting(E_ALL);

 

Archived

This topic is now archived and is closed to further replies.

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