Alex
December 22nd, 2004, 11:18
I want to submit the input from a form to a php file for processing and adding it to a database.
The trouble is that it works perfectly on my 'localhost' but I upload it to a remote server (same PHP version) and I get my error: "No name specified." ... here is my hosts phpinfo: http://www.devplant.com/phpinfo.php
What could be causing this? Is there something I'm missing? :(
What I have:
<form name='f1' action='com/addobj.php' method='post'>
<div class='row' style='font-size: 11px;'>
Name of article: <input type='text' size='25' name='obj_name' />
</div>
<div class='row'>
<input type='submit' name='Add' value='Add article' />
</div>
<div class='spacer'>
</div>
</form>
and the PHP: (addobj.php)
<?php
if($_POST["obj_name"] = $obj_name) {
$insert = "INSERT INTO sayop_obj (obj_name) VALUES ('$obj_name')";
mysql_query($insert) or die("Sorry, could not add new object >>> " . mysql_error());
//...
} else { echo "No name specified.";}
?>
The trouble is that it works perfectly on my 'localhost' but I upload it to a remote server (same PHP version) and I get my error: "No name specified." ... here is my hosts phpinfo: http://www.devplant.com/phpinfo.php
What could be causing this? Is there something I'm missing? :(
What I have:
<form name='f1' action='com/addobj.php' method='post'>
<div class='row' style='font-size: 11px;'>
Name of article: <input type='text' size='25' name='obj_name' />
</div>
<div class='row'>
<input type='submit' name='Add' value='Add article' />
</div>
<div class='spacer'>
</div>
</form>
and the PHP: (addobj.php)
<?php
if($_POST["obj_name"] = $obj_name) {
$insert = "INSERT INTO sayop_obj (obj_name) VALUES ('$obj_name')";
mysql_query($insert) or die("Sorry, could not add new object >>> " . mysql_error());
//...
} else { echo "No name specified.";}
?>