Skip to main content

Posts

Today we will implement login with cookie using php script

Php login with cookie, provide username and password store it in cookie container This tutorials is assume you have been following up on other tutorials, such as php signup page. You have signup page already, if you don't have any, then I think you need to create one. if you look at the code below this is html form already-made you can copy and paste for our testing. Now, copy the code below or write it manually and save it as index.php and run it to see a nice decorated ligin form. " method="POST"> Enter login details Username "> Password "> Remember me Register Login the user and retrieve the protected page The php script below, copy and paste on top of your html tag, this script should come first before anything else in your application. In this script, this script will open our database, in the table select the appropriate user and compare it with the one typed in the input field, if the two data are equally the same...

How to store user details in cookie and retrieve it during signup

Today we will practice how to store user cookie in our signup application and retrieve then when the form was correctly filled. This will assure visitors that their details was successfully received and that they can login at that moment. For testing purpose, copy the code below or write it manually, save it as cookietest.php and run it. " enctype="multipart/form-data"> Register your profile today Select profile picture Full name Full address Your community, local government and state Email address Phone number Username Password Select project type Select project type Web technology developer Server-side technology developer Database management developer Local and public network developer Gender Male Female Our php script to submit users details and store copy in cookie container Again, copy the below php script and paste it on top of your html file combine it with html above and save it as cookietest.php and run the c...

How to make a signup page using php programming language

After developing your application, it's time to setup a signup page where user can fill a form and submit before they will have access to protected website. Test connection as a mysql user of database First, Let's assume you have access to mysql database. we will test connection to database, once we can connect to database, we are good to go. If you look at our code below it's almost already made you can just copy and paste and start testing. Save it as dbconnect.php and run it. connect_error) { die("Connection failed: " . $conn->connect_error); } echo "Connection was successful!"; ?> Create a new database where we can run testing In below code, our code has been written in place you can copy and paste and start testing. The below code will help us create database with name 'webdesign' after running that code we will have good ready for use database. Save the code as dbcreate.php and run it. connect_error) { die(...

In today post we will focus on how to create php script that could upload picture to server

Before writing script to upload files to server, you have to check ensure that php file upload is set to 'On' in php.ini. Open C:\xampp\php\php.ini file locate the line that says upload_file = On and also change the php upload max setting, example: php_max_upload = 100m. Now save the file, restart the server and start writing php script to upload your file. Step 1: Below is the html code to implement our practice of file upload. You can write it manually or copy and paste. " enctype="multipart/form-data" method="POST"> Uploader Step 2: Php command to target the upload folder, php comman to get file name, php command to check upload status, and php command to validate file extension. Below is our sample code: Step 3: We will use php global object called $_POST to get the image object. And check if the file is image or not, if it's not image the upload status will be set to zero. Below is our sample code: if(isset(...

Our today post will focus on how to implement php hits counter

PHP counter step 1: Have you ever wonder how you can monitor, view or learn how many times your website is been processed by visitors. How many times your website is been browse by your visitors? If your answer is 'no', then it's time to learn all these. You can learn how many times browser processed your website by binding certain php script on top of your webpage. Now, if you look at our php script below, this script will help you count how many times your website was processed at any given moment. To apply our php script below, you can copy and paste this script on top of your webpage before html declaration. PHP counter step 2: Again, the below script, you can copy and put it in a separate file. All you need to do is check time to time and see the digits number your script return. That's exactly how many times your website was processed. Example of the counter: Hits counter While applying our tutorials, if our code spot error, don't hesit...