Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes for php7 #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Less-1/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@


$sql="SELECT * FROM users WHERE id='$id' LIMIT 0,1";
$result=mysql_query($sql);
$row = mysql_fetch_array($result);
$result=mysqli_query($con, $sql);
$row = mysqli_fetch_array($result, MYSQLI_BOTH);

if($row)
{
Expand All @@ -41,7 +41,7 @@
else
{
echo '<font color= "#FFFF00">';
print_r(mysql_error());
print_r(mysqli_error($con));
echo "</font>";
}
}
Expand Down
6 changes: 3 additions & 3 deletions Less-10/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@

$id = '"'.$id.'"';
$sql="SELECT * FROM users WHERE id=$id LIMIT 0,1";
$result=mysql_query($sql);
$row = mysql_fetch_array($result);
$result=mysqli_query($con, $sql);
$row = mysqli_fetch_array($result, MYSQLI_BOTH);

if($row)
{
Expand All @@ -43,7 +43,7 @@

echo '<font size="5" color="#FFFF00">';
echo 'You are in...........';
//print_r(mysql_error());
//print_r(mysqli_error($con));
//echo "You have an error in your SQL syntax";
echo "</br></font>";
echo '<font color= "#0000ff" font size= 3>';
Expand Down
6 changes: 3 additions & 3 deletions Less-11/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@

// connectivity
@$sql="SELECT username, password FROM users WHERE username='$uname' and password='$passwd' LIMIT 0,1";
$result=mysql_query($sql);
$row = mysql_fetch_array($result);
$result=mysqli_query($con, $sql);
$row = mysqli_fetch_array($result, MYSQLI_BOTH);

if($row)
{
Expand All @@ -82,7 +82,7 @@
{
echo '<font color= "#0000ff" font size="3">';
//echo "Try again looser";
print_r(mysql_error());
print_r(mysqli_error($con));
echo "</br>";
echo "</br>";
echo "</br>";
Expand Down
6 changes: 3 additions & 3 deletions Less-12/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
$uname='"'.$uname.'"';
$passwd='"'.$passwd.'"';
@$sql="SELECT username, password FROM users WHERE username=($uname) and password=($passwd) LIMIT 0,1";
$result=mysql_query($sql);
$row = mysql_fetch_array($result);
$result=mysqli_query($con, $sql);
$row = mysqli_fetch_array($result, MYSQLI_BOTH);

if($row)
{
Expand All @@ -84,7 +84,7 @@
{
echo '<font color= "#0000ff" font size="3">';
//echo "Try again looser";
print_r(mysql_error());
print_r(mysqli_error($con));
echo "</br>";
echo "</br>";
echo "</br>";
Expand Down
6 changes: 3 additions & 3 deletions Less-13/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@

// connectivity
@$sql="SELECT username, password FROM users WHERE username=('$uname') and password=('$passwd') LIMIT 0,1";
$result=mysql_query($sql);
$row = mysql_fetch_array($result);
$result=mysqli_query($con, $sql);
$row = mysqli_fetch_array($result, MYSQLI_BOTH);

if($row)
{
Expand All @@ -82,7 +82,7 @@
{
echo '<font color= "#0000ff" font size="3">';
//echo "Try again looser";
print_r(mysql_error());
print_r(mysqli_error($con));
echo "</br>";
echo "</br>";
echo "</br>";
Expand Down
6 changes: 3 additions & 3 deletions Less-14/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
$uname='"'.$uname.'"';
$passwd='"'.$passwd.'"';
@$sql="SELECT username, password FROM users WHERE username=$uname and password=$passwd LIMIT 0,1";
$result=mysql_query($sql);
$row = mysql_fetch_array($result);
$result=mysqli_query($con, $sql);
$row = mysqli_fetch_array($result, MYSQLI_BOTH);

if($row)
{
Expand All @@ -84,7 +84,7 @@
{
echo '<font color= "#0000ff" font size="3">';
//echo "Try again looser";
print_r(mysql_error());
print_r(mysqli_error($con));
echo "</br>";
echo "</br>";
echo "</br>";
Expand Down
6 changes: 3 additions & 3 deletions Less-15/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@

// connectivity
@$sql="SELECT username, password FROM users WHERE username='$uname' and password='$passwd' LIMIT 0,1";
$result=mysql_query($sql);
$row = mysql_fetch_array($result);
$result=mysqli_query($con, $sql);
$row = mysqli_fetch_array($result, MYSQLI_BOTH);

if($row)
{
Expand All @@ -82,7 +82,7 @@
{
echo '<font color= "#0000ff" font size="3">';
//echo "Try again looser";
//print_r(mysql_error());
//print_r(mysqli_error($con));
echo "</br>";
echo "</br>";
echo "</br>";
Expand Down
6 changes: 3 additions & 3 deletions Less-16/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
$uname='"'.$uname.'"';
$passwd='"'.$passwd.'"';
@$sql="SELECT username, password FROM users WHERE username=($uname) and password=($passwd) LIMIT 0,1";
$result=mysql_query($sql);
$row = mysql_fetch_array($result);
$result=mysqli_query($con, $sql);
$row = mysqli_fetch_array($result, MYSQLI_BOTH);

if($row)
{
Expand Down Expand Up @@ -86,7 +86,7 @@
echo "</br>";
echo "</br>";
//echo "Try again looser";
//print_r(mysql_error());
//print_r(mysqli_error($con));
echo "</br>";
echo "</br>";
echo "</br>";
Expand Down
10 changes: 5 additions & 5 deletions Less-17/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function check_input($value)
// Quote if not a number
if (!ctype_digit($value))
{
$value = "'" . mysql_real_escape_string($value) . "'";
$value = "'" . mysqli_real_escape_string($con, $value) . "'";
}

else
Expand Down Expand Up @@ -83,8 +83,8 @@ function check_input($value)
// connectivity
@$sql="SELECT username, password FROM users WHERE username= $uname LIMIT 0,1";

$result=mysql_query($sql);
$row = mysql_fetch_array($result);
$result=mysqli_query($con, $sql);
$row = mysqli_fetch_array($result, MYSQLI_BOTH);
//echo $row;
if($row)
{
Expand All @@ -97,10 +97,10 @@ function check_input($value)



if (mysql_error())
if (mysqli_error($con))
{
echo '<font color= "#FFFF00" font size = 3 >';
print_r(mysql_error());
print_r(mysqli_error($con));
echo "</br></br>";
echo "</font>";
}
Expand Down
10 changes: 5 additions & 5 deletions Less-18/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function check_input($value)
// Quote if not a number
if (!ctype_digit($value))
{
$value = "'" . mysql_real_escape_string($value) . "'";
$value = "'" . mysqli_real_escape_string($con, $value) . "'";
}

else
Expand Down Expand Up @@ -95,8 +95,8 @@ function check_input($value)


$sql="SELECT users.username, users.password FROM users WHERE users.username=$uname and users.password=$passwd ORDER BY users.id DESC LIMIT 0,1";
$result1 = mysql_query($sql);
$row1 = mysql_fetch_array($result1);
$result1 = mysqli_query($con, $sql);
$row1 = mysqli_fetch_array($result1, MYSQLI_BOTH);
if($row1)
{
echo '<font color= "#FFFF00" font size = 3 >';
Expand All @@ -109,7 +109,7 @@ function check_input($value)
echo 'Your User Agent is: ' .$uagent;
echo "</font>";
echo "<br>";
print_r(mysql_error());
print_r(mysqli_error($con));
echo "<br><br>";
echo '<img src="../images/flag.jpg" />';
echo "<br>";
Expand All @@ -119,7 +119,7 @@ function check_input($value)
{
echo '<font color= "#0000ff" font size="3">';
//echo "Try again looser";
print_r(mysql_error());
print_r(mysqli_error($con));
echo "</br>";
echo "</br>";
echo '<img src="../images/slap.jpg" />';
Expand Down
10 changes: 5 additions & 5 deletions Less-19/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function check_input($value)
// Quote if not a number
if (!ctype_digit($value))
{
$value = "'" . mysql_real_escape_string($value) . "'";
$value = "'" . mysqli_real_escape_string($con, $value) . "'";
}

else
Expand Down Expand Up @@ -95,8 +95,8 @@ function check_input($value)


$sql="SELECT users.username, users.password FROM users WHERE users.username=$uname and users.password=$passwd ORDER BY users.id DESC LIMIT 0,1";
$result1 = mysql_query($sql);
$row1 = mysql_fetch_array($result1);
$result1 = mysqli_query($con, $sql);
$row1 = mysqli_fetch_array($result1, MYSQLI_BOTH);
if($row1)
{
echo '<font color= "#FFFF00" font size = 3 >';
Expand All @@ -109,7 +109,7 @@ function check_input($value)
echo 'Your Referer is: ' .$uagent;
echo "</font>";
echo "<br>";
print_r(mysql_error());
print_r(mysqli_error($con));
echo "<br><br>";
echo '<img src="../images/flag.jpg" />';
echo "<br>";
Expand All @@ -119,7 +119,7 @@ function check_input($value)
{
echo '<font color= "#0000ff" font size="3">';
//echo "Try again looser";
print_r(mysql_error());
print_r(mysqli_error($con));
echo "</br>";
echo "</br>";
echo '<img src="../images/slap.jpg" />';
Expand Down
6 changes: 3 additions & 3 deletions Less-2/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

// connectivity
$sql="SELECT * FROM users WHERE id=$id LIMIT 0,1";
$result=mysql_query($sql);
$row = mysql_fetch_array($result);
$result=mysqli_query($con, $sql);
$row = mysqli_fetch_array($result, MYSQLI_BOTH);

if($row)
{
Expand All @@ -44,7 +44,7 @@
else
{
echo '<font color= "#FFFF00">';
print_r(mysql_error());
print_r(mysqli_error($con));
echo "</font>";
}
}
Expand Down
16 changes: 8 additions & 8 deletions Less-20/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function check_input($value)
}
if (!ctype_digit($value)) // Quote if not a number
{
$value = "'" . mysql_real_escape_string($value) . "'";
$value = "'" . mysqli_real_escape_string($con, $value) . "'";
}
else
{
Expand All @@ -80,8 +80,8 @@ function check_input($value)


$sql="SELECT users.username, users.password FROM users WHERE users.username=$uname and users.password=$passwd ORDER BY users.id DESC LIMIT 0,1";
$result1 = mysql_query($sql);
$row1 = mysql_fetch_array($result1);
$result1 = mysqli_query($con, $sql);
$row1 = mysqli_fetch_array($result1, MYSQLI_BOTH);
$cookee = $row1['username'];
if($row1)
{
Expand All @@ -94,7 +94,7 @@ function check_input($value)
//echo 'Your Cookie is: ' .$cookee;
echo "</font>";
echo "<br>";
print_r(mysql_error());
print_r(mysqli_error($con));
echo "<br><br>";
echo '<img src="../images/flag.jpg" />';
echo "<br>";
Expand All @@ -103,7 +103,7 @@ function check_input($value)
{
echo '<font color= "#0000ff" font size="3">';
//echo "Try again looser";
print_r(mysql_error());
print_r(mysqli_error($con));
echo "</br>";
echo "</br>";
echo '<img src="../images/slap.jpg" />';
Expand Down Expand Up @@ -145,12 +145,12 @@ function check_input($value)

echo "<br></font>";
$sql="SELECT * FROM users WHERE username='$cookee' LIMIT 0,1";
$result=mysql_query($sql);
$result=mysqli_query($con, $sql);
if (!$result)
{
die('Issue with your mysql: ' . mysql_error());
die('Issue with your mysql: ' . mysqli_error($con));
}
$row = mysql_fetch_array($result);
$row = mysqli_fetch_array($result, MYSQLI_BOTH);
if($row)
{
echo '<font color= "pink" font size="5">';
Expand Down
16 changes: 8 additions & 8 deletions Less-21/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function check_input($value)
}
if (!ctype_digit($value)) // Quote if not a number
{
$value = "'" . mysql_real_escape_string($value) . "'";
$value = "'" . mysqli_real_escape_string($con, $value) . "'";
}
else
{
Expand All @@ -80,8 +80,8 @@ function check_input($value)


$sql="SELECT users.username, users.password FROM users WHERE users.username=$uname and users.password=$passwd ORDER BY users.id DESC LIMIT 0,1";
$result1 = mysql_query($sql);
$row1 = mysql_fetch_array($result1);
$result1 = mysqli_query($con, $sql);
$row1 = mysqli_fetch_array($result1, MYSQLI_BOTH);
if($row1)
{
echo '<font color= "#FFFF00" font size = 3 >';
Expand All @@ -93,7 +93,7 @@ function check_input($value)
//echo 'Your Cookie is: ' .$cookee;
echo "</font>";
echo "<br>";
print_r(mysql_error());
print_r(mysqli_error($con));
echo "<br><br>";
echo '<img src="../images/flag.jpg" />';
echo "<br>";
Expand All @@ -103,7 +103,7 @@ function check_input($value)
{
echo '<font color= "#0000ff" font size="3">';
//echo "Try again looser";
print_r(mysql_error());
print_r(mysqli_error($con));
echo "</br>";
echo "</br>";
echo '<img src="../images/slap.jpg" />';
Expand Down Expand Up @@ -144,12 +144,12 @@ function check_input($value)
$cookee = base64_decode($cookee);
echo "<br></font>";
$sql="SELECT * FROM users WHERE username=('$cookee') LIMIT 0,1";
$result=mysql_query($sql);
$result=mysqli_query($con, $sql);
if (!$result)
{
die('Issue with your mysql: ' . mysql_error());
die('Issue with your mysql: ' . mysqli_error($con));
}
$row = mysql_fetch_array($result);
$row = mysqli_fetch_array($result, MYSQLI_BOTH);
if($row)
{
echo '<font color= "pink" font size="5">';
Expand Down
Loading