Android Question httputils2 problem sending parameters

santiago

Member
Licensed User
Longtime User
First , I beg your pardo if exists an open thread about this area.

I am using OKhttputils2, but I tried before with httputils2 lib.

I have a php file .Its requires 2 parameters .
When I use bronwser and I type on it

http://domain.com/ted1.php?ticket=55&nif=33 I have this answer
holllaArray ( [ticket] => 55 [nif] => 33 ) Array ( [ticket] => 55 [nif] => 33 ) ticket 55 nif 33
in my php page I wrote

<?php
echo "hollla";
print_r($_GET);
print_r($_REQUEST);
$nif=$_GET["nif"];
$ticket=$_GET["ticket"];
echo "ticket ".$ticket." nif ".$nif;
... and more

If I uses httputils I wrote this

job1.Initialize("Job1", Me)
job1.PostString("http://" & ip & "/ted1.php", Array As String("ticket", "55", "nif", "33"))


and I received (using Job.Getstring on the JobDone-Job.Sucess ) this string

holllaArray()Array()

I read this way ,using an array ,working fine for everybody.

Its LIKE I AM NOT SENDING PARAMETERS AT ALL .
I tried several ways to send the parameters data
job1.PostString("http://" & ip & "/ted1.php", "ticket=55&nif=33) without success .

Please, what I am doing wrong?
 
Upvote 0
Thanks .
I used job1.download2 with the same data and it works fine.
job1.download2("http://" & ip & "/ted1.php", Array As String("ticket", "55", "nif", "33"))
I think I did not understood the tutorial I read about this httputils2

But , I had this problem , with the original code

job1.PostString("http://" & ip & "/ted1.php", Array As String("ticket", "55", "nif", "33")), using $_POST instead $_GET in the php page, I did not take any valor.

Could somebody tell my why?

Thanks in advance
 
Upvote 0
I may be off base as I don't use that function...

But
Shouldn't this
Code:
job1.Initialize("Job1", Me)
job1.PostString("http://" & ip & "/ted1.php", Array As String("ticket", "55", "nif", "33"))

Be this?
Code:
job1.Initialize("Job1", Me)
job1.PostString("http://" & ip & "/ted1.php?", Array As String("ticket", "55", "nif", "33"))

I am rusty with php....
 
Upvote 0
Thanks for previous responses.

Now I have this problem.Maybe somebody can help me.


I have this variables (all string variables) and its values

billete = "e3eeeee"
dia1="2016/01/01"
hora="10:00:00"
horay="12:00:00"
po=1
pd=2
barco=3

job1.Initialize("Job1", Me)
job1.Download2("http://" & ip & "/ted1.php", Array As String("ticket", billete,"fecha",dia1,"hora",hora,"horay",horay,"po",po,"pd",pd,"barco",barco,"emp",emp))

When I try this code, application CRASH.

Where is the mistake? Maybe for use variables value like "2016/01/01" or "12:00:00" that includes / or :

And if the problem is that-using / or : - , how can I solve ?
Thanks in advance. Any help is wellcomed
 
Upvote 0
Sorry. I beg your pardon. Application CRASH for another issues. Sentences I wrote are working properly.
I investigate with any variable and I found the problem at a different operation

Thanks
 
Upvote 0
Back
Top