Hi,
Please don't post HTML mails in the group. Post mails only in Plain text format.
Regards,
Vinod.
On Friday 21 March 2003 02:17 pm, you wrote:
<html><div style='background-color:'><DIV> <P><BR><BR></P></DIV> <DIV></DIV> <P>Hi Deepali,</P> <P>To retrive the value of $txt_name use following code:</P> <P>$tp = ${$txt_name};</P> <P>where $tp will have the value </P> <P>Some how i feel that rather than using variable names like this it would be better if ou'd use arrays .</P> <P>There is this very good article at <A href="http://www.devshed.com">www.devshed.com</A> on variable variables in php ( the one we are using here $$ )</P> <DIV>For <STRONG>Optimal Solution Providers </STRONG></DIV> <DIV></DIV> <DIV> </DIV> <DIV></DIV> <DIV><STRONG></STRONG></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <P><STRONG>T. Srinivas</STRONG></P> <P>>From: Deepali Naik <DIPSNAIK@SIFY.COM></P> <DIV></DIV>>Reply-To: linuxers@mm.ilug-bom.org.in <DIV></DIV>>To: linuxers@mm.ilug-bom.org.in <DIV></DIV>>Subject: [ILUG-BOM] PHP help needed!!!!!! <DIV></DIV>>Date: Fri, 21 Mar 2003 10:27:07 +0600 (IST) <DIV></DIV>> <DIV></DIV>>Hello, <DIV></DIV>>i m new in the PHP area... i have one doubt on PHP... can u help me to solve this doubt? <DIV></DIV>> <DIV></DIV>>in my code i m slecting first name and last name of users who are not deleted..... so this number may be anything,... <DIV></DIV>>so i have kept a counter for that.. to know how many users are there?.. <DIV></DIV>>now in the while loop i m displying the first and last name and also a text box to wewrite reason to delete user... <DIV></DIV>>the input type text name i m generating... like re1, re2, re3 <DIV></DIV>> <DIV></DIV>> <DIV></DIV>> <DIV></DIV>> <DIV></DIV>>****************// php code <DIV></DIV>> <DIV></DIV>>echo \" <TABLE>\\n\"; <DIV></DIV>>for ($counter=1;$counter<=11;$counter++) <DIV></DIV>>{ <DIV></DIV>>// the below function searches in the db & returns the designation of user... <DIV></DIV>> $desg= disp_desg($counter); <DIV></DIV>> <DIV></DIV>>/// query to slect the user who is not deletd and of above desgination...,. <DIV></DIV>> <DIV></DIV>> $res =@mysql_query(\"select fname,lname from user_details where code =$counter and act_flag!=\'X\' and act_flag !=\'DE\' \"); <DIV></DIV>> <DIV></DIV>>/// as many number of user <DIV></DIV>> <DIV></DIV>> while ( $row =@mysql_fetch_array($res)) <DIV></DIV>> { <DIV></DIV>> if ($counter_chk==1){ <DIV></DIV>> echo \" <P align=left><B><U><FONT face='\\\"Bookman' size='\\\"3\\\"' Style\\\? Old>$desg</FONT></B></U></P>\\n\"; }#end of if <DIV></DIV>> <DIV></DIV>>// BELOW LINE GENERATE THE INPUT TYPE TEXT NAME LIKE re1.. re2.. etc... <DIV></DIV>> $txt_name=\"re\".$counter_chk; <DIV></DIV>> $fname=$row[fname]; <DIV></DIV>> $lname=$row[lname]; <DIV></DIV>> echo \" <TBODY> <TR> <TD>$fname \".\" \".\"$lname </TD> <TD><INPUT name='\\\"$txt_name\\\"' size='\\\"45\\\"' type='\\\"text\\\"'> </TD></TR>\\n\"; <DIV></DIV>> $counter_chk++; <DIV></DIV>> }#end of while <DIV></DIV>>}#end of for <DIV></DIV>>?> <DIV></DIV>></TBODY></TABLE> <DIV></DIV>> <DIV></DIV>>***************// end of php code <DIV></DIV>> <DIV></DIV>> <DIV></DIV>>till here it works fine... <DIV></DIV>> <DIV></DIV>>now my problem is i don;t know the bnames of the input type text box... <DIV></DIV>>i want to check that the text box is empty or not... but since i have generated text box name... asnd not hardcoded.. i m not getting how to get the data inside the text box... <DIV></DIV>> <DIV></DIV>>i have cterated a fiollowing funtion where i want to delete a user where the reson text box is not empty <DIV></DIV>> <DIV></DIV>>********************* php code <DIV></DIV>>// counter_chk = no of users displayed oin the page <DIV></DIV>>function delete_user($counter_chk) <DIV></DIV>>{ <DIV></DIV>>$count=$counter_chk; <DIV></DIV>>while ($count >= 1) <DIV></DIV>>{ <DIV></DIV>> in this while i want to check that the input tuype text box is empty or not <DIV></DIV>>if not empty i want to update my table with the text in the input type of textbox... <DIV></DIV>>but i don;t know how to retrieve the value of the text box.... <DIV></DIV>> <DIV></DIV>> $txt_name=\"re\".$count; <DIV></DIV>> echo \"$txt_name\"; <DIV></DIV>> $count--; <DIV></DIV>>}#end of while <DIV></DIV>>} <DIV></DIV>> <DIV></DIV>>********************** end of php code <DIV></DIV>> <DIV></DIV>>what shd i do?.. is their any way to solve the prob... <DIV></DIV>>ort can u suggest me some other way..?.. <DIV></DIV>>thanks in advance... <DIV></DIV>>waiting for ur reply... <DIV></DIV>>Deepali <DIV></DIV>>------------------------------------------------- <DIV></DIV>>Sify Mail - now with Anti-virus protection powered by Trend Micro, USA. <DIV></DIV>>Know more at http://mail.sify.com <DIV></DIV>> <DIV></DIV>>Sify Power mail- a Premium Service from Sify Mail! <DIV></DIV>>know more at http://mail.sify.com <DIV></DIV>> <DIV></DIV>>-- <DIV></DIV>> <DIV></DIV>> <DIV></DIV>>http://mm.ilug-bom.org.in/mailman/listinfo/linuxers <DIV></DIV></div><br clear=all><hr>Cricket - World Cup 2003 <a href="http://g.msn.com/8HMHENIN/2734">News, Views and Match Reports.</a> </html>