Jump to content
xisto Community
kvarnerexpress

Sending Forms To A Different Location

Recommended Posts

Need some help, i have been out of the HTML programming for a while, and it isn't coming back very fast for me, or this isnt possible.Can i send the contents of a form to a different place then where the browser goes. I would like to send the contents of a form to a page where it will take the data and process it, basically putting all the data into a SQL table and creating a new file for the article. I want the user to go to a different page though, actually, back to the same form where they put in the information in the first place.Possible?

Share this post


Link to post
Share on other sites

I don't think it's possable with HTML, but with a little PHP, you would send the form to process.php which would contain this code

<?PHP//do the SQL stuff as mentioned without sending anything to to browserheader ("Location: [url=http://the]http://the[/url] address of the forum, or even use the server var regarding sending url");?>

Hope this helps, I assume similar things can be done with ASP, ect.
Edited by KuBi (see edit history)

Share this post


Link to post
Share on other sites

Yap.. As what moldbuy has commented, it is impossible to process the data or transfer the data with HTML alone. HTML is basically just the interface and GUI of the webpage. What is working behind the scenes are the server-side scripting such as PHP, JSP, ASP etc.For your case, there is no way to even connect and relate your basic HTML page to SQL. Hence directing to a different page will be impossible.

Share this post


Link to post
Share on other sites

I want the user to go to a different page though, actually, back to the same form where they put in the information in the first place.

You want to look up self-referencing forms.

Share this post


Link to post
Share on other sites

If you make the form itself in a php file, then you could have something like this:

<form method="post" action"[the file name]">  ...  <input type="submit" name="submit" value="submit" /></form><?phpif($_POST['submit']){     //process the stuff}?>
This will make the user come back to the form page. Also, having the if statement to check if the form has been submitted will make it so that the script doesn't process anything the first time the user enters the page.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.