I received this email in January from someone who was using my Free PHP eBook I am very sorry that I am only now replying to this. I will try to do a better job of checking this email address in the future.

Hi there

I am working my way through your eBook and I am having a lot of
difficulty with the passing of the variable from a form to a php
script. I have even gone as far as cutting and pasting your exact code
on page 18 and its still not working. All I am succeeding in doing is
showing

Hello, you are years old

The variables for name and age are not being passed. The form side of
the code seems to be working.

Please could you help as I have no idea what the problem could be.

Thanks

There are two possible reasons that this code is not working for you.

Reason #1: Sometimes when you copy-and-paste code directly from a document (Word, PDF, etc) and paste it into another document, the special characters (Quotes, etc) will be encoded differently between the two documents, and this causes a problem. Aside from the learning aspect of it, it is important not to copy-and-paste your code for this reason.

Reason #2: Your server may have additional security settings, which I did not account for in the first version of the Free PHP eBook. Basically, at the top of the page which is receiving the variables (in this case, form1output.php), you need to use the $_POST action for each variable. I will be accounting for this as begin to revise and update the eBook.

Thanks again to everyone that has taken the time to download and use the PHP eBook. I’ve had over 700 downloads, so I consider this a success thus far.

PHP eBook | April 10, 2008, 2:41 pm | Get RSS Feed | No Comments »