CategoryPHP

How to use PDO database connection in PHP

H

<?php $string = ‘Test’; # user submitted data try { #connection $conn = new PDO(‘mysql:host=localhost;dbname=myDB’, $db_username, $db_password); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $data = $conn->query(‘SELECT * FROM myTable WHERE name = ‘ . $conn->quote($string)); // $conn->quote used to protect SQL injection...

Laravel introduction

L

What is Laravel ? Laravel is a free, open source PHP web application framework, designed for the development of model–view–controller (MVC) web applications. Laravel is released under the MIT license, with its source code hosted on GitHub. Tutorial Details Name : Laravel – PHP Framework Type : PHP Framewrok Language : PHP Level : Beginner Estimated Time : 40 Minuets Comments : Next generation PHP...

How to create form in Laravel

H

Form is a most expected elements in website as well as web based application. Each and every interactive web apps must have a form option to communicate between users and administrator. Whatever you want to write in website, there is not alternative about form. It could be in chat, message, as well as comments. In laravel 4, you have huge flexibility to create HTML form easily. Today I will gonna...

Remove index.php from codeigniter framework

R

Hi all, Today I am going to show you, how to remove the index.php part from your codeigniter URL. There are many ways to do it, but based on my previous experience, I got it is the best way to do so. To do so, create a .htaccess file in your directory and copy the following code in your created file.   RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d...

How to install laravel on windows wamp server

H

Following are the steps to install laravel on windows local wampserver Steps Before installing laravel please check following services are on or not ? a.Enable openssl b.Click on wamp icon->Apache->Apache Modules and enable ssl_module c.check php_sockets is enable wamp icon->PHP->Extension->php_socket Restart all services. 1.For installing laravel on windows PHP >= 5.4  required...

Why Use PHP?

W

There are thousands of programming languages available and every year, new programs are being made.  But only few of these have become sufficiently popular and are used by many people.   One of which is PHP or hypertext preprocessor.  It is a general-purpose server-side scripting language designed for web development.  It is installed on more than 20 million web sites and 1 million web servers...

Roles and permissions of user in wordpress

R

WordPress is a free and open source blogging tool and a content management system (CMS) based on PHP and MySQL, which runs on a web hosting service. WordPress is the most popular blogging system in use on the Web, at more than 60 million websites. WordPress having a set of User groups roles and permission. They are Super Admin – somebody with access to the site network administration features and...

MySQL Database Backup Using PHP

M

If your site is live and using Database then it is very important to take backup of you Database in regular time interval. But it is not possible to take the backup manually every time. So lets create a simple PHP function to do this job for us and we can call that function using Cron Job in regular time interval. Here is the sample of php code <?php include("config.php"); function...

PHP Security: HTTP Authentication

P

You possible have found a web page that you want to open, sudden peep out a dialog window asking for username and password. common example is early page at cpanel (control panel to manage the web server use web based). It use HTTP Authentication. In protecting web page with HTTP authentication, you have to deliver two header. header WWW-AUTHENTICATE tell to browser that an username and password...

Category