Have to put isset post at top of .php pages for code to work
Posted: Fri Aug 01, 2014 3:27 am
This is my first post ever at a PHP forum. I have been learning PHP for a few weeks now and I have a question.
I am working through my manual (PHP / MySQL for the Absolute Beginner) and everytime I create a form within my PHP code, I need to add a line of code like the one below for every variable that I have on my page otherwise the form doesn't work.
The form method that I am using is:
In the manual, the author does not use 'isset'. The way that I discovered that using 'isset' above would work is that I did an internet search, and well, when I put it in my file, it worked.
The author of the book does not need to put this code in his files to work, and I am not sure if this is standard practice or not.
I am working on my live server which has the latest PHP, etc - they are quite jacked up.
Any help with this would be appreciated.
I am working through my manual (PHP / MySQL for the Absolute Beginner) and everytime I create a form within my PHP code, I need to add a line of code like the one below for every variable that I have on my page otherwise the form doesn't work.
Code: Select all
if(isset($_POST['die'])){ $die = $_POST['die']; }
Code: Select all
<form method="post">The author of the book does not need to put this code in his files to work, and I am not sure if this is standard practice or not.
I am working on my live server which has the latest PHP, etc - they are quite jacked up.
Any help with this would be appreciated.