Saturday, July 28, 2012

Advanced PHP session start

Advanced PHP session start

If a session based web application is used by a visitor using Internet Explorer it's possible that this user get some trouble. This will happen if parts of the application are accessed for example via a shortcut on the desktop and the application opens then in a new Explorer...

Friday, July 27, 2012

Five Steps to Secure your PHP Website

Five Steps to Secure your PHP Website

Unfortunately there will always be some one out there on the world wide web who will attempt to break any thing they can find on the Internet so you owe it to your visitors/ members to ensure nothing malicious is being hidden on your site and there info...

Friday, July 20, 2012

Find visitor's IP address in php script

Find visitor's IP address in php script

Every php developer want to store IP address of visitor for tracking and other different purpose. Here is the function which i'm using in my script to store ip address in database. <?php /* Online PHP Examples with Source Code website: http://4evertutorials.blogspot.in/ */ function visitorIPAdd() { /* This returns the...

Saturday, July 14, 2012

Remove HTML Tags from string in PHP

Remove HTML Tags from string in PHP

If your strings have any html code, you can easily remove using following code. Using regular expression: <?php /* Online PHP Examples with Source Code website: http://4evertutorials.blogspot.in/ */ $string = preg_replace("/<.*?>/", "", $string_contain_html_code); ?> ...
Stop SQL Injection in MYSQL with PHP Script

Stop SQL Injection in MYSQL with PHP Script

Every PHP-MYSQL programmer need to know Anti-SQL Injection. Please take a look at very simple function which can save your database!! <?php /* Online PHP Examples with Source Code website: http://4evertutorials.blogspot.in/ */ function ClearInput($dirtyInput){ if (get_magic_quotes_gpc()) { $clean = mysql_real_escape_string(stripslashes($dirtyInput)); }else{ $clean = mysql_real_escape_string($dirtyInput); } return $clean; } ?>...
Post XML data using CURL php

Post XML data using CURL php

Recently I was working in a hotel booking engine and found a couple of methods to post XML to server; I thought this might be good to share with my friends who want to post xml via HTTP POST method.There are several ways to Send XML requests via...

Friday, July 13, 2012

Prevent XSS attacks with php

Prevent XSS attacks with php

There are a number of ways hackers put to use for XSS attacks, PHP’s built-in functions do not respond to all sorts of XSS attacks. Hence, functions such as strip_tags, filter_var, mysql_real_escape_string, htmlentities, htmlspecialchars, etc do not protect us 100%. You need a better mechanism, here is what is...

Tuesday, July 10, 2012

Post or Submit Form Data with PHP CURL

Post or Submit Form Data with PHP CURL

Last Sunday, I was working with website form to collect data from third party website. If you have to just submit form its easy website does not restrict to use CURL in order to post data but my requirement was to post website from data and store that data in my database too....

Sunday, July 1, 2012

Connecting to ODBC using PHP

Connecting to ODBC using PHP

<?php /* Online PHP Examples with Source Code website: http://4evertutorials.blogspot.in/ */ // connect to a DSN "database" with a user and password "4evertutorials" $connect = odbc_connect("database", "4evertutorials", "4evertutorials"); // query the users table for name and surname $query = "SELECT name, surname FROM users"; // perform the query...
Get Unique Value from PHP Array

Get Unique Value from PHP Array

array_unique() array_unique — Removes duplicate values from an array Description: Takes an input array and returns a new array without duplicate values. Note that keys are preserved. array_unique() sorts the values treated as string at first, then will keep the first key encountered for every value, and ignore all...

 

© 2014 4everTutorials. All rights resevered.

Back To Top