Page 1 of 1
add record to appgini database with url
Posted: 2013-05-10 17:22
by tundra96
what is the format to add a record into a appgini application just using a url ?
like:
Code: Select all
http://www.myapp.com/raw_numbers_view.php?SelectedID=9&record-added-ok=691309475&SortField=&SortDirection=&FirstRecord=1&DisplayRecords=all
I want to know what the string would be to add a record, without using the appgini application interface
Re: add record to appgini database with url
Posted: 2013-05-10 21:51
by tundra96
Does anyone know what the format would be to add a record ? I have another application that needs to be able to insert data into the database just using a url ... not the appgini form
Re: add record to appgini database with url
Posted: 2013-05-11 03:18
by KSan
Not enough info provided. What is your other application? What platform? VB on PC, PHP on browser, C++ etc ? How can one answer an incomplete question such as yours.
Also please be patient. Don't double post after 4 hours just because no one replied... This forum is mostly supported by AppGini users just like you so some patience and courtesy goes a long way. Have a great weekend.
Re: add record to appgini database with url
Posted: 2013-05-11 13:38
by a.gneady
Tundra, you can't insert a record directly from the URL (that is, using GET request) ... you must use POST to insert a record ... Your other application should compose a POST request (using curl or some other method) .. The POST request should post to "tablename_view.php" (where tablename is the name of the concerned table), and contain a variable named insert_x with value set to 1 and a variable named after each editable table field, with its value set to whatever is to be inserted in that field.
If your AppGini app doesn't allow anonymous users to add new records, then your other app must authenticate first and send the correct session cookie name and value to the AppGini app. A helpful tool to reverse-engineer this process is Firebug add-on for Firefox (under the Net > HTML tab)
Re: add record to appgini database with url
Posted: 2016-03-11 13:55
by Goundski
Hi
Like this?
<?php
$data = array(insert_x=1, "name"=>"Test Product", "description"=>"test", "altname"="TP");
$string = http_build_query($data);
$ch = curl_init("
http://Mydomain.com/sahdb/tblProduct_view.php")
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);
?>
It did not work for me
Re: add record to appgini database with url
Posted: 2016-03-11 14:17
by Goundski
I also tried it this way with no luck?
<?php
insert_x = 1
Name = "Test Product"
Description = "test"
AltName="TP"
$ch = curl_init("
http://Mydomain.com/sahdb/tblProduct_view.php")
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);
?>
Re: add record to appgini database with url
Posted: 2016-03-15 13:13
by Goundski
Okay, I found this alternative way of doing this, that worked just fine for me.
More info at:
https://www.youtube.com/watch?v=fvH865tKOLE
Enjoy!