HTTP Request returns "Forbidden"

fpdianzen

Member
Licensed User
Longtime User
Hi Good day,
im creating a simple application with the use of HTTPJob.

my php is good.
i have created 2 php scripts that will be used.
one is for GET and another for php://input

the get is ok. though i can't use it because i find it hard to use with the available resources, because the available one is for php://input.

with my php://input script. it returns Forbidden error.
please help me why am i encountering such error.

:BangHead:
 

fpdianzen

Member
Licensed User
Longtime User
B4X:
<?php

$databasehost = 'XXXXXXXXX';
$databasename = 'XXXXXXX';
$databaseusername = 'XXXXXXXXXXX';
$databasepassword = 'XXXXXXXXXXXX';

$con = mysql_connect($databasehost,$databaseusername,$databasepassword) or die(mysql_error());

mysql_select_db($databasename) or die(mysql_error());
$query = file_get_contents('php://input');

if (get_magic_quotes_gpc()) $query = stripslashes($query);
 
$sth = mysql_query($query);

if (mysql_errno()) { 
    header('HTTP/1.1 500 Internal Server Error');
    echo $query.'\n';
    echo mysql_error(); 
}
else
{
    $rows = array();
    while($r = mysql_fetch_assoc($sth)) {
        $rows[] = $r;
    }
    print json_encode($rows);
}
?>



you can try

plm.edu.ph/egrades/egradesandroid.php?query=select * from plm_students thanks
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…