Inexperienced developer here trying to make a gaming website.
I am asking user to select a few values from drop down list plus fill in a few text boxes and hit submit. Then I want to insert these into a record. A record is created each time but other than the memberid, nothing else is pulling (all blanks). Please help.
Partial code:
Code: Select all
<?
...
switch($action){
case "submitscores":
addscorerecord();
break;
...
}
$q="SELECT * FROM games";
$result=mysql_query($q);
$out[body].="<select name=\"title\" onChange=\"getCat(this.value)\">
<option >Select Game</option>";
$memberid="$_COOKIE[tid]";
while($n=mysql_fetch_array($result)){
$out[body].="\"<option value=$n[gameid]>$n[title]</option>\";";
}
$out[body].="</select>
<div id=\"statediv\"><select name=\"cat\" >
<option>Select Game First</option>
</select></div>
<div id=\"citydiv\"><select name=\"subcat\">
<option>Select Category First</option>
</select></div>
<form name=\"score\"><input type=text name=score value=$score>
</form>
<form name=\"URL\"><small>http://</small><input type=text name=url value=$url></form>
<form name=\"date\"><input type=date name=date value=$date></form>
<input type='hidden' name='action' value='submitscores'>
<input type='hidden' name='cat' value='$cat'>
<input type='hidden' name='subcat' value='$subcat'>
<input type='hidden' name='score' value='$score'>
<input type='hidden' name='url' value='$url'>
<input type='hidden' name='date' value='$date'>
<input type='hidden' name='title' value='$title'>
<input type='submit' class='button' name='submit' value='Submit >>'>
</form>
";
include("$config[html]");
}
function addscorerecord(){
include("./includes/incglobal.php");
global $config;
}
mysql_query("INSERT INTO scorerecords VALUES (
NULL,
'$_COOKIE[memberid]',
'$cat',
'$score',
'$url',
'$date',
'',
'0')");