Jump to content

Passing Varriables


ultraspoon

Recommended Posts

Hellooo,

 

I have a map on my site, a user types in there postcode, and clicks next, then a new page opens, the latitude and longitude, is passed from page one, to page two, the user then types in their details and clicks send.

 

The details are then sent to me.

 

But the latitude and longitude is not being sent in the email. Heres a breakdown of my code.

 

Page one.

 

<form method=LINK name="form1" action="apply.php">
<input name="latitude" type="hidden"/>
<input type="hidden" name="longitude"/>
<input type="submit" value="Submit">
</form

This adds the variables to the URL and passes them to next page.

 

Page two

 

<?php
$latitude = $_GET['latitude'];
$longitude = $_GET['longitude'];
?>

This grabs the variables and then.

 

<?php
echo "<input type='text' name='Longitude' value='{$latitude}'>";
?>

 

this places it into a text box, i then send the form just like any others, but it doesnt come through in the email. just blank

any suggestions or any better way to do this?

 

Thanks

Link to comment
Share on other sites

You are expecting someone who is not standing right next to you to be able to tell you what is wrong with your code without knowing what your code actually is.

 

There's at least 6 different things your code could be dong wrong that could cause this symptom.

 

It would take seeing all your page 2 code and the code on the page that is sending the email for someone in a forum to be able to help you with what is wrong with your code.

 

 

 

 

Link to comment
Share on other sites

Could it be because you are using name="Longitude" on the second page as opposed to name="longitude" on the first?

 

Variable names are case sensitive so $_GET['longitude'] is not the same as $_GET['Longitude'].

Link to comment
Share on other sites

Thank you all,

 

Sorry PFMaBiSmAd, i should of posted all of my code. Thanks for the link cyberRobot, i do understand, all of the post and get methods I am using them in my code somewhere, but the user who hit it on the head was micmania1!!! Woo!!

 

I ended up having the Variables with capital letters, changed them to lower case and it works fine.

 

Thanks all, I should come here more often, you lot are so helpful.

 

Thank you :)

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.