Create MySQL Injection free Secure Login System in PHP
There were a lot of people who created tutorials to create a PHP Login System. But they were all vulnerable to MySQL Injection. In this post I’m going to demonstrate a login system free of this vulnerability. It is very secure. There are mysqli and PDO in PHP to escape these injections. We are going to use **PDO ( PHP Data Object **).
UPDATE – logSys
There is a new, free, better Advanced Login System which you can check out here.
... [READ MORE]Connecting database to both mysqli and mysql entension
Create a file named config.php where you will connect to the database. Put the following code in it:
... [READ MORE]
$mysqli = new mysqli("localhost", "username", "password", "db");
if ($mysqli->connect_errno) {
echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
}
$bd = mysql_connect("localhost", "username", "password") or die(mysql_error());
mysql_select_db("db",$bd) or die(mysql_error());
?>
Create Facebook Like System With jQuery, MySQL, PDO In PHP
Facebook have it’s own like system which pretty good. This post will tell you how to create a "Like system" like that of Facebook. All you have to need is jQuery, MySQL Database and PDO PHP extension. This technic is partially used in my social network, Open. See the demo there in the social network. But you have to signup.
<div>
<span style="color: red; font-family: inherit;">The table should be like this:</span>
</div>
What is SQL Injection and how to make your PHP site free from SQL Injection hacking
$user=$_GET[‘user’];
$sql=mysql_query("SELECT * FROM users WHERE user='".$user."‘");
http://example.com/user.php?user=subin
... [READ MORE]
Subins Games : A new Game site from Subins
Functions
- Commenting
- Score saving
- Play History
- Add your game
- Game stats
SQL Query in another SQL Query = SQL Subquery
SELECT * FROM `fdposts` WHERE user IN (SELECT friend FROM `fdfriends` WHERE user=’subins2000′)
The above code will select rows in table fdposts where user is the value of friend row in the table fdfriends.
As you can see it’s very simple. Here’s another example :
SELECT * FROM `posts` WHERE user IN (SELECT name FROM `members` WHERE user=’subins2000′)
... [READ MORE]
Insert XML Data to MySQL Table Using PHP
<pre class="prettyprint"><code><span style="font-family: inherit;"><items></span>
<span style=“font-family: inherit;"> <item></span> <span style=“font-family: inherit;"> <title>Google</title></span> <span style=“font-family: inherit;"> <url>google.com</url></span> <span style=“font-family: inherit;"> </item></span> <span style=“font-family: inherit;"> <item></span> <span style=“font-family: inherit;"> <title>Google Accounts</title></span> <span style=“font-family: inherit;"> <url>accounts.google.com</url></span> <span style=“font-family: inherit;"> </item></span> <span style=“font-family: inherit;"></items> </span>
... [READ MORE]