php form post is empty -
i started basics of html , php , hosted tiny website on server of friend , erverything worked fine. got own server , transfered website-data new server , changed mysql_connect()
, mysql_select_db()
parts. simple test mysql_query()
works, connection new database alive (and yes, there data in it). however, form post sends empty forms:
login.php: <form method="post"> <input name="user" type="text"> <button class="mybutton" type="submit" value="submit" name="submit">login</button> </form> <?php $user=mysql_real_escape_string($_post['user']); echo "user: ".$user; ?>
here username empty. tried changing first line this: <form action="login.php" method="post">
suggested here, doesn't work. url of loginpage looks this: subdomain.domain.de/login.php
, that's same location-syntax used on server of friend.
i read problematic .htaccess
-configuration, when search file, can't find it:
cd / find . -name ".htaccess"
hope can me (i believe it's simple)
mysql_real_escape_string()
requires active mysql connection in order work correctly; if aren't connected database, fail.
for more information can check these posts
mysql_real_escape_string stopped working when moved code server
and
mysql_real_escape_string works in localhost not on webserver
try remove function mysql_real_escape_string
, check again
change from
$user=mysql_real_escape_string($_post['user']);
to
$user=$_post['user'];
Comments
Post a Comment