The form I have created does not receive entries.
Here is index.html:
<html>
<body>
<iframe name = "main_frame" src = "http://stelucir.com/entry_ac.php" style = "position:absolute; width:80%; height:70%; left:10%; top:12%;">
</iframe>
<form name="form1" method="post" action="http://stelucir.com/entry_ac.php" target = "main_frame">
<div style = "position:absolute; width:80%; height:5%; left:0%; top:84%;">Image:</div> <input type="text" name="one" id="one" style = "position:absolute; width:80%; height:5%; left:10%; top:83%;"><br>
<div style = "position:absolute; width:80%; height:5%; left:0%; top:89%;">Part Descr:</div><input type="text" name="two" id="two" style = "position:absolute; width:80%; height:5%; left:10%; top:88%;"><br>
<div style = "position:absolute; width:80%; height:5%; left:0%; top:94%;">Email:</div> <input type="text" name="three" id="three" style = "position:absolute; width:80%; height:5%; left:10%; top:93%;">
<input type="submit" name="Submit" value="Submit" style = "position:absolute; height:5%; left:90%; top:93%;">
</form>
</body>
</html>
Here is entry_ac.php:
<?php
$host="mysql7.namesco.net"; // Host name
$username="djangofawkes"; // Mysql username
$password="mypass"; // Mysql password
$db_name="PH392701_corpses"; // Database name
$tbl_name="part"; // Table name
// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
// Get values from form
$one=$_POST['one'];
$two=$_POST['two'];
$three=$_POST['three'];
// Insert data into mysql
$sql="INSERT INTO $tbl_name(one, two, three)VALUES('$one', '$two', '$three')";
$result = mysql_query("SELECT one, two, three FROM part");
//loops through results
echo "<table border='1'>";
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "<tr><td>";
echo $row['one'];
echo "</td><td>";
echo $row['two'];
echo "</td><td>";
echo $row['three'];
echo "</td></tr>";
}
echo "</table>";
mysql_free_result($result);
?>
<?php
// close connection
mysql_close();
?>
In phpmyadmin in the mysql database I input:
CREATE TABLE `test_mysql` (
`id` int(4) NOT NULL auto_increment,
`one` varchar(65) NOT NULL default '',
`two varchar(65) NOT NULL default '',
`three` varchar(65) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=0 ;
When I input into the form it does not display the results of the database, the problem seems to be that it does not go into the database at all as the loop seems to work. It does however go into the database on localhost and works partially. On localhost, the loop works as well. Plz help.