I have read up quite a bit about the request method now, and i found a example that supplies this php example :
<?php
// Read request parameters
$firstName= $_REQUEST["firstName"];
$lastName = $_REQUEST["lastName"];// Store values in an array
$returnValue = array(“firstName”=>$firstName, “lastName”=>$lastName);
// Send back request in JSON format
echo json_encode($returnValue);
?>
i have written a IOS app in swift that sends data to this php, i will then use the website and write the data received to a textfile on the server, is the $_Request method the correct method ?
IOS part ( not complete code ) that sends data to the website :
let request = NSMutableURLRequest(URL: NSURL(string: "http://localhost/test.php")!)
request.HTTPMethod = "POST"
let postString = "firstName=Neil&lastName=Johnson"
Note : this code does not seam to work ( Undefined index at line 4, 5 and 6 but im not sure why as i cant use a isset method here as some threads have stated to remove the error)
Thank you in regards
$_POSTinstead of$_REQUEST