I've fought this, and it won't go. I really, honstly don't knwo what's going wrong. I've copied from this site, other sites, read the manual - nothing.
this is the input script:
<?php
//connect to the login db, characters table
mysql_connect('localhost', 'rifts', '***') or die('Failure to connect to the database');
mysql_select_db('login');
//insert data
//insert characters stats and name.
mysql_query ("INSERT INTO characters (charname, charstr, chardex,charcons,charint,charwis,charcha) VALUES
('$POST[$name]',
'$POST[$Str]',
'$POST[$Dex]',
'$POST[$Con]',
'$POST[$Int]',
'$POST[$Wis]',
'$_POST[$Cha]')");
mysql_query($sql) or die(mysql_error());
echo "Yep!";
?>
This is the form script:
<?php
include("config.php");
if($SESSION['logged'] != 'agk8gjf38834j2')
{
header("location:" . $login_file);
}
echo ('<a href="logout.php">logout</a>');
?>
<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="name" value="" /></dd><br>
<dt><label for="email">Your Email Address</label></dt>
<dd><input type="text" name="email" value="" /></dd>
</dl>
</fieldset>
</form>
<FORM id="chkboxform">
<fieldset>
<u>Sex</u><br>
<LABEL><INPUT TYPE="radio" NAME="answer" VALUE="true" CHECKED> Male</LABEL><br>
<LABEL><INPUT TYPE="radio" NAME="answer" VALUE="false"> Female</LABEL>
</fieldset>
</FORM>
<form id="contactform">
<fieldset>
Choose your book : <SELECT NAME = book STYLE = "Width:200">
<OPTION Value = 1>Rifts Manual</OPTION>
<OPTION Value = 2>Vampire Kingdoms</OPTION>
</SELECT>
</fieldset>
</form>
<FORM id="chkboxform">
<fieldset>
<u>Character Class</u><br><br>
<LABEL><INPUT TYPE="radio" NAME="class" VALUE="true" CHECKED>OCC</LABEL><br>
<LABEL><INPUT TYPE="radio" NAME="class" VALUE="false">SCC</LABEL>
</fieldset>
</FORM>
<form id="contactform">
<fieldset>
Character template :
<SELECT NAME = occ_rcc STYLE = "Width: 200">
<OPTION Value = 1>Rifts Manual</OPTION>
<OPTION Value = 2>Vampire Kingdoms</OPTION>
</SELECT>
</fieldset>
</form>
</div>
<div id="rightcontent">
<FORM id="contactform1">
<fieldset>
<u>Attributes</u><br><br>
<dt><label for="charStr">Strength</label></dt><dd><input type="text" name="Str" value="" /></dd><br><br>
<dt><label for="charDex">Dexterity</label></dt><dd><input type="text" name="Dex" value="" /></dd><br><br>
<dt><label for="charCon">Constitution</label></dt><dd><input type="text" name="Con" value="" /></dd><br><br>
<dt><label for="charInt">Intelligence</label></dt><dd><input type="text" name="Int" value="" /></dd><br><br>
<dt><label for="charWis">Wisdom</label></dt><dd><input type="text" name="Wis" value="" /></dd><br><br>
<dt><label for="charCha">Charisma</label></dt><dd><input type="text" name="Cha" value="" /></dd><br><br>
</fieldset>
</FORM>
<form method="post" action="../scripts/input_into_db.php">
<input type="submit" value="Send!">
</form>
</div>
</body>
</html>
I am getting the error "The query was empty", which is has not been.