Add a parameter to php call

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • toufik toufik

    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.


  • Justin Koivisto

    #2
    Re: Add a parameter to php call

    toufik toufik wrote:
    [color=blue]
    > Hi,
    > I've a form that call a PHP file using the POST method , how can I pass a
    > new parameter to PHP .
    > thanks.[/color]

    Add a field to the form?

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

    Comment

    • toufik toufik

      #3
      Re: Add a parameter to php call

      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" <spam@koivi.com > wrote in message
      news:OAcNb.119$ 941.2940@news7. onvoy.net...[color=blue]
      > toufik toufik wrote:
      >[color=green]
      > > Hi,
      > > I've a form that call a PHP file using the POST method , how can I pass[/color][/color]
      a[color=blue][color=green]
      > > new parameter to PHP .
      > > thanks.[/color]
      >
      > Add a field to the form?
      >
      > --
      > Justin Koivisto - spam@koivi.com
      > PHP POSTERS: Please use comp.lang.php for PHP related questions,
      > alt.php* groups are not recommended.
      >[/color]


      Comment

      • Justin Koivisto

        #4
        Re: Add a parameter to php call

        toufik toufik wrote:
        [color=blue]
        > "Justin Koivisto" <spam@koivi.com > wrote in message
        > news:OAcNb.119$ 941.2940@news7. onvoy.net...
        >[color=green]
        >>toufik toufik wrote:
        >>[color=darkred]
        >>>Hi,
        >>>I've a form that call a PHP file using the POST method , how can I pass a
        >>>new parameter to PHP .
        >>>thanks.[/color]
        >>
        >>Add a field to the form?
        >>[/color]
        > 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.[/color]

        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 - spam@koivi.com
        PHP POSTERS: Please use comp.lang.php for PHP related questions,
        alt.php* groups are not recommended.

        Comment

        • NetFox

          #5
          Re: Add a parameter to php call

          You can introduce a new value to PHP, via the post with <input
          type="hidden" name="anewvaria ble" value="somethin gvaluable"> 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" <toufiki@sympat ico.ca> wrote in news:7scNb.1261 $c1.233022
          @news20.bellglo bal.com:
          [color=blue]
          > Hi,
          > I've a form that call a PHP file using the POST method , how can I pass a
          > new parameter to PHP .
          > thanks.
          >
          >[/color]

          Comment

          Working...