<?php
$user="a7255804_IDS";
$password="somepass";
$db="a7255804_IDS";
$host="mysql16.000webhost.com";
$name=hash("sha256",urldecode($_GET["name"]),false);
$pass=hash("sha256",urldecode($_GET["pass"]),false);
$con=mysqli_connect($host,$user,$password,$db) or die ("Cant connect");
if(mysqli_connect_errno($con))
{
$sqluser="SELECT 'name' FROM 'ids' WHERE 'name'='$name' AND 'password'='$pass'";
$sqluser_run=mysqli_query($con,$sqluser);
if (mysqli_num_rows($sqluser_run)==1)
{
echo "ok";
}
else
{
echo "No user in system!";
}
}
?>
heres the computer, url beginning not real
os.loadAPI("Apis/DesignUtil")
os.loadAPI("Apis/AccountSytem")
os.loadAPI("Apis/windowSystem")
DesignUtil.setDesign("whiteLightGray")
local background,topBar =DesignUtil.getDesign()
local window =windowSystem.createWindow("xxxxxxxxx",2,2,48,16,false)
function identify(name,pass)
local auth=http.get("http://somesite.com/folder/auth.php?name="..textutils.urlEncode(name).."?pass="..textutils.urlEncode(pass))
local response=auth.readAll()
auth.close()
print(response)
end
while true do
paintutils.drawImage(background,1,1)
windowSystem.drawWindow(window)
term.setBackgroundColor(colors.white)
term.setCursorPos(48/2-6,5)
print("xxxxxxxxxx name:")
term.setCursorPos(48/2-10,7)
print("xxxxxx password:")
term.setTextColor(colors.white)
term.setBackgroundColor(colors.gray)
term.setCursorPos(48/2+8,5)
print(" ")
term.setCursorPos(48/2+8,7)
print(" ")
term.setCursorPos(48/2+8,5)
local enteredName= read()
term.setCursorPos(48/2+8,7)
local enteredPass= read("*")
identify(enteredName,enteredPass)
end
so, its supposed to look in the db and see if theres a field with matching name and pass, if is, return the ok statement(wont return currently, since table is empty) if there isnt, it will return the other statement. Not working, nothing wont be printed on the computer side.
could the only issue really be that the table is empty at this point?