Sunday 13 October 2013

Generate text boxes dynamically using php

In this section i am providing this gyan to some techies. While developing web applications in php some times they must have come through the requirement to generate multiple text boxes dynamically using php. Here i will show when you can use this approach, we can use php to generate text boxes dynamically when we have fixed number of limit text boxes, this can be done by the following ways:
1) By finding out number of rows from resultset and generating text boxes (When we need to generate text boxes on the basis of resultset)
2) If user enters the number of boxes to be generated (In this case we can fulfill this requirement either by using text box or select box).

generate text boxes using resultset:

                $rs=mysql_query($query) or die(mysql_error());
$num=mysql_num_rows($rs);

for($i=1;$i<=$num;$i++)
{
echo "<input type='text' name='job_id[]' >";
}

To generate text using fix number, you need to set $num as constant
 $rs=mysql_query($query) or die(mysql_error());
$num=5;

for($i=1;$i<=$num;$i++)
{
echo "<input type='text' name='job_id[]' >";
}

Note: Always remember to name text box as an array.

..........................................................................Use well, use safe...........................................................

Saturday 12 October 2013

Keep your web browser personal

Saving password in web browsers is not a good step

Always avoid to remember your password in web browsers, if you wish to do this then make sure that your computer totally belongs to you. Because web browsers can show your secrets which you don't want to disclose in front of anyone i.e. saved passwords. few days back i saw a debate on various blogs that google chrome can show your saved password, after hearing i did the same thing in firefox but i found the same thing which being said about google chrome.

But one thing i would like to share that this strategy does not show any bad intention of these companies. The reason i find behind this, may be "Everyone is having his/her own device to operate."  if in case you don't have your own device then it is not your recipe. And one more thing i would like to clear that these companies do not save your passwords automatically, first you are asked to do to so. Anyone who has his/her privately handled device then remember password is good thing for them because it saves time.

Manage your passwords in google chrome:


Please see below thumbnails to learn how to manage password in google chrome.

Step1


Step2



Step3



Step4



Step5








How to manage your password in Mozilla-firefox


Please see below thumbnails to learn how to manage password in Mozilla-firefox.
Step1


Step2



In the end i would like to share that technology has best to consume but it depends on us, how much consume and how to consume. I will come up with further updates on technology with new post :)

.................................................................Use well use safe...........................................................