Posting to php problem

William Prothero prothero at earthednet.org
Thu Jan 22 12:33:34 EST 2015


Folks:
This simple code inexplicably stopped working. LC 7.0.1 and 7.0.2 (rc1), Yosemite on Mac. I’m setting up my mySQL database code and accessing the db’s thru php. This code worked at first, then after I did a bit of changing, it stopped. Reverting to the initial working code didn’t work. 

I get the “Query: “ part of the echo statement, but the $query part is blank.

What the hell? This should be trivial. What am I missing?

Livecode script (almost verbatim from the docs):

on mouseUp
   put empty into tFormData
   put "http://earthednet.org/cgiphp/dbtest2.php" into tUrl
   put "This is a test" into tSendContents
   if libUrlMultipartFormData(tFormData, "fullname", tSendContents) is not empty then
      answer it ##error
   else
      set the httpHeaders to line 1 of tFormData
      post line 2 to -1 of tFormData to url tUrl 
      --      ## check the result, etc., here
      put the result into tRes
      put it into theReturnedData
      set the httpHeaders to empty
   end if
   put theReturnedData into fld "nameList"
end mouseUp


Here’s the php code:  I get the “Query: “ part of the response, but not the input data in the POST.
<?php
	$query = $_POST_["fullname"];
	echo "Query: ".$query;	
?>


More information about the use-livecode mailing list