469,362 Members | 2,548 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,362 developers. It's quick & easy.

Add a parameter to php call

Hi,
I've a form that call a PHP file using the POST method , how can I pass a
new parameter to PHP .
thanks.
Jul 17 '05 #1
4 14078
toufik toufik wrote:
Hi,
I've a form that call a PHP file using the POST method , how can I pass a
new parameter to PHP .
thanks.


Add a field to the form?

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.

Jul 17 '05 #2
Thanks,
is it the only way that we have? because I have differents info in
differents pages, And I prefer not to add fields to the form.

"Justin Koivisto" <sp**@koivi.com> wrote in message
news:OA****************@news7.onvoy.net...
toufik toufik wrote:
Hi,
I've a form that call a PHP file using the POST method , how can I pass a new parameter to PHP .
thanks.


Add a field to the form?

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.

Jul 17 '05 #3
toufik toufik wrote:
"Justin Koivisto" <sp**@koivi.com> wrote in message
news:OA****************@news7.onvoy.net...
toufik toufik wrote:
Hi,
I've a form that call a PHP file using the POST method , how can I pass a
new parameter to PHP .
thanks.


Add a field to the form?

Thanks,
is it the only way that we have? because I have differents info in
differents pages, And I prefer not to add fields to the form.


You could prase the _POST array at the beginning of the script and look
for a field that tells what script submitted the form and process from
there... Just add something to each form like:
<input type="hidden" name="referer" value="<?php echo
$_SERVER['PHP_SELF'] ?>">

Then take your action based on the $_POST['referer'] field value.

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.

Jul 17 '05 #4
You can introduce a new value to PHP, via the post with <input
type="hidden" name="anewvariable" value="somethingvaluable"> in between
your <form> and </form> tags. The php file then called via the submit/post
has that variable available to it.

Daniel

"toufik toufik" <to*****@sympatico.ca> wrote in news:7scNb.1261$c1.233022
@news20.bellglobal.com:
Hi,
I've a form that call a PHP file using the POST method , how can I pass a
new parameter to PHP .
thanks.


Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by z_learning_tester | last post: by
11 posts views Thread by wuzertheloser | last post: by
4 posts views Thread by =?Utf-8?B?UHVjY2E=?= | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.