How to add Textbox dynamically in php

I will show you how to add textbox, select, or any checkbox dynamically in PHP. I will show you how to add dynamic textbox while clicking on link.

<script language="javascript" type="text/javascript">
function add_textbox()
      document.getElementById("data").value="<input type='text' name='name'>";
<a onClick="add_textbox()">Add Textbox</a>

We can easily add all types of inputs dynamically.

Thank you

Premal Katigar

select option in php using database

I will show you how to add data into select option by fetching data from database. its quite simple. select option is mostly used for registrations & other major activities & forms. select option is useful.

create database named premal. add 1 table named location_country with 2 fields. 1 is for id autoincrement & name.

premal katigar

After that some data into database.

Now get following Code.

<select name="location" id="location">
$query="select name from location_country";
 <option value="NULL">SELECT</option>
 <option value="<?php $row[0] ?>"><?php echo $row[0] ?></option>


how to redirect your website in php

I will show you how to redirect the website from one page to another page.

we can use either action method from the attribute of form tag.

<form action=”premal.php” name=”form”></form>

it will redirect your website to premal.php


another way to redirect the website is with using header() function of PHP.


We have done redirection of website in php

Premal Katigar


how to store images in database using PHP

Firstly create your fetching_images.php file.


now create add.php file.

In below code automatically create a new folder named inages in your www directory. all the images which you upload from here will store in that images folder.

we can create images using mkdir() function of PHP.


now create new file for displaying images named display.php


You have successfully done image storing process. enjoy.

any query mail me or whatsapp me anytime.

thank you.

formatting using PHP

So you’ve gone though some of the tutorial, and you can make some nifty things in PHP. But the problem is, they all look like plain text. How do you jazz them up?

Formatting with PHP actually isn’t done with PHP, it’s done with HTML. You can do this in two ways. You can add the HTML inside of the PHP… or you can add the PHP inside of the HTML. Either way, make sure your file is saved as a .php or another file type that is allowed to execute PHP on your server.

HTML inside PHP


echo “<font color=red>Premal Katigar</font>”;


PHP inside HTML

<font color=”red”>

<?php echo “Premal Katigar”; ?>


Changing the capitalization of stings

Making the string all capital letters:

You can simulate the CAPSLOCK key using thestrtoupper() PHP function.

Making the string all lower case letters:

You can also force all letters in a string to be lower case. This is done with the strtolower() PHP function.

Capitalizing each word:

You can choose to only capitalize the first letter of every word. This works great when working with a list of names or cities. This is done with theucwords() PHP function.

Code :


// using strtoupper() we can easily get all characters in capital.

echo strtoupper(“This is Premal Katigar”);


// using strtoupper() we can easily get all characters in capital.

echo strtolower(“This is Premal Katigar”);

// using ucwords() we can easily get all words with first character capitalized


capitalize all words

Output Of above code :

capitalized character output


Know More about php

Mail me your topic or problems

Contact : +91-84604-57306