473,773 Members | 2,277 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

submiting form to same page, and jumping to another

20 New Member
I have a form that submits the form values to the same page (of the form). The database is feed from the same page that have the form in it.
So the action attribute would look like this

[PHP]<form action="samepag e.php"[/PHP]

Right now, after submiting, the same form opens, so the user dont know if his record was submited.

Saying this.
How can I do to: after sumniting the form, go to another page that tells "your record is submited"

thanks
May 30 '08 #1
5 1889
zorgi
431 Recognized Expert Contributor
I have a form that submits the form values to the same page (of the form). The database is feed from the same page that have the form in it.
So the action attribute would look like this

[PHP]<form action="samepag e.php"[/PHP]

Right now, after submiting, the same form opens, so the user dont know if his record was submited.

Saying this.
How can I do to: after sumniting the form, go to another page that tells "your record is submited"

thanks
You can do it in number f ways. probably the best way is to write new page that will contain your action script and echo "your record is submited" as your last command. So your form should look like this:

[PHP]<form action="notSame page.php"[/PHP]

than your notSamepage.php should do all off database handeling before outputting the message.
May 30 '08 #2
hsriat
1,654 Recognized Expert Top Contributor
[php]<?php
if (isset($_POST['submit']))
{
//do what you need to do with the posted data
//if everything done
//display page to say "your data has been submitted"
}
else
{
//print the form
}[/php]
Where submit is the name of the submit button in your form.
May 30 '08 #3
rodrigo21
20 New Member
thanks
Anyway, I solve t this way:
Using this function after the insertion to the database

[PHP] header("Locatio n: http//notsamepage.php ");[/PHP]
May 30 '08 #4
pbmods
5,821 Recognized Expert Expert
Heya, Rodrigo.

That's the way to do it.

In response to Zorgi's comment, you should always redirect after processing a form. If you simply output the results, then you become vulnerable to the POST-refresh problem (refreshing the browser page resubmits the form).
Jun 2 '08 #5
vikas1111
122 New Member
thanks
Anyway, I solve t this way:
Using this function after the insertion to the database

[PHP] header("Locatio n: http//notsamepage.php ");[/PHP]

Thanks solved my problem also..
Jun 3 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1403
by: Pat | last post by:
Here is how I have been submiting a form to a popup window, this works fine for all netscape versions and all IE versions previous to 6.0.2800.1106. Does anyone know a different way I can submit a form to a popup window? ------------------------------------------------ <script language="JavaScript"> function new_window() { // Reference the form in this page
35
2334
by: Dirk Bruere at Neopax | last post by:
Is it possible to have one table somehow 'called' to appear on different pages? I want something to appear on all pages, yet only want to (re)edit one item. -- Dirk The Consensus:- The political party for the new millenium http://www.theconsensus.org
6
2083
by: Frank Esser | last post by:
Hallo, I've got a project with about 10 pages. On each of them the user can do data changes (mostly datagrid interactions; the datagrids are bound to datasets). The user is able to jump to each page of my project without clicking on the "save" button and he can also close the browser without saving. My customer wants the user to be informed about loss of data. If any page is left without saving data changes then on the same page a...
79
3794
by: VK | last post by:
I wandering about the common proctice of some UA's producers to spoof the UA string to pretend to be another browser (most often IE). Shouldn't it be considered as a trademark violation of the relevant name owner? If I make a whisky and call it "Jack Daniels", I most probably will have some serious legal problems. "Mozilla" partially appeared because NCSA stopped them from using "Mosaic" in the UA string. Is it some different...
5
8042
by: midnight_use_only | last post by:
hi all, quick question, how do you submit a form to a parent window from a child popup window? i have the following and all online documentation *suggests* that it should work but it does NOT: // Parent window: <script language="JavaScript"> function popup(url, name) { window.open(url, name, "width=800,height=600,scrollbars=yes");
3
2414
by: goodmorningegg | last post by:
I've created a website using PHP that makes the page look like forms are being used. My problem is that when I submit a form it opens up to a brand new blank page saying "thanks for submitting the form" or whatever I told it to. I want to know how to make the form submit and put the confirmation into the web site design I've created. Its set up so that each link on the left side navigation bar opens up a page in the middle with the url...
5
1312
by: vbDavidC | last post by:
I have a form that has like 20 text boxes that are comments. When I create the textbox I add it below the previous one; eventually I run out of space on the form. I am able to resize the form but eventually I cannot continue to add more text boxes. The form height size maxes out at 812. I may not be using the right approach. I want to be able to have a bunch of text boxes underneath each other (they are comment fields that are...
2
2350
tolkienarda
by: tolkienarda | last post by:
hi i am trying to call a php function called "select". so far i have <form action="select" method="post"> the function is in the head of the html document. here is the entirety of the form. I will need to submit this same form to several different functions throughout the page so that is why i use the method i chose <form method="post" action=<? echo '"', $func, '"'; ?>> <select> <option>asdf</option>
0
9621
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10264
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6717
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5355
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4012
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3610
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2852
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.