is 1 a Variable...Discoverd it just now...

From: Date: Tue, 16 Jan 2001 12:56:34 +0000
Subject: is 1 a Variable...Discoverd it just now...
Groups: php.general 
Request: Send a blank email to php-general+get-34809@lists.php.net to get a copy of this message
HI! When I run the foillowing code: <form action="<?php echo"$PHP_SELF"; ?>" method="post"> <input type="hidden" name="flag" value="0"> <select name="recepients" onchange="javascript:submit();"> <option value="">--</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select></form></td> </tr> </table> <?php if(isset($flag)) { for($i=1; $i<=$recepients; $i++) { echo "<input type=\"text\" name=\"$i\">" ."<br>"; } } else { echo "<input type=\"text\" name=\"1\">"; } ?> I get error on saying echo $i on the next page... **************************************************** Parse error: parse error, expecting T_VARIABLE' or '$'' in C:\HTTPD\HTDOCS\preston\sms\send.php **************************************************** WHy is it so..? Is there any other way of doing the above... Please let me know.. Thanx a lot! Dhaval Desai --------------------------------- Do You Yahoo!? Yahoo! Mail Personal Address - Get email at your own domain with Yahoo! Mail.

« previous php.general (#34809) next »