Description :- In this lesson I’m gonna provide the code from which you guys can easily make fully Dynamic Carousel Silder from which you’ll fetch image name from database and images from your img folder.
Establishing Database:- Now, I know that you all guys know how to create new database and name it slider after this create new table and name it images and make 2 rows (i) id (ii) img And then insert your image name with extension into the img row .
Now follow some simple steps for setting up everything which we need for this lesson:-
1. Download the bootstrap 2. Download jquery file from jquery.com
2. Create a new folder and rename it as img and put some images in it.
3. Create a new folder and rename it as css and make app.css in the css folder
4. Create an index.php file
5. Create config.php file (the connection file to our database)
Description:- Hi ! In this tutorial I’m going to provide you code to get the image from url and then to store in the database as well in your local root directory or in a folder.
You can also include this type of image search thing in your website so that user will get limitless option to upload a picture.
I use rand() function to rename the image name and it will be helpful for you when you make a large website.
This chapter will complete in 3 different steps:- 1. Make index.php 2. Make a new folder in which your image will store and rename that folder as ‘image’ 3. Make a new database and give it a name mukulexp
// connection to database
$con = mysql_connect("localhost","root","");
mysql_select_db('mukulexp',$con) or die("could not connect");
// Your file
$file = $_REQUEST['url'];
// Open the file to get existing content
$data = file_get_contents($file);
// New file
$new = 'image/'.$newimage;
// Write the contents back to a new file
mysql_query("Insert into image set name = '$newimage' ");
echo "<img src='image/$newimage' width='300px' height='250px'/>";
3. Make a new database and give it a name of mukulexp and then enter in your mukulexp and click on SQL and paste the below code or make the table by yourself and name it image and then make 2 columns in it first id and second name
CREATE TABLE IF NOT EXISTS `image` (
`id` int(90) NOT NULL AUTO_INCREMENT,
`name` varchar(4000) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;
-- Dumping data for table `image`
INSERT INTO `image` (`id`, `name`)
NOTE : – Do all the above point as they are mentioned. Watch video for help
Happy Coding 🙂
Description: In this example I’m gonna show you guys how to make fully functional contact form in php using mail() function. And in this example we also cover how to change the placeholder color, how to make captcha code and then will verify if the captcha code is same as you typed in.
This example includes 4 different files:-
1. index.php (In which we make our form)
2. send.php (through which we’ll send the form it includes mail() function)
3. foundation.css (its a zurb foundation css file to make the form responsive)
4. app.css (this will be our custom stylesheet where we’ll give styling to input types and to the placeholders)
if($_REQUEST['captcha'] != $_REQUEST['check'])
header("Location: index.php?error=The characters you entered didn't match the word verification. Please try again.");
$myemail = "email@example.com"; /*ENTER THE EMAIL ADDRESS WHERE YOU WANT TO RECIEVE THE MAILS. In this case I set it to my personal gmail account. You can also make it dynamic by using $_REQUEST['the name of the field'] */
$name = $_POST['fname'];
$sname = $_POST['sname'];
$subject = "Contact Form Submission"; /* Or you can make it dynamic by using $_POST['name of the field'] */
$email = $_POST['mail'];
$message = $_POST['message'];
$tel = $_POST['tel'];
Name : $name $sname
E-mail : $email
Subject : $subject
Telephone : $tel
/* Send the message using mail() function */
if(mail ($myemail, $subject, $message))
/* Redirect visitor to the page you guys want */
header("Location: index.php?success=Thanks! We'll get back to you soon");
/*If any error then throw an error.*/
echo "Some error Occured !";
1. Please whenever you use this contact form please change the email address inside send.php file which is wrapped in $myemail variable otherwise I’ll get all your mails.
2. It is possible that you can not find the mail in your inbox. So don’t forget to check spam folder
3. Keep all 4 files in the same folder.
4. You need a server to check this. Without server its just a static contact form. It will work only online.
If you want to see the live example of this form you can go to my testing server i.e jaiupur4ever .
Description:- This example is completed in 4 different steps.
Step1. :- Creating a Login form (fully responsive/Bootstrap)
Step2. :- Storing login form’s details in session(fully php)
Step3. :-Showing user profile with Logout button(fully responsive/Bootstrap)
Step4. :- Logging out or you can say destroying session and redirecting to your Login page
So, for all the aforesaid steps I created 4 different php pages which are login_form.php, user_details.php, user_profile.php, user_logout.php respectively.
After completing coding user(person on the web browser) can see only 2 pages i.e login_form.php and user_profile.php Before writing codes in your system make sure that you have 3 files to make it Bootstrap. Without including those 3 files your bootstrap code will not run. So please includebootstrap.min.css , bootstrap.min.js and jquery-1.11.1.min.js
So, I’m going to start coding step by step.