Posting to php problem

William Prothero prothero at earthednet.org
Thu Jan 22 12:42:57 EST 2015


Dang! Just solved it. The syntax for getting the $_POST variable in php is:
$_POST[“fullame”]
the underscore was the problem.
Regards,
Bill

> On Jan 22, 2015, at 9:33 AM, William Prothero <prothero at earthednet.org> wrote:
> 
> 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;	
> ?>
> _______________________________________________
> 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





More information about the use-livecode mailing list