PHP4/PHP
Expert: Jason Baker - 8/31/2009
QuestionQUESTION: I want to setup on my website where the logged in user clicks submit on the form data...and then the form data is INSTANTLY manipulated to the correct webpage.
ANSWER: That can easily be done with php and mysql. Do a search for something like php login script. Depending on the names in the form fields you can just do an echo statement to show what they put into the form field.
---------- FOLLOW-UP ----------
QUESTION: What do you mean an echo statement
ANSWER: What I mean by an echo statement is the syntax to output writing/text to the screen.
So if someone put in the username johndoe you would have to remember the name of the field in this case it would be something like username
in php you can call variables you have made by the name attribute in a form field i.e.
<input type=text name="username" size=40>
where the variable name in this example has been put in quotes " "
so since the fields name is username you could set a variable up using something like what I have below
$username=$_POST['username'];
we declare the variable i.e. $username
then set it equal to the post array of username
=$_POST['username'];
then to echo back to the user their username you would do something like I have below
echo "Hello ".$username;
and when the form is submitted the resulting output would be:
Hello johndoe
---------- FOLLOW-UP ----------
QUESTION: Okay, but how does that write the form data to a new webpage and/or append to an existing one?
AnswerThe echo command does exactly what it says.
For instance if you were to go into dos and type in
echo This is MS-Dos 7
It would show on the next line.
This is MS-Dos 7
Except with php if you were to do something like:
echo "Hello ".$username;
You would get output of Hello Joe that is if Joe was set equal to $username