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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
daran0510
Forum Newbie
Posts: 1
Joined: Wed May 29, 2002 3:23 am

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

Post 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
jason
Site Admin
Posts: 1767
Joined: Thu Apr 18, 2002 3:14 pm
Location: Montreal, CA
Contact:

Post 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.
Post Reply