473,663 Members | 2,903 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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("Locatio n: 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 2358
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("Locatio n: 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("Locatio n: foo.php?varname =varvalue&varna me2=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("Locatio n: 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("Locatio n: 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
4190
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 in IE as well as FireFox. This code has been tested on a Win2003 server, IIS6, PHP 5.0.3, mySQL 4.1.8 and it works fine. The problem server is a Win2k server, IIS5, PHP 5.0.4, mySQL 4.1.11.
3
1977
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 combobox is related to a javascript function in which I call the submit method for the form, whose action form is itself. This works fine. The problem is that if I want to save the changes done by the user (clicking the OK button) I need to set the...
10
6603
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"> This works fine, the form details are collected by RegDetails.asp I am attempting to include javascript server side validation for the
6
13383
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 depending on which domain someone has chosen. For instance, let's say we have three administrative sites, that all have different URLs, but we want this one form to handle logging into any of them. So, the form itself needs to have a dynamic action
2
1455
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 client are not being reflected upon posting. How can I get rid of this? Can I somehow programmtically clear the action method so by the time the html reaches the client, it's clear? Please help - quite urgent.
4
6970
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 error “Server did not recognize the value of HTTP Header SOAPAction:”, and when I look at the trace the error is: WSE841: An error occured processing an outgoing fault response. ---> System.Web.Services.Protocols.SoapHeaderException: Header...
1
1280
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 following code to try to get a RSTR containing a "challange". string tokenType = "http://schemas.xmlsoap.org/ws/2004/04/security/sc/sct"; RequestSecurityToken rst = new...
8
6696
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 alerts when fields are not entered properly and it seems to work, except...when there are no errors, instead executing the php action script, I get a popup dialog box in IE6 asking if I want to download or run the php script. Can anyone tell me
0
3213
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 response. Any clues why the WCF service does this? <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Header> <To s:mustUnderstand="1"...
0
8436
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, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8345
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,...
1
8548
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8634
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6186
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 presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4349
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2763
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
2000
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1757
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.