Need to get values form form without going to a new script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ctp
    New Member
    • Oct 2006
    • 1

    #1

    Need to get values form form without going to a new script

    I'm trying to build an interactive form that dynamically pulls prices from a mySQL table based on a users selection from a number of text & dropdown menus. The idea is that the user does not have to submit the form (and continue to the purchase process) until the user has tried a number of variables and recieved a number of possible prices.

    So the way I see it is that the user changes a dropdown, which triggers some PHP code to go fetch the new price for the new combination, and then a piece of PHP code echos that out into the form (which hasn't gone anywhere).

    There are over a 100 possible prices based on different combinations, putting this into an array is not the way to go.

    Another complication: the page is one server and the mySQL DB is on another server, so $_SERVER['PHP_SELF'] doesn't fly. And the I seem to need to have a an include containing the PHP on the server with the mySQL DB.

    I'm not sure if I've just forgotton something elemental or if this is really as difficult as it seems.

    Any comments are appriciated - thanks.
    Last edited by ctp; Oct 18 '06, 11:36 PM. Reason: naughty grammer & spelling
  • brid
    New Member
    • Oct 2006
    • 13

    #2
    Originally posted by ctp
    I'm trying to build an interactive form that dynamically pulls prices from a mySQL table based on a users selection from a number of text & dropdown menus. The idea is that the user does not have to submit the form (and continue to the purchase process) until the user has tried a number of variables and recieved a number of possible prices.

    So the way I see it is that the user changes a dropdown, which triggers some PHP code to go fetch the new price for the new combination, and then a piece of PHP code echos that out into the form (which hasn't gone anywhere).

    There are over a 100 possible prices based on different combinations, putting this into an array is not the way to go.
    form that dynamically pulls prices.....out into the form (which hasn't gone anywhere)
    I suggest you read what is Ajax technology.

    Originally posted by ctp
    Another complication: the page is one server and the mySQL DB is on another server, so $_SERVER['PHP_SELF'] doesn't fly. And the I seem to need to have a an include containing the PHP on the server with the mySQL DB.
    It's possible and simple.

    Comment

    Working...