Page 1 of 1

POST A QUERY over http

Posted: Thu Mar 26, 2015 11:00 am
by gepponline
Hi!
I'm trying to communicate with an oracle DB using a web layer.

So, on my server i have this PHP file:

Code: Select all

<?

function eseguiSQL ($conn, $querySQL)
{  
	$stmt0 = oci_parse($conn, $querySQL);
	oci_execute($stmt0);
	return($stmt0);
}


// get string from caller
$stringa=$_GET['stringa'];
$array = explode("|", $stringa);
$querySQL=$array[0];
$operazione=$array[1];
etc etc...
?>
I post using the POST function a Query with a pipe and a letter that identify the type of query.

Code: Select all

POST tPost to URL "http://portal.tenax.spa/app_sql_oracle.php"
tPost contain this string: UPDATE TF_MASCHI SET UBICAZIONE='TX2' WHERE NUMERO='999999' AND TIPO='D 25'|U

Obviously nothing work.... :cry:

I think it's the GET function in the php file that don't match with my post function....
Can anyone help me?

Re: POST A QUERY over http

Posted: Thu Mar 26, 2015 2:14 pm
by ghettocottage
I could be wrong, but I think you would use $_POST[] rather than $_GET[] on your php page.

$_GET[] is for when you pass stuff via the url like:

http://portal.tenax.spa/app_sql_oracle. ... gsomething

Re: POST A QUERY over http

Posted: Thu Mar 26, 2015 2:17 pm
by gepponline
You're right!

I've just solved replacing GET with POST and posting the "VARIABLENAME="&tPost as data of my function :)

thank you.

Do you know if there is a way to get something back from the php page?

Re: POST A QUERY over http

Posted: Thu Mar 26, 2015 2:38 pm
by ghettocottage
I have been using LC Server for that sort of thing, but I think PHP is the same principal.

On my server I would do:

Put "this is the info I want to get"


and on my app i would do:

put url "yourDBhost/simpleretrieve.lc" into tData

and now tData would have "this is the info I want to get"



On php you might just: echo "this is the info I want to get"

and then on LC app you might:

put url "http://portal.tenax.spa/app_sql_oracle.php" into tData

But I have not tried with PHP yet, so just guessing