Page 1 of 1

Are you good in PHP? IF not don't open this topic!!!!

Posted: Wed May 29, 2002 3:23 am
by daran0510
I wanted to do scrip which put quastiones and answeres to file, but only quastiones are put. Blank place is there where shuod be answeres. The code is:

Code: Select all

<FORM ACTION=nowytest.php3 METHOD=POST> 
<INPUT TYPE=HIDDEN NAME=PUNKT VALUE=4> 
<INPUT TYPE=HIDDEN NAME=HASLO VALUE=<?echo($HASLO);?>> 
<INPUT TYPE=HIDDEN NAME=PYTILE VALUE=<?echo($PYTILE);?>> 
<INPUT TYPE=HIDDEN NAME=ILE VALUE=<?echo($ILE);?>> 
<? 
for($x=1;$x<=$PYTILE;$x++) 
{ 
echo("Pytanie $x: <INPUT TYPE=TEXT NAME=PYTї$x] SIZE=60><BR>"); 

for($i=1;$i<=$ILE;$i++) 
echo("Odpowiedź $i: <INPUT TYPE=TEXT NAME=ODP$x.$i SIZE=30><BR>"); 
} 
?> 
<BR> 
<INPUT TYPE=SUBMIT VALUE=OK> 
</FORM> 
<? 
} 
if($PUNKT==4) 
{ 
$file=fopen($path2."tresc", "w"); 
flock($file, 2); 
for($x=1;$x<=$PYTILE;$x++) 
{ 
fputs($file, $PYTї$x]."\n"); 
for($i=1;$i<=$ILE;$i++) 
fputs($file, htmlspecialchars(stripslashes($HTTP_POST_VARSї"ODP".$x.$i]."\n"))); 
} 
flock($file, 3); 
fclose($file); 
?>
Thank you

Posted: Wed May 29, 2002 6:20 am
by jason
I have no idea which are the questions and which are the answers, nor does the form make much sense to me. I would suggest that you go back trough and comment your code so we know what the datatypes and purpose for the variables are, and then put it back here.