Imagine you are creating a PHP program and you can pass some number parameter in url to retrieve content from your server. Then maybe you are thinking if you let people seeing those numbers in their url, they can change that number to any number to retrieve another content. This program can prevent that. Instead…
Category: PHP
Very Easy and Simple PHP Login and Logout Tutorial
Login and Logout is a must have feature if you are creating a website. In PHP, I can show you the basic method and mechanism of Login and Logout without any database, at this point. Watch the video tutorial here:
Basic Unity and Client-Server Request-Response with PHP
In order to make our Unity game connected to the online world, it must be able to send requests to and get responses from our server. In this tutorial you will see the basic way to make our game able to communicate to PHP server side script.
Simple PHP read and write to a text file
This code snippet reads a text file that if it is not existed it will create one with some text in it. Next time this code is executed, if the file existed, PHP echoes the content of the file. <?php $settingfile = “settings.txt”; $filelink = fopen($settingfile, “r”); $filecontent = fread($filelink, filesize($settingfile)); echo $filecontent; fclose($filelink); $newContents…
PHP & MySQL useful snippets
For us, working with database in web development is a mandatory task. Here in this post I’m going to list, as much as I know, PHP & MySQL snippets that I frequently use.
Inserting Arabic text with PHP into MySQL Database
We need to set the encoding of texts we store into database to UTF-8 if we work with Arabic texts. Otherwise, Arabic texts appear like ?????????? in our database.
Very easy and simple .htaccess & PHP tutorial
If you work with PHP, you notice that this URL: http://yoursite.com/index.php?post=2 is not pretty at all. There is term “Pretty URL” and a lot of tutorials how to make your URL prettier. In this post I’m going to share a few line of .htaccess codes to make your URL more prettier.
Pick an Image from Android device and upload it to server using PHP
To upload an image from Android device to online server using PHP, first we need to create a PHP script to handle “post” request and store the image to a folder. So write this simple script on your server:
.htaccess tutorial : Removing .php extension
If you have a page with .php extension and you don’t want to show that extension in page’s url in address bar, you will need an .htaccess file.
A useful PHP function to use Google reCAPTCHA
This one php function snippet can return true or false value after user submitted a form with Google reCAPTCHA in it.
PHP useful snippets
This page is dedicated for a bunch of PHP useful snippets and codes that we often use it in web development.