Jump to content

Variables and $_POST


kyalee

Recommended Posts

This is a very newbie question, but I can't seem to find an answer that makes sense to me.

 

Often in scripts, especially mail contact forms, I've seen a construction like this:

 

$name = $_POST['name']; 
$email = $_POST['email']; 

 

At the beginning of the script. Two questions:

 

1. What is the advantage of doing it that way? If in the form itself, you have the input boxes named 'name' and 'email', why do you need to reset them that way?

 

2. Do you then have to use the construction $_POST['name'] when using the variable throughout the rest of the script or can you continue to use $name the entire way through?

Link to comment
https://forums.phpfreaks.com/topic/118923-variables-and-_post/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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