Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I am trying to use a text box to insert information into an MYSQL db thus:
//insert name and userid
$sql = "INSERT INTO characters (charname, userid) VALUES ('$charname','$userid')";
mysql_query($sql) or die(mysql_error());
?>I am using this code to insert the simple text info:
echo ('logout');
?>
<?php
$charname = $_POST['$charname'];
?><link href="rifts.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="/rifts/login/rifts.css"><html>
<body>
<div id="leftcontent">
<form id="contactform">
<fieldset>
<dl>
<dt><label for="name">Character Name</label></dt>
<dd><input type="text" name="charname" value="" /></dd>
<dt><label for="email">Your Email Address</label></dt>
<dd><input type="text" name="email" value="" /></dd>
</dl>
</fieldset>
</form>But it simply does not work. I do not know what I am doing wrong, ro why it isn't working. I'm getting really fed up as I cannot see what i am doing wrong. If someone could let me know, point me in the right direction, or, even better, jsut tell me! I'd be very grateful.
Many thanks,
Nick

OK, not sure if the code above is all from one page or two pages. Please post all of the code in it's entirety. As it is there are some things that don't make sense to me. For example this line:
$charname = $_POST['$charname'];
You don't use that variable anywhere int he code that follows. Are you getting any types of errors?
Michael J

it looks likes you're missing some information... or at least we are (the viewers). if suggest anything it'd be the line
$charname = $_POST['$charname'];
change it to
$charname = $_POST['charname'];
FBI Agent
AIM: EliteAssassin187

![]() |
Counting pattern matches ...
|
enter variable in batch f...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |