Jump to content

hidden value not being assigned in form


SteveTs

Recommended Posts

The problem may be outside of the code copied below, but I thought maybe you guys could see if there is something that jumps out at you as being incorrect.  The opi is not being assigned "ds" and causing the entries not to be inserted into the db.

 

<table border=0 cellpadding=0 cellspacing=0><FORM METHOD=\"post\" ACTION=\"football-predictions.php\">";

$result = mysql_query("SELECT * FROM sports_football_predict WHERE week='$currentweek' and year='$currentyear' order by id", $dbi); 
while(list($id, $year, $week, $home, $away, $prediction) = sql_fetch_row($result, $dbi)) {
echo"<tr><td valign=top><img src=\"/images/nfl/helmets/$away.jpg\" width=55 height=50 align=left></td>
<td valign=top><img src=\"/images/nfl/helmets/$home.jpg\" width=55 height=50 align=left></td>
<td>   </td>
<td valign=top bgcolor=\"#B3CDC0\">
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><img src=\"/images/nfl/bgbox-blueupperleft.gif\" width=9 height=9 border=0></td><td></td></tr>
<tr><td></td><td valign=top>
<table border=0 cellpadding=3 cellpadding=0><tr><td>
<font class=headlinetext>$prediction<br>
</td></tr></table></td></tr>
<tr><td><img src=\"/images/nfl/bgbox-bluelowerleft.gif\" width=9 height=9 border=0></td><td></td></tr>
</table>
</td>
<td valign=middle bgcolor=\"#435654\" width=100>
<table border=0 cellpadding=3 cellspacing=0>
<tr><td nowrap><input type=radio value=\"1\" name=\"a$id\"><font class=newsfooterheader> Agree</td></tr>
<tr><td nowrap><input type=radio value=\"0\" name=\"a$id\"><font class=newsfooterheader> Disagree</td></tr>
</table>
</td>
</tr><tr><td colspan=5> </td></tr>";
}

if ($vbulletin->userinfo['userid']!=0) {
echo "<tr><td colspan=2></td><td colspan=3><center>
<INPUT type=\"hidden\" name=\"opi\" value=\"ds\">
<INPUT type=\"hidden\" name=\"username\" value=\"$username\">
<center>
<table border=0 cellpadding=0 cellspacing=0 width=162 height=28>
<tr>
	<td width=162 height=28><center><input type=image src=\"/images/nfl/linkbg.gif\" width=162 height=28></td>
</tr>
</table></center></td></form></tr></table><p>";

Link to comment
https://forums.phpfreaks.com/topic/122059-hidden-value-not-being-assigned-in-form/
Share on other sites

and you are using $_POST['opi'] right? If so, then we're going to have to move on to looking at football-predictions.php

 

I actually posted the full code in another thread here: http://www.phpfreaks.com/forums/index.php/topic,214295.0.html

 

I did not use $_POST['opi'] originally, but have since swapped it out and it still doesn't work.  football-predictions.php is the entry page, you enter the picks via the radio buttons, then click submit and are sent back to the page which should show the percentages of what all other readers picked.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.