473,405 Members | 2,160 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,405 software developers and data experts.

Action and Header

I have used the action= statement to send the form to a new page which
can get the posted variables.

I have used the header("Location: foo.php) statement after testing on
the submit with isset.

What I want to know is if they can be combined. That is, test first
with the isset, and if no errors go to the action call. Simply going
with the header call doesn't seem to send the form variables.

Am I missing something?

Shelly

Feb 2 '06 #1
2 2347
sh*******@gmail.com wrote:
I have used the action= statement to send the form to a new page which
can get the posted variables.

I have used the header("Location: foo.php) statement after testing on
the submit with isset.

What I want to know is if they can be combined. That is, test first
with the isset, and if no errors go to the action call. Simply going
with the header call doesn't seem to send the form variables.

Am I missing something?

Shelly


Should be pretty easy - just try the following:

header("Location: foo.php?varname=varvalue&varname2=varvalue2");

This won't really work if you are passing sensitive information to the
next page because it will be
part of the URL - if you don't mind me asking why do you need to go to a
different page to interpret
and/or manipulate the data? You might want to think about keeping it a
part of the page that is
determining whether the variables are set. I would suggest something
like the following:

if( isset($varname) && isset($varname2) )
{
//your function here
//after function is complete then forward to next page
header("Location: wherever.php");
exit;
}

Just a thought.
Feb 2 '06 #2
sh*******@gmail.com wrote:
I have used the action= statement to send the form to a new page which
can get the posted variables.

I have used the header("Location: foo.php) statement after testing on
the submit with isset.

What I want to know is if they can be combined. That is, test first
with the isset, and if no errors go to the action call. Simply going
with the header call doesn't seem to send the form variables.

Am I missing something?

Shelly

What I think you are asking is how to combine a POST method with a GET
method in order to chain the processing of a form across multiple php
files. That is: the action from the form (assuming the method is POST)
will post the form variables to the first php file (named in the
action). After you do the isset, you then want to pass control to the
second php file for further processing.

If so, there are a number of ways to accomplish this but the two
simplest are:
1. call the second php file using a GET method. That is: use the calling
form of second.php?var1=val1&var2=val2... As you can see, this will
expose the values for var1, var2, etc.
2. use the SESSION mechanism to pass the values to the second php file.
This involves writing the values to the session and then using the
header to call second.php. Second.php must use the session to read back
the values it is expecting.

Most other ways involve the use of temporary storage in a disk file,
database table or shared memory segment. These are less efficient and
more complex to set up.

-david-

Feb 2 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Michael Brennan-White | last post by:
If I submit my for using a get action the resulting page loads . If I use a post action I get an error page saying "The page cannot be found". I am calling the originating page!!! This happens...
3
by: Michele | last post by:
Hi all, I have a form with 3 combobox whitin a asp page called data.asp, whose action form is itself; the first combobox drives the behaviour of the other two. The onchange event of the first...
10
by: iam247 | last post by:
Hi In my prototype asp page (with no javascript and no password validation, I have a registration form with the following action: <form name="form" method="post" action="RegDetails.asp"> ...
6
by: tencip | last post by:
Hi everyone, So, i've got a form that is very simple. It hold three elements: username, password, and domain. The goal here is to have the form submit the login to an administrative section...
2
by: John | last post by:
Hi all, After one of my user controls does either a server.transfer or response.redirect, the action method in a my resulting html form is being set and any request variables changed at the...
4
by: ingibjark | last post by:
Hello all I’m securing a web service using WSE 2.0. One of the potential client’s of the web service is a Java client using Sun JWSDP 1.5. The problem is that the java client gets the...
1
by: Gustav | last post by:
Im trying to use WSE 2.0 to connect to a WebService that authenticate the client through negotiation described in WS-SecureConversation Appendix I.3 (Token Discovery Using RST/RSTR). I use the...
8
by: M.L. | last post by:
Hello. I created a form using JS validation with the form tag as follows: <form name="form1" action="dynaform.php" method="post" onsubmit="return pvg_sub();"> The js validation script sends...
0
by: =?Utf-8?B?b2xkVkIzcg==?= | last post by:
I get HTTP status 400 - Bad Request when I send the following Soap envelope to a local WCF web service. If I either remove both the To and Action elements or the whole Header element, I get a good...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.