webform problems

Hello,

I’m trying to get Unity to talk to a MySQL data base on a web server. I’ve copied the scripts in the example below and set everything up as I think it should be but I can’t get it to work. The perl script seems to be getting called by Unity but when it returns there is no error but no data either. When I check the DB on line no data has been inserted into the table.

I’m pretty sure the perl script is getting called because if I rename it and run the Unity code I do get an error. I don’t know how to debug this further. Anyone got any experience of doing this sort of thing and can give me a pointer as to what might be going wrong?

I created a table in my DB as per the instructions below, created a user, copied the perl script into public_html/CGI-bin, set it’s permission to executable etc.

ANy ideas what might be going wrong or how to debug this further? I read on line about a error_log file on the web server but I can’t find it…

regards,

Tony Oakden

Try using a browser to access the URL directly (you might need to code some HTML to fill in the form correctly). If the Perl script is working, you should see the correct data returned in the browser window or perhaps you may need to view the page source, depending on the type of data. If you’ve got access to the webserver access log, you can also use this to check if the Perl script was activated. If all seems well on the server side, there is probably something wrong with the parameters your Unity code is passing via the web form.

I would also say you’ll probably find it easier to use PHP as the server scripting language rather than Perl. There is an example of how to communicate with PHP/MySQL on a webserver here on the Unify wiki.

Make sure your server returns crossdomain.xml with content like:



Read about client side connection in my tutorial: http://unity-tutorials.blogspot.com/
Listings 12 - 15