Jump to content

Passing PHP variables across pages


dnbmadness

Recommended Posts

Hi guys,

 

I've been going crazy over this and I'm hoping someone can help me. I'm making a website for a friend and I'm stuck on sending the model over to the contact page (from one form to another on a different page using $_POST).

 

Here is the website : www.ipgetter.com/test

 

I have successfully posted the Make variable to the contact us page, but I can't get the model sent over (the select boxes have different names).

 

Example:

 

<select class="form-dropdown" style="width:150px" id="input_2" name="q2_make">
            <option selected="selected" value="Alfa Romeo"> Alfa Romeo </option>
            <option value="Aston Martin"> Aston Martin </option>
            <option value="Audi"> Audi </option>
            <option value="Bently"> Bently </option>
            <option value="BMW"> BMW </option>
            <option value="Chevrolet"> Chevrolet </option>
            <option value="Chrysler"> Chrysler </option>
            <option value="Citroen"> Citroen </option>
            <option value="Ferrari"> Ferrari </option>
            <option value="Fiat"> Fiat </option>
            <option value="Ford"> Ford </option>
            <option value="Honda"> Honda </option>
            <option value="Hyundai"> Hyundai </option>
            <option value="Infiniti"> Infiniti </option>
            <option value="Isuzi"> Isuzi </option>
            <option value="Jaguar"> Jaguar </option>
            <option value="Jeep"> Jeep </option>
            <option value="Kia"> Kia </option>
            <option value="Lamborghini"> Lamborghini </option>
            <option value="Land Rover"> Land Rover </option>
            <option value="Lexus"> Lexus </option>
            <option value="Lotus"> Lotus </option>
            <option value="Maserati"> Maserati </option>
            <option value="Mazda"> Mazda </option>
            <option value="Mclaren"> Mclaren </option>
            <option value="Mercedes-Benz"> Mercedes-Benz </option>
            <option value="MG"> MG </option>
            <option value="Mini"> Mini </option>
            <option value="Mitsubishi"> Mitsubishi </option>
            <option value="Nissan"> Nissan </option>
            <option value="Peugeot"> Peugeot </option>
            <option value="Porsche"> Porsche </option>
            <option value="Renault"> Renault </option>
            <option value="Rolls-Royce"> Rolls-Royce </option>
            <option value="Seat"> Seat </option>
            <option value="Skoda"> Skoda </option>
            <option value="Smart"> Smart </option>
            <option value="Ssangyong"> Ssangyong </option>
            <option value="Subaru"> Subaru </option>
            <option value="Suzuki"> Suzuki </option>
            <option value="Toyota"> Toyota </option>
            <option value="Vauxhall"> Vauxhall </option>
            <option value="Volkswagen"> Volkswagen </option>
            <option value="Volvo"> Volvo </option>
            <option value="Other"> Other </option>
          </select>

 

That's the make, as for the model, the select boxes have different names so how am I supposed to capture the users selection and POST it?

 

<li class="form-line" id="id_3">
        <label id="label_3" for="input_3"></label>
        <div id="cid_3" class="form-input">
          <select class="form-dropdown" style="width:150px" id="input_3" name="q3_model">
            <option selected="selected" value="147"> 147 </option>
            <option value="159"> 159 </option>
            <option value="8C"> 8C </option>
            <option value="Breva"> Breva </option>
            <option value="Giulietta"> Giulietta </option>
            <option value="Mito"> Mito </option>
            <option value="Other"> Other </option>
          </select>
        </div>
      </li>
      <li class="form-line" id="id_4">
        <label id="label_4" for="input_4"></label>
        <div id="cid_4" class="form-input">
          <select class="form-dropdown" style="width:150px" id="input_4" name="q4_model4">
            <option selected="selected" value="Cygnet"> Cygnet </option>
            <option value="DB9"> DB9 </option>
            <option value="DBS"> DBS </option>
            <option value="Rapide"> Rapide </option>
            <option value="Vantage"> Vantage </option>
            <option value="Virage"> Virage </option>
            <option value="Other"> Other </option>
          </select>
        </div>
      </li>

 

I want to post only the selected make/model depending on the user selection. So my question is, how can I send the users chosen model selection over to the contact page form where there is more than one different select box? These select boxes are conditional so when you select "other" as make or model make/model, you may type one in. I'd like to send that also.

 

Any help is appreciated guys, thanks so much.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.