In this tutorial i'll show you how to use PHP and AJAX together and get the results that you need. Here's an example of a function that executes a ajax request function execAjax(type){ $.ajax({ url: 'ajax.php?type='+type, dataType:...
In this tutorial i'll show you how to use PHP and AJAX together and get the results that you need. Here's an example of a function that executes a ajax request function execAjax(type){ $.ajax({ url: 'ajax.php?type='+type, dataType:...
Saturday July 16, 2011 15:34
Posted by Samuel Marian as PHP
There are alot of websites that are vulnerable to sql injections. In this tutorial i'll give you some examples with methods to protect you website. Make your id from url (int) Let's assume that you get the id like this: $id =...
In the past two years i've used many methods to hash a password. The best method i used is by adding a salt and then encrypting with md5. If you encrypt a password without a salt is more easily (but almost impossible) to find the password. It's...
Lately i've seen very often in email newsletters images embed with base64. If you send email newsletters containing image, this is the best way to send. First we try to open the file. $file_path = 'my-image.jpg'; if($fp = fopen($file,"rb",...
Tuesday May 31, 2011 21:35
Posted by Samuel Marian as PHP
Okay, so many people think that if you make a search engine on your site with query like the one below, it's okay. SELECT id,name,post FROM posts WHERE name LIKE '%my key%' But it's not! Because: Let's assume that you have a post called: My...
Recently i needed to increase memory limit for executing a PHP script. And i think there are many of you who don't know how to do it. Here is a simple an example:
ini_set('memory_limit', '128M');
Tuesday April 19, 2011 11:00
Posted by Samuel Marian as PHP
I haven't wrote any tutorial since two months (i've been very busy lately). Anyway, now i'll show you a simple way to transform arrays to objects and objects to arrays. Let's start with transformation from arrays to objects. function...
Saturday February 19, 2011 00:50
Posted by Samuel Marian as Javascript, jQuery, PHP, Video Tutorials
Hi here! In this video tutorial you'll see how to create a simple like/unlike button using jQuery and PHP. Download the code here: http://etiny.info/ynjtqc Download the database here:...
Awhile ago we've talked about handling sessions in PHP witch is used to store data for a short time. Now i'll show you how to use cookies. The cookies are like sessions in a way. Cause they store data to, but for a long time (for how much you set)...
Now i'll show you how to create a file using PHP's function fopen() Example: $fileName = 'myFirstFile.txt'; $fh = fopen($fileName, 'w') or die("can't open file"); fclose($fh); Explain: $fileName = 'myFirstFile.txt'; This is the file...