kpetsche20 Posted June 13, 2008 Share Posted June 13, 2008 When ever I have this form sent, it does not fill in the values when sending the email. <? if($_GET['id']) { $get = "SELECT* FROM users WHERE id = '".$_SESSION['id']."'"; $id = mysql_query($get); $run = mysql_fetch_array($id); echo $run['login']; $sql = "SELECT * FROM products WHERE id = '".$_GET['id']."'"; $run = mysql_query($sql); for($x=0; $x < mysql_num_rows($run); $x++) { $data = mysql_fetch_array($run); $name = $data['name']; echo "".$data['name']."<br><br>".$data['description']."<br><br><img src=\"../images/products/".$data['picture']."\" > <form name=name action=index.php?p=sent method=POST> <input type=\"hidden\" name=\"product\" value=\"$name\"> <input type=hidden value=\"$run[firstname]\" name=\"firstname\"> <input type=hidden value=\"".$run['lastname']."\" name=lastname> <input type=hidden value=\"".$run['email']."\" name=email> <input type=hidden value=\"".$run['address']."\" name=address> <input type=hidden value=\"".$run['address2']."\" name=address2> <input type=hidden value=\"".$run['city']."\" name=city> <input type=hidden value=\"".$run['state']."\" name=state> <input type=hidden value=\"".$run['zipcode']."\" name=zipcode> <br> Quantity: <input type=text name=qty value=1> <input type=submit value=submit name=submit> </form> "; } } HANDLE CODE <div class="welcometo"></div> <?php $product = $_POST['product']; $firstname = $_POST['firstname']; $lastname = $_POST['lastname']; $email = $_POST['email']; $address = $_POST['address']; $address2 = $_POST['address2']; $city = $_POST['city']; $state = $_POST['state']; $zip = $_POST['zipcode']; $body = " Product: $product Firstname: $firstname Lastname: $lastname Emai; $email Address: $address Address2: $address2 City: $city State: $state Zip: $zip "; $to = '[email protected]'; mail($to, 'Product Inquiry', $body); ?> Link to comment https://forums.phpfreaks.com/topic/110089-help-with-mail-function/ Share on other sites More sharing options...
ag3nt42 Posted June 13, 2008 Share Posted June 13, 2008 where is this variable being set? if($_GET['id']) also are you forgetting to hash out of this yours: echo "".$data['name']." myne: echo "\".$data['name']." thats all that i can find right now... hope it helps :-\ Link to comment https://forums.phpfreaks.com/topic/110089-help-with-mail-function/#findComment-565040 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.