473,378 Members | 1,688 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,378 software developers and data experts.

passing the POST to a php file

Hi,
I've an HTML form (contains 2 controls: input1 and input2) that call a php
file (file1.php) using the post method.
I need to call (from file1.php) another php file file2.php and pass the POST
information to it so I can get the information in the $_POST array in
file2.php.
How can I do it?

Thanks.
Jul 17 '05 #1
4 2540
toufik toufik wrote:

Hi,
I've an HTML form (contains 2 controls: input1 and input2) that call a php
file (file1.php) using the post method.
I need to call (from file1.php) another php file file2.php and pass the POST
information to it so I can get the information in the $_POST array in
file2.php.
How can I do it?


Search PHP.net for sessions. Use the $_SESSION array.

Shawn
--
Shawn Wilson
sh***@glassgiant.com
http://www.glassgiant.com

I have a spam filter. Please include "PHP" in the
subject line to ensure I'll get your message.
Jul 17 '05 #2
On Tue, 13 Jan 2004 10:26:46 -0500, toufik toufik <to*****@sympatico.ca>
wrote:
Hi,
I've an HTML form (contains 2 controls: input1 and input2) that call a
php
file (file1.php) using the post method.
I need to call (from file1.php) another php file file2.php and pass the
POST
information to it so I can get the information in the $_POST array in
file2.php.
How can I do it?

Thanks.


Thats actually available through the $GLOBALS['HTTP_POST_VARS'] array.

--
Matt
Jul 17 '05 #3
On Tue, 13 Jan 2004 10:26:46 -0500, toufik toufik wrote:
I need to call (from file1.php) another php file file2.php and pass the POST

information to it so I can get the information in the $_POST array in
file2.php.
How can I do it?


If you have an input thing called 'input1', and another called 'input2',
say something like:

<input type="textarea" name="input1" />

Then, you should be able to retrieve the contents of input1 by calling

$_POST['input1']

So, something like:

<?
echo $_POST['input1'];
?>
Jul 17 '05 #4
At the end of file1.php, you can do a redirect to
file2.php and attach the post variables as GET variables.

<? header ("Location: file2.php?var1=".$var1."&var2=".$var2); ?>

Hope this helps.

Ravi
Founder & Software Architect
http://WebmasterInABox.net

"toufik toufik" <to*****@sympatico.ca> wrote in message news:<T6********************@news20.bellglobal.com >...
Hi,
I've an HTML form (contains 2 controls: input1 and input2) that call a php
file (file1.php) using the post method.
I need to call (from file1.php) another php file file2.php and pass the POST
information to it so I can get the information in the $_POST array in
file2.php.
How can I do it?

Thanks.

Jul 17 '05 #5

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

Similar topics

5
by: Paul | last post by:
I want to use sessions to cover myself in case the user switches off cookies so I am passing the session ID manually through a hidden input field. This is what I have so far. index.php page...
1
by: Paul | last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and session.use_trans_sid = 1 in my php.ini file. Index.php contains:...
5
by: John Dewbert | last post by:
*** post for FREE via your newsreader at post.newsfeed.com *** Hello, I have trouble passing a folder object (from a FileSystemObject) to a sub procedure. Consider the following code: ...
10
by: Rigga | last post by:
Hi, Ok first please bear with me as I am a total Python n00b.. Can anyone explain why this does not like me using % FileLoc in the os.system call??? #!/usr/bin/python import sys import os
7
by: Harolds | last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005 the pmID is evaluated to "" instead of what the value is set to: .... xmlItems.Document = pmXML // Add the pmID...
3
by: Mark | last post by:
Hi From what I understand, you can pass arrays from classic ASP to .NET using interop, but you have to change the type of the.NET parameter to object. This seems to be because classic ASP passes...
3
by: Marc Castrechini | last post by:
First off this is a great reference for passing data between the Data Access and Business Layers:...
22
by: Arne | last post by:
How do I pass a dataset to a webservices? I need to submit a shoppingcart from a pocket PC to a webservice. What is the right datatype? II have tried dataset as a datatype, but I can't get it to...
7
by: =?Utf-8?B?YmVyaWNr?= | last post by:
New to this, I used to pass an array like this function BytesToString(byref myarray() as byte, somethingelse as long) as long and m = BytesToString(fooBar(), bluenose) This would send...
2
by: runway27 | last post by:
i am presently passing the value of a variable to a php file using GET after data has been inserted to the database. ex= $firstname = $_POST; if(!$sqlconnection) { echo "error message"; }
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: 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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.