JamesThePanda Posted May 22, 2008 Share Posted May 22, 2008 Hey Everyone This is my first post here, I have this proble with the script Im creating. The purpose of the script is, I enter a word into a text box, and then that word is displayed on the next page. (OK I know pretty simple, but I screwed it up) here is the code for the form <HTML> <BODY> <FORM ACTION="abc.php" METHOD = "POST"> Name<BR> <INPUT NAME = "name" TYPE=TEXT> <BR> <INPUT VALUE = "Submit" TYPE=submit> </FORM> </BODY> </HTML> and here is the code for abc.php <? echo $name; ?> My idea is the form should send the info to abc.php and then it should be echoed to the screen ? What am I doing wrong? Thanks James Link to comment https://forums.phpfreaks.com/topic/106735-problem-help-im-an-beginner/ Share on other sites More sharing options...
bilis_money Posted May 22, 2008 Share Posted May 22, 2008 in your abc.php <? $name= $_POST['name']; echo $name; ?> Link to comment https://forums.phpfreaks.com/topic/106735-problem-help-im-an-beginner/#findComment-547152 Share on other sites More sharing options...
JamesThePanda Posted May 22, 2008 Author Share Posted May 22, 2008 Hey that worked THanks I was just wondering how come. I was watching a video tutorial and the guy uses pretty much the exacte same code that I used the only differece was he was using his own computer to host I was using it, I was using my webserver Could that have made a difference? Thanks James Link to comment https://forums.phpfreaks.com/topic/106735-problem-help-im-an-beginner/#findComment-547155 Share on other sites More sharing options...
PFMaBiSmAd Posted May 22, 2008 Share Posted May 22, 2008 The information and code you found is dependent on register globals being on to "magically" populate program variables from post/get/cookie/session variables with the same name. The information you found was obsolete in the year 2002. The rest of this is my standard rant about a very serious problem that we should not be seeing anyone having in 2008, read on only if you want. Register globals and several other things that were added early in php's development were lazy-way short cuts to get the programming language to do something that the programmer should have been doing and only when he wanted them to be done. In the case of register globals, they allowed a hacker to set the value in session variables by simply adding a parameter to the end of the url when he requested your page. This was a huge blunder and IMO not enough was done to notify the community of the seriousness of the problem and to force new hosting accounts to not allow register globals to be on. Register globals were turned off by default in php4.2 in the year 2002. That was 6 full years ago. No new code, new books, new tutorials, new hosting accounts should have been created after that point in time that used or allowed register globals to be on. Several of these lazy-way short cuts have been turned off by default in current versions of php due to the problems and wasted time and effort they cause (just the opposite of what a short cut is supposed to do) and several of them have been completely eliminated in upcoming php6, such as register globals. Link to comment https://forums.phpfreaks.com/topic/106735-problem-help-im-an-beginner/#findComment-547227 Share on other sites More sharing options...
JamesThePanda Posted May 22, 2008 Author Share Posted May 22, 2008 Hey Thanks for the explaination. So when PHP6 comes out were does this leave script like OS Commerce? Thanks James Link to comment https://forums.phpfreaks.com/topic/106735-problem-help-im-an-beginner/#findComment-547423 Share on other sites More sharing options...
PFMaBiSmAd Posted May 22, 2008 Share Posted May 22, 2008 Out of date versions of OSC and those that don't have the register globals patch = dead under php6. I think they finally patched the current 2.x release to populate variables correctly when register globals are off. Version 3 is still Alpha level and not released. Link to comment https://forums.phpfreaks.com/topic/106735-problem-help-im-an-beginner/#findComment-547467 Share on other sites More sharing options...
JamesThePanda Posted May 23, 2008 Author Share Posted May 23, 2008 SO can you explain, what is this infamous register_globals all about what is its function. It been a pain serveral times, and it keeps cropping up. THanks JAmes Link to comment https://forums.phpfreaks.com/topic/106735-problem-help-im-an-beginner/#findComment-547828 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.