473,383 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

submiting form to same page, and jumping to another

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="samepage.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 1871
zorgi
431 Expert 256MB
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="samepage.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="notSamepage.php"[/PHP]

than your notSamepage.php should do all off database handeling before outputting the message.
May 30 '08 #2
hsriat
1,654 Expert 1GB
[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
thanks
Anyway, I solve t this way:
Using this function after the insertion to the database

[PHP] header("Location: http//notsamepage.php");[/PHP]
May 30 '08 #4
pbmods
5,821 Expert 4TB
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 100+
thanks
Anyway, I solve t this way:
Using this function after the insertion to the database

[PHP] header("Location: 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
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...
35
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...
6
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...
79
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...
5
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: ...
3
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...
5
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...
2
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.