ljhodgett
asked on
retrieve for data
Hi Experts
The below code takes the results of a form and saves it to a mysql database. Im pretty new to PHP and have used tutorials to create the below code. Save to mysql works fine but when I try to constuct a sting it fails on line 30
$part2 = echo $_POST["firstname"];
Im trying to retrieve the fistname field of the form.
Hows do I do this please.
Many Thanks
Lee
<?php
$con = mysql_connect("localhost", "web17-eba yorder","t esttest");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("web17-eba yorder", $con);
$sql="INSERT INTO test
(firstname,lastname,addres s_line_1,a ddress_lin e_2,town,c ounty,post code,domai n_name,ema il,code)
VALUES
('$_POST[firstname]','$_PO ST[lastnam e]','$_POS T[address_ line_1]',' $_POST[add ress_line_ 2]','$_POS T[town]',' $_POST[cou nty]','$_P OST[postco de]','$_PO ST[domain_ name]','$_ POST[email ]','$_POST [code]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
//echo "Success!";
?>
<frameset rows="*,300" frameborder="no" border="0" framespacing="0">
<frame src="http://www.internetrunner.com" name="mainFrame" id="mainFrame" title="mainFrame" />
<frame src=
<?PHP
$part1 = "https://customer.heartinternet.co.uk/addpack.cgi?authcode=58499-raYeewU%2B9X;email="
$part2 = echo $_POST["firstname"];
$part3 = ";M_domain="
$part4 = echo $_POST["domain_name"];
$part5 = ";M_typeid=12345;status=Y" ;
echo $part1 $part2 $part3 $part4 $part5
?>
name="bottomFrame" scrolling="No" noresize="noresize" id="bottomFrame" title="bottomFrame" />
</frameset><noframes></nof rames>
The below code takes the results of a form and saves it to a mysql database. Im pretty new to PHP and have used tutorials to create the below code. Save to mysql works fine but when I try to constuct a sting it fails on line 30
$part2 = echo $_POST["firstname"];
Im trying to retrieve the fistname field of the form.
Hows do I do this please.
Many Thanks
Lee
<?php
$con = mysql_connect("localhost",
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("web17-eba
$sql="INSERT INTO test
(firstname,lastname,addres
VALUES
('$_POST[firstname]','$_PO
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
//echo "Success!";
?>
<frameset rows="*,300" frameborder="no" border="0" framespacing="0">
<frame src="http://www.internetrunner.com" name="mainFrame" id="mainFrame" title="mainFrame" />
<frame src=
<?PHP
$part1 = "https://customer.heartinternet.co.uk/addpack.cgi?authcode=58499-raYeewU%2B9X;email="
$part2 = echo $_POST["firstname"];
$part3 = ";M_domain="
$part4 = echo $_POST["domain_name"];
$part5 = ";M_typeid=12345;status=Y"
echo $part1 $part2 $part3 $part4 $part5
?>
name="bottomFrame" scrolling="No" noresize="noresize" id="bottomFrame" title="bottomFrame" />
</frameset><noframes></nof
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
-r-