I have created a form to Insert new records into a mySQL db but it is not working.
I do not get any error messages returned but the new data is not getting to the database.
My form and code to process the form are in the same page.
The code is below:-
<html>
<head>
<title>Outline Vacancies test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFCC" text="#000000">
<?php
if($submit)
{
require( 'connect_jobs1.php' );
$sql="INSERT INTO allvacs (company) VALUES ('$company')";
$result=mysql_query($sql,$db);
echo "Thank you! Information entered.\n";
}
else
{
?>
<form method="post" action="insert_test.php">
<div align="center">
<h1> Graduate Vacancies update page
</h1>
</div>
<p align="left"> <font face="Verdana, Arial, Helvetica, sans-serif">Please enter
data into the boxes below:</font><br>
<p align="left"><font face="Verdana, Arial, Helvetica, sans-serif">company</font>
<input type="text" name="company">
<input type="submit" name="submit" value="Enter information">
<p align="center">
</form></body>
<?
}
?>
</html>
I hope someone can help me with this.
Thanks.
I do not get any error messages returned but the new data is not getting to the database.
My form and code to process the form are in the same page.
The code is below:-
<html>
<head>
<title>Outline Vacancies test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFCC" text="#000000">
<?php
if($submit)
{
require( 'connect_jobs1.php' );
$sql="INSERT INTO allvacs (company) VALUES ('$company')";
$result=mysql_query($sql,$db);
echo "Thank you! Information entered.\n";
}
else
{
?>
<form method="post" action="insert_test.php">
<div align="center">
<h1> Graduate Vacancies update page
</h1>
</div>
<p align="left"> <font face="Verdana, Arial, Helvetica, sans-serif">Please enter
data into the boxes below:</font><br>
<p align="left"><font face="Verdana, Arial, Helvetica, sans-serif">company</font>
<input type="text" name="company">
<input type="submit" name="submit" value="Enter information">
<p align="center">
</form></body>
<?
}
?>
</html>
I hope someone can help me with this.
Thanks.