dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Passing data from one page to the next

  1. #1
    Join Date
    Apr 2012
    Posts
    12

    Passing data from one page to the next

    Hi,
    I am very new so please bare with me.
    I know how to submit a form with POST and echo a page in php.
    I have a feeling that i am missing a general concept though.

    Lets say i have a start page where the user selects a brand of car; ford, Chevy etc. I want to load a second page called for example selectedCarCo.html that has generic items no matter the car selected and then selection specific data as well.

    My question is I essentially need a method to get the selection from the first page to the second and load data based on that selection via AJAX or some other method.

    Is the correct approach to POST my selection to a php page and then echo out the code for the page including the generic items? I feel there must be a better way where i can have a normal html page and then access the car selection some how via javascript and act accordingly.

    Please advise,

    Thanks for the help.

  2. #2
    Join Date
    Aug 2006
    Posts
    1,942
    I would do this all server-side, as you describe it. No Ajax needed, you just pass the manufacturer in the POST string, and the page selectedCarCo.php (not html) looks in $_POST, finds "Chevy" and displays both the Chevy and the generic stuff. Pretty easy.
    Dave

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles