karl09 Posted September 28, 2013 Share Posted September 28, 2013 Hi Guys Im new to php and i am currently working my way through a book i found called, "php and mysql web development". It seems a good book, however the code for the first exercise is not working for me. The book comes with the code snippets on a disc but even these do not run when i try. Could someone pls take a look as i have no idea, i have tried to find the answer over the last 2days. Thankyou in advance for any help.orderform.htmlprocessorder.php Link to comment https://forums.phpfreaks.com/topic/282499-new-to-php-variable-not-returning-a-value/ Share on other sites More sharing options...
Ch0cu3r Posted September 28, 2013 Share Posted September 28, 2013 I have a feeling this book is out of date. echo $tireqty." tires<br>"; echo $oilqty." bottles of oil<br>"; echo $sparkqy." spark plugs<br>"; The above is the old way of getting data from a form that has been submitted. This will only work if a setting called register_global is enabled. This setting has been removed as of php5.4. You should find a book that is using this version at least, a book published in 2012 should be more up to date. The correct code would be to use the $_POST super global instead echo $_POST['tireqty']." tires<br>"; echo $_POST['oilqty']." bottles of oil<br>"; echo $_POST['sparkqty']." spark plugs<br>"; Link to comment https://forums.phpfreaks.com/topic/282499-new-to-php-variable-not-returning-a-value/#findComment-1451528 Share on other sites More sharing options...
karl09 Posted September 28, 2013 Author Share Posted September 28, 2013 Thankyou Ch0cu3rIts working and i will get a up to date book asap, but thankyou very much for getting back to me so fast. Rgds Karl Link to comment https://forums.phpfreaks.com/topic/282499-new-to-php-variable-not-returning-a-value/#findComment-1451532 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.