AllExperts > PHP4 
Search      
PHP4
Volunteer
Answers to thousands of questions
 Home · More PHP4 Questions · Answer Library  · Encyclopedia ·
More PHP4 Answers
Question Library

Ask a question about PHP4
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Jason Baker
Expertise
I can answer most questions you may have for me. If I can not answer something I will have an answer for you within the required time for AllExperts.

Experience
I have four years in the industry with a wide range of clients. THey range from not for profits to small and medium businesses. I have done custom applications for many clients including oscommerce templates, script installations and many more.

Education/Credentials
I have an associates of applied science in PC support and networking. I had taken a programming class on php and mysql. I have also done independent studies after graduating college.

Past/Present Clients
AngelsAtGodCentralStation, Get Contrabrand, North Coast Orthodontics, Ultraflex Molding

 
   

You are here:  Experts > Computing/Technology > Perl/PHP > PHP4 > PHP

PHP4 - PHP


Expert: Jason Baker - 8/31/2009

Question
QUESTION: 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?

Answer
The 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

Add to this Answer   Ask a Question


 
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.