I'm somewhat of a newbie to PHP, however i would appreciate if someone would be kind enough and help me with my problem.
To give you a better understanding of what my problem is, here is what i'm trying to do.
I have a webpage (A.php) which contains an html form (formA) which has a number of text fields and a submit button. When i click the submit button i want to be able to get the value in the text field assigned to a PHP variable so that i can use those vars to create a query, however it seems that i cannot get the values of the text fields. I have tried a few different ways, but it seems that i jsut cannot get it to work.
Could there be a problem with PHP 5.1.6. I am also using mySQL 4.1 and Apache 2.0.59.
Thank you!!!
The following in the actual code:
Being a newbie is no excuse for not following the Posting guidelines!
Since this is your first entry, I have enclosed your code within html tags.
Read the Posting Guidelines before you post anything in a thread.
Especially the part about putting code within code, php or html tags! - Ronald
test.php:
[html]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>OGAY</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php
$query1 = "INSERT INTO clients (custID,companyName,contactName,address,phone,fax, email)
VALUES (null,'$companyName','$name','$address','$phone',' $fax','$email');";
print ($query1);
?>
</head>
<body>
<span style="font-size:12pt">Please fill in all fields.</span><br/><br/>
<form name="addClient" method="get" action="test.php ">
<table>
<tr>
<td>Company Name:*</td>
<td><input type="text" name="companyName" size="30" maxlength="255" /></td>
</tr>
<tr>
<td>Contact Name:*</td>
<td><input type="text" name="name" size="30" maxlength="255" /></td>
</tr>
<tr>
<td>Address:</td>
<td><input type="text" name="address" size="30" maxlength="255" /></td>
</tr>
<tr>
<td>Phone:*</td>
<td><input type="text" name="phone" size="30" maxlength="10" /></td>
</tr>
<tr>
<td>Fax:*</td>
<td><input type="text" name="fax" size="30" maxlength="10" /></td>
</tr>
<tr>
<td>Email Address:</td>
<td><input type="text" name="email" size="30" maxlength="255" /></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="addClient" value="Add Client" />
<input type="reset" name="clear" value="Clear" /></td>
</tr>
</table>
</form>
</body>
</html>
[/html]