Welcome back to shortlearner today we will learn how to store a html content in database.
Sometimes we need to save our html content into databse for permanent saving of our html code.
But how should we do it..?We will convert our html content into string because if your html content is too large the database would not be able to handle our large content,
facebook like chat system using Ajax, mysql and php
Welcome back to shortlearner, today we will learn how to implement a chat system using PHP, AJAX,and MySQL.
before start the tutorial i would like to suggest you to have some basic knowledge of ajax and jquery.
in this tutorial we willl used bootstrap maxcdn class to improve the visual looks of our web page,
How to Send Mail Using Php Mailer.
In this post we will see that how we can send mail using Phpmailer. Before Start Tutorial we should know about what is Phpmailer , benefits of Phpmailer than we learn how to implement code for Php mailer.
what is Phpmailer
PHP Mailer is a code library to send emails safely and easily via PHP code from a web server.
phpmailer is a collection of classes which allows user to send mail via smtp seetings.
A user can easily configure php mailer according to his/her needs.
Benefits of Phpmailer over mail() function
php provides us mail() function allows us to send mails to user but it has certain limitations, mail() function send mail but it has very slow response ,mail() function does not assure the sending of mail.
swap two numbers without using a temporary variable …
C Program to swap two numbers without using third variable with programming examples for beginners and professionals covering concepts, control statements, c array, c pointers, c structures, c union, c strings and more.
swap.c
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #include<stdio.h> #include<conio.h> void main() { int a,b; clrscr(); printf("\n enter the value of a and b :"); scanf("%d %d",&a,&b); a=a+b; b=a-b; a=a-b; printf("swapping of a=%d",a); printf("swapping of b=%d",b); getch(); } |
How to hide extension of html and php file.?
welcome back to shortlearner.com , In this tutorial we will see how to hide extension of files using .htaccess
before start learning first of all we should know about .htaccess file
what is .htaccess
in a simple words we can say that the .htaccess is a configuration file for use on web servers running the
Apache Web Server software. When a .htaccess file is placed in a directory
which is in turn ‘loaded via the Apache Web Server’,
then the .htaccess file is detected and executed by the Apache Web Server software.
Also Read :
PHP Login Script With Remember me.
Change password using javascript, php and mysqli.
Password and Confirm Password Validation Using JavaScript
Check Email is Already Registered in Database using Ajax and JavaScript.
How to hide extension of html and php file.?
Benefits of using .htaccess
- Redirect the user to different page
- Password protect a specific directory
- Block users by IP
- Preventing hot linking of your images
- Rewrite URIs
- Specify your own Error Documents
In this tutorial we make 3 php pages and hide there extensions using .htaccess file.
index.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Remove .php extension with .htaccess by http://mainvps.shortlearner.com/</title> </head> <body> <center> <div id="menu"> <ul> <li><a href="index">home</a></li> <li><a href="login">login</a></li> <li><a href="signup">signup</a></li> </ul> </div> <div id="body"> <h1>This is index.php page | see the url in addressbar</h1> <br /> </div> </center> </body> </html> |
Signup.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Remove .php extension with .htaccess by http://mainvps.shortlearner.com/</title> </head> <body> <center> <div id="menu"> <ul> <li><a href="index">home</a></li> <li><a href="login">login</a></li> <li><a href="signup">signup</a></li> </ul> </div> <div id="body"> <h1>This is signup.php page | see the url in addressbar</h1> </div> </center> </body> </html> |
Login.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Remove .php extension with .htaccess by http://mainvps.shortlearner.com/</title> <link rel="stylesheet" href="style.css" type="text/css" /> </head> <body> <center> <div id="menu"> <ul> <li><a href="index">home</a></li> <li><a href="login">login</a></li> <li><a href="signup">signup</a></li> </ul> </div> <div id="body"> <h1>This is login.php page | see the url in addressbar</h1><br /> </div> </center> </body> </html> |
Save below code with .htaccess
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^(.*)$ $1.php RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.html -f RewriteRule ^(.*)$ $1.html </IfModule> |