form action question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
devfun
Forum Newbie
Posts: 2
Joined: Wed Jan 12, 2005 2:44 pm

form action question

Post by devfun »

My index.html include a form, the code is like:
<form action="process.php" ...>

However this will redirect my current page index.html to process.php. I just want to use the php file to process the data which are extractted from the form in index.html and I want the index.html stays still. Anybody can tell me how to do this?

I am totally new in php, thanks a lot in advance.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

make sure your script outputs nothing, and include() the index.html file after it's done processing.

Alternately, you can use header() to redirect the user after the script has processed the form. Make sure you don't have any text output at all with this route.
devfun
Forum Newbie
Posts: 2
Joined: Wed Jan 12, 2005 2:44 pm

Post by devfun »

thank you very much. I'll try.
Post Reply