PHP Classes - My PHP Classes page. Five good programming habits in PHP. Single File PHP Gallery. By Kenny Svalgaard Single File PHP Gallery is a web gallery in one single PHP file. All you have to do is copy the script to any directory containing images to make a gallery. Sub directories will be sub galleries. Thumbnails for images and directories are generated automatically. By default it looks like this: (click image to see the online demo) For private non commercial use Single File PHP Gallery can be used for free. You are of course still more than welcome to donate if you like the gallery, even though you only use it privately.
Making a donation: Domain name must be clearly stated in the donation, otherwise the donation will not grant use of the script under donating conditions. For this gallery to function you will need the following:A web server capable of running PHP 5 scriptsThe PHP GD library (php_gd) installed. Download latest version here: Single File PHP Gallery 4.7.0 (34kB) Download SFPG TEST script here: SFPG TEST 1.5.1 (3kB) NEWS IN SFPG 4.7.0 (29-Dec-2016) PHP Login script tutorial. We have a login form in step 2, when a user submit their username and password, PHP code in checklogin.php will check that this user exist in our database or not. If user has the right username and password, then the code will register username and password in the session and redirect to "login_success.php". If username or password is wrong the system will show "Wrong Username or Password". ############### Code $host="localhost"; // Host name $username=""; // Mysql username $password=""; // Mysql password $db_name="test"; // Database name $tbl_name="members"; // Table name mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; (more detail about MySQL injection) $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword);
Jaslabs: High performance php » Top 25 PHP template engines.