I have a php page with a form....the form has a hidden variable called subjoin. with a value of 1
in the page the data is posted to i have the following code
[php]
<?
include("includ es/database.php");
?>
<?php
if(isset($_POST['subjoin'])){
// ADD A NEW CUSTOMER
mysql_query("IN SERT INTO details
(id, customername, companyname, building, street, town, county, postcode, telephone1, telephone2, telephone3, email) VALUES('', '$_POST[customername]', '$_POST[companyname]', '$_POST[building]', '$_POST[street]', '$_POST[town]', '$_POST[county]', '$_POST[postcode]', '$_POST[telephone1]', '$_POST[telephone2]', '$_POST[telephone3]', '$_POST[email]') ")
or die(mysql_error ());
echo "New Customer Added";}
?>
[/php]
i am going to have multiple forms going to this page so i need a way of defining which form has been submitted....bu t what i have above just wont work....have i missed something simple?
i know this code is probably old or messy but i just want to know what im doing wrong with it.
thx
And messy it is. Please enclose any code within the appropriate code tags. See the Posting Guidelines! - moderator
in the page the data is posted to i have the following code
[php]
<?
include("includ es/database.php");
?>
<?php
if(isset($_POST['subjoin'])){
// ADD A NEW CUSTOMER
mysql_query("IN SERT INTO details
(id, customername, companyname, building, street, town, county, postcode, telephone1, telephone2, telephone3, email) VALUES('', '$_POST[customername]', '$_POST[companyname]', '$_POST[building]', '$_POST[street]', '$_POST[town]', '$_POST[county]', '$_POST[postcode]', '$_POST[telephone1]', '$_POST[telephone2]', '$_POST[telephone3]', '$_POST[email]') ")
or die(mysql_error ());
echo "New Customer Added";}
?>
[/php]
i am going to have multiple forms going to this page so i need a way of defining which form has been submitted....bu t what i have above just wont work....have i missed something simple?
i know this code is probably old or messy but i just want to know what im doing wrong with it.
thx
And messy it is. Please enclose any code within the appropriate code tags. See the Posting Guidelines! - moderator
Comment