Re: Android and POST commands (revisited)…?

Pierre Sahores sc at sahores-conseil.com
Thu Sep 26 20:21:17 EDT 2013


Hi John,

Here is a practical example of code witch works as expected under both iOS and Android :

  	set httpHeaders to "Content-type: application/x-www-form-urlencoded" & return
         get url MIAS
         post URLEncode(appID & "&isDistibutor=" & trim(vemail) & "&isNotDistibutor=" & UserID) to URL MIAS
         ### answer item -1 of line 2 of it
         if word 1 of it is "true" 
         then return line 2 to 3 of it

note 1 : libURLFormData is't available to mobile platforms;
note 2 : the URLEncode form is usable in place of;

HTH,

Pierre

Le 27 sept. 2013 à 00:45, JOHN PATTEN a écrit :

> Hi All..
> 
> I've been testing a project in an Android device and can't seem to get the POST command to work on Android. It works fine on the desktop (Mac). I have checked the list and bug reports and have seen past issue Header adjustments, etc. and it appears that any real bugs had been resolved. This leads me to believe the problem is my code. Here's what I'm trying to do. The project uses a number in a fld to query a mysql database on my on-rev account and pulls out a couple of fields.
> ...
>   put cd fld "assignmentNumber" into tPostData
>   get libURLFormData("doccode",tPostData)
>   set the httpHeaders to "Content-Type: application/x-www-form-urlencoded" --added this from a previous solution but had no effect.
>   post it to url "http://jpatten.on-rev.com/safetube_student/lc_lookup_title_exec.php"
> 
>> and the PHP code from the lc_lookup_title_exec.php...
> 
> $doccode = clean($_POST['doccode']); 
> $result = mysql_query("SELECT title, summary FROM urldoc WHERE docid = $doccode");
> if($result === FALSE) {
> die(mysql_error());
> }
> while($row = mysql_fetch_array($result))
>  {
> echo $row['title'] . PHP_EOL . $row['summary'];
>  }
> 
> Any suggestions on how this can be changed to work on a Android device?
> 
> Thank you!
> 
> John Patten
> SUSD
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

--
Pierre Sahores
mobile : 06 03 95 77 70
www.sahores-conseil.com





More information about the use-livecode mailing list