Jump to content

Help with mail function


kpetsche20

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.