Need someone to look at this script.. (HELP) Thanks

Discussion in 'PHP' started by MTA, Mar 6, 2008.

  1. #1
    Hello I don't know why it is doing this.. We are making a script for our members to have the webcam show up on the profile they can pick what one they want.. The Big problem is that I am having is in the script we have a Radio button where they can choose what one they want to use.

    when you submit it is only changing the last producted that was enter in the DB..
    I don't know if it is my script or what.
    $u= $_POST['id'];
    $f= $_POST['userid'];  // keep this only
    if(isset($_POST['v'])) {$approve = 1;
    mysql_query("UPDATE  video SET approve = '$approve' WHERE userid='$f' AND id='$u'");
    
    
    }else{ $approve = 0;
    mysql_query("UPDATE  video SET approve = '$approve' WHERE userid='$f' AND id='$u'");
    }
    
    PHP:
    
        $VCAM .= '<table style="width:100%;"><form action="'.$VAR[0].'/member/videorecorder/recorded.php" method="post"">';
    
    
    	
    		$a = mysql_query("SELECT * FROM `video` WHERE `userid` = '$VAR[4]' ");
    		while ($b = mysql_fetch_array($a)){
    		
    		
    	$NEW = '';
    if ($b['approve'] == 0) $NEW = '<span style="font-size:8pt;">( NEW )</span>';
    
    $VCAM .= '<input type="hidden" name="userid" value="'.$VAR[4].'" />';
    $VCAM .= '<input type="hidden" name="id" value="'.$b['id'].'" />';
    			$VCAM .= '<table style="width:100%;margin-bottom:3px;" cellpadding="2" cellspacing="2">'."\n";
    			$VCAM .= '<tr>'."\n";
    			$VCAM .= '<td style="font-size:8pt;width:5%;text-align:center;" >'."\n";
    			
    $VCAM .= '<input type="radio" name="v" />'."\n";
    	        $VCAM .= '</td><td style="font-size:8pt;width:15%;text-align:center;">'."\n";
    $VCAM .= '<b> '.date("F j, Y, g:i a",$b['date']).'</b>'."\n";
    			$VCAM .= '</td><td style="font-size:8pt;width:80%;" >'."\n";
    			$VCAM .= '<span style="font-size:10pt;">'.$NEW.' <IFRAME 
         SRC="http://mateable.com/videorecorder/view.php?id='.$b['filename'].'" 
         WIDTH=340 HEIGHT=340 
         FRAMEBORDER=0
         >
    
    </IFRAME></span><br /><br />'."\n";
    			
    			$VCAM .= '</td>'."\n";
    			$VCAM .= '</tr>'."\n";
    			$VCAM .= '</table>'."\n";
    
    }
    
    
    $VCAM .= '<br /><input type="submit" value="submit"></form></table>';
    
    
    
    $MAINDATA =<<<HTML
    
    
    $VCAM
    
    HTML;
    
    #############################
    include("".$VAR[5]."/member/html/index.php");
    #############################
    ?>
    PHP:

     
    MTA, Mar 6, 2008 IP