Jump to content

Problem (HELP Im an Beginner)


JamesThePanda

Recommended Posts

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
Share on other sites

Hey

that worked  ;D 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
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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