form/php problem
am 02.06.2007 21:27:26 von lektrikpuke
Hi y'all,
I've made the below work by combining the 2 pages ( form and php file) into
1, but when I run the separated files the php file isn't run, it's
displayed. Any ideas?
Thanks.
Robert
**************************
Form
**************************
**************************
PHP file (display_details.php)
**************************
include ("connect.php");
if(!empty($_POST))
{
$adv_id = $_POST['adv_id'];
$result=mysql_query("SELECT * FROM advertiser_tbl WHERE adv_id =
'$adv_id'") or die (mysql_error());
while ($newArray = mysql_fetch_array($result)){
$adv_id = $newArray['adv_id'];
$adv_name = $newArray['adv_name'];
$cont_name = $newArray['cont_name'];
$cont_title = $newArray['cont_title'];
$address = $newArray['address'];
$city = $newArray['city'];
$state = $newArray['state'];
$zip = $newArray['zip'];
$active = $newArray['active'];
$notes = $newArray['notes'];
echo "
$adv_id: $adv_name
";
echo "Contact: $cont_name Title: $cont_title
";
echo "$address
";
echo "$city, $state $zip
";
if ($active=="1") echo "Active
";
echo "Notes: $notes
";
}}
?>
Re: form/php problem
am 02.06.2007 21:42:23 von lektrikpuke
Figured it. Just change the name of the form from htm to php. =)
"Mr. Newt" wrote in message
news:PbGdnUz5w6YCWfzbnZ2dnUVZ_uuqnZ2d@comcast.com...
> Hi y'all,
>
> I've made the below work by combining the 2 pages ( form and php file)
> into 1, but when I run the separated files the php file isn't run, it's
> displayed. Any ideas?
>
> Thanks.
>
> Robert
>
> **************************
> Form
> **************************
>
>
>
>
>
>
>
> **************************
> PHP file (display_details.php)
> **************************
>
> include ("connect.php");
>
> if(!empty($_POST))
> {
> $adv_id = $_POST['adv_id'];
> $result=mysql_query("SELECT * FROM advertiser_tbl WHERE adv_id =
> '$adv_id'") or die (mysql_error());
> while ($newArray = mysql_fetch_array($result)){
> $adv_id = $newArray['adv_id'];
> $adv_name = $newArray['adv_name'];
> $cont_name = $newArray['cont_name'];
> $cont_title = $newArray['cont_title'];
> $address = $newArray['address'];
> $city = $newArray['city'];
> $state = $newArray['state'];
> $zip = $newArray['zip'];
> $active = $newArray['active'];
> $notes = $newArray['notes'];
>
> echo "
$adv_id: $adv_name
";
> echo "Contact: $cont_name Title: $cont_title
";
> echo "$address
";
> echo "$city, $state $zip
";
> if ($active=="1") echo "Active
";
> echo "Notes: $notes
";
> }}
>
> ?>
>