PHP Archive

PHP Word Sensoring Application

Word Sensoring is an Application needed by Most of web Programmers,So a small application to illustrate it. We can use this application/module to avoid bad comments in public forum. We create two arrays named find & replace. We add the words to be sensored in the find array. The Replacement words are given in the

Read More…

WRITING DATA TO A FILE IN PHP

File Handling in PHP is not complex as in C or other languages The First Step is we create a "handle" variable to handle the connection. In fopen() function we pass in 2 parameters 'thefilename' and the mode fwrite() takes in two parameters the handle variable and the data Consecutive fwrite() will write the data

Read More…

Update by Passing a variable in Query PHP/MySql

Update Command is needed most of the Web applications and CMS Using it with default values specified in query is simple,but Many will have issues with passing a PHP variable in the query The Update Command is of the form UPDATE table_name SET field_name Values WHERE condition If the user has received inputs via post

Read More…

The $_GET Method,$_POST and $_REQUEST Method in PHP Explained

$_GET METHOD In PHP we get user input via html forms by the use of two superglobal methods called the $_GET and $_POST In get method data is sent along the address bar of the browser and is visble to everyone So this makes it not suitable for Passwords and Sensitive Information The values are

Read More…

How to Prevent Unauthorised access into Member area in PHP

One of the Small Issues faced in a Web application is that,Programmers would have coded the login and the logout partwell, but when the user types the member area address directly on the address bar it would take him in without actually having to login. So my suggestion to prevent this is by using effective

Read More…

5 Easy Steps to Connect a PHP script to MYSQL

STEP 1: CREATE A CONNECTION First step is we have to create a Connection to hold our database connection. In this step we give details like server information the username and password for the mysql client The PHP Mysql function to connect is 'my_sql_connect() We pass in 3 Parameters the servername,username and password in order.

Read More…

Difference Between Echo and Print in PHP

ECHO Echo is a language Construct It is not a function and so it does not return any value The Main advantage is,echo is ‘Faster’ than Print It can take Multiple Arguments Both echo and print will produce the same result My personal advice is use Echo when printing ordinary statements in php Example for

Read More…

SESSIONS IN PHP

SESSIONS IN PHP A cookie recides on the users web Browser and may be suited for storing small amount of information and for limited concern on security. When we need to store a considerable amount of information we use session and we have a Security advantage of session being stored on the web server itself

Read More…

Login Logout Snippet Using Sessions in PHP

   Login.php This is the Login form with a Username Text field and a Password field Verify.php This is the PHP script specified in the Form Action of the HTML Page,whose primary purpose is to authenticate a user is a verified user or not. Logout.php Unsetting a Session Variable will lead to nullifying the session

Read More…