Unable to add to Database via web form
Posted: Tue Dec 16, 2003 4:27 pm
Iam having problems doing inputs over the web. I am unsure why. Here is some code
index.php
<html>
<body>
<form action="comehere.php" method="post">
<input type="text" name="myname">
<input type=submit value="submit">
</form>
</body>
</html>
I have tried with and without "" around text and around filenames
comehere.php
let me make this even easier, I'll skip the database input and write this:
<html>
<body>
<?
if (!$myname){
echo "you have a problem";
exit;
}
#database code here
?>
</body>
</html>
ONLY the you have a problem will show up. There for my data is not getting sent. If I comment out that line and let everything go to the db then I get empty rows in the db.
Am I screwing up on permissions or something?
#2) When I look under the mysql database user table, I log in as myname. I do a select host,user from user; I receive a list like such
localhost root
localhost myname
% myname
What is %
thanks,
Fegero
index.php
<html>
<body>
<form action="comehere.php" method="post">
<input type="text" name="myname">
<input type=submit value="submit">
</form>
</body>
</html>
I have tried with and without "" around text and around filenames
comehere.php
let me make this even easier, I'll skip the database input and write this:
<html>
<body>
<?
if (!$myname){
echo "you have a problem";
exit;
}
#database code here
?>
</body>
</html>
ONLY the you have a problem will show up. There for my data is not getting sent. If I comment out that line and let everything go to the db then I get empty rows in the db.
Am I screwing up on permissions or something?
#2) When I look under the mysql database user table, I log in as myname. I do a select host,user from user; I receive a list like such
localhost root
localhost myname
% myname
What is %
thanks,
Fegero