#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    MO, US
    Posts
    119
    Rep Power
    15
    I made a form - test.html - and added the following:
    <form method="post" action="test.cgi?var1=val1&var2=val2etcetc">
    <input type="submit" value="submit">
    </form>
    When I opened it and pressed submit it works great and the address on top was just like i typed in the "action" part--

    However, when I changed the values in the address and pressed "enter" it doubled the results with a comma. How should I get it to work using php? I know it has something to do with "Get" and "Post" - my php script processes the values submitted by another form and puts these values here:
    "test.cgi?itemname=$name&itemprice=$price&itemquant=$quant" then uses the header() command to redirect to that address, but like i said, doesn't work. Please help!!!
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    19
    Rep Power
    0
    I would love to help but I don't really understand what you're trying to do... since you are header is redirecting to the same test.cgi script, why don't you just process the data the first time? Do you want to add the coma? remove it? Or is it the redirection problem?

    If you are having trouble with the redirection try to enter a full URL. I don't think you can redirect with headers without a ful url. Do something like:

    header("Location:http://www.yoursite/thepath/test.cgi?itemname=$name&itemprice=$price&itemquant=$quant")

    I Hope this helps. If it doesn't, try to reexplain what your problem exactly is...

    Bakassi.

  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    MO, US
    Posts
    119
    Rep Power
    15
    My PHP script takes the values sent from the html and makes whole new values with if and else statements, like so:
    if ($quantity == '1000') {
    $itemquant = '1';
    $itemprice = '49.00';
    $itemname = 'whatever';
    } else if ($quantity == '2000') {
    etc., etc., etc.
    }

    Then I want to send the generated values into the test.cgi... do you have a better understanding of what I need now?

    Thanks - ken

Similar Threads

  1. Replies: 2
    Last Post: August 18th, 2004, 11:45 PM
  2. Tell me what's wrong..PHP CODE SIMPLE
    By steral in forum PHP Development
    Replies: 8
    Last Post: February 11th, 2004, 04:48 PM
  3. Simple find and replace word search for a text file with php?
    By rabid lemming in forum PHP Development
    Replies: 4
    Last Post: February 1st, 2004, 10:37 PM
  4. PHP with UnixODBC
    By coder4hire in forum PHP Development
    Replies: 2
    Last Post: January 20th, 2004, 02:14 PM
  5. UnixODBC + PHP + Apache + Empress
    By coder4hire in forum Database Management
    Replies: 0
    Last Post: January 15th, 2004, 02:41 PM

IMN logo majestic logo threadwatch logo seochat tools logo