06-07-2011 01:41 PM - edited 06-07-2011 02:16 PM
I have a little bit of experience from school assignments with submitting data via a php script. This included the db login info and what to do in case of not being able to connect to the server.
I took a look at the How I would call a web service from webworks app thread but I don't understand alot of it(the scripts, SOAP, JSON, etc). The php code I used before was pretty basic and readable. Is there an easier/more understandable way of doing this? I'm just trying to submit form data to an sql server(while also putting the data in an offline queue). To make matters more complicated, the people i'm working for are not sure if they have a perl or php script server.
This is what i'm familiar with:
The html form code:
<form action="insert.php" method="post">
Firstname: <input type="text" name="firstname" />
Lastname: <input type="text" name="lastname" />
Age: <input type="text" name="age" />
<input type="submit" />
the sql connection code, insert.php
$con = mysql_connect("localhost","peter","abc123");
die('Could not connect: ' . mysql_error());
$sql="INSERT INTO Persons (FirstName, LastName, Age)
die('Error: ' . mysql_error());
echo "1 record added";
06-07-2011 03:56 PM
This is a great question. I am having difficult posting to a remote server using an AJAX call from my webworks app, which returns something if the asynchronous post was successful. See my original thread(no replied there yet):
I believe the main issue is making a call from a WebWorks app from a domain(your PlayBook) that is not "alive" on the same server(or web address), as the source of youwe WebWorks app is stored locally vs. remotely. So calling your php (or other server script) is tricky. There are browser limitations. The issue of origin being one...
Cross-domain server calls, is the technical name.
Hope someone can contribute to this thread. It will allow developers trying to bridge the gap between their existing web skill-set and better integrate with core tablet features.
06-08-2011 01:07 AM - edited 06-08-2011 01:08 AM