Note that there are some explanatory texts on larger screens.

plurals
  1. POASIFormDataRequest POST error - iOS 6
    primarykey
    data
    text
    <p>I have the following code linked to a PHP file,the objective is to post some strings and retrieve in the PHP file,all the stuff is working fine,but something is wrong with my code,see bellow:</p> <p><strong>iOS Application Code</strong></p> <pre><code> NSString *urlString = @"http://www.myurl.com/path/ios.st.addquestion.php?"; NSURL *uploadURL = [NSURL URLWithString:urlString]; ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:uploadURL]; [request setPostValue:askerUsername forKey:@"username"]; [request setPostValue:@"1" forKey:@"questiontype"]; [request setPostValue:title forKey:@"title"]; [request setPostValue:hasAditional forKey:@"hasaditional"]; [request setPostValue:aditional forKey:@"aditional"]; [request setPostValue:hasLocation forKey:@"haslocation"]; [request setPostValue:location forKey:@"location"]; [request setPostValue:latitude forKey:@"latitude"]; [request setPostValue:longitude forKey:@"longitude"]; [request setPostValue:category forKey:@"category"]; [request setPostValue:hasImage forKey:@"hasimage"]; [request startAsynchronous]; </code></pre> <p><strong>PHP File</strong></p> <pre><code> $questiontype = mysql_real_escape_string($_GET['questiontype']); $username_PRO = mysql_real_escape_string($_GET['username']); $title_PRO = mysql_real_escape_string($_GET['title']); $hasAditional = mysql_real_escape_string($_GET['hasaditional']); $aditional_PRO = mysql_real_escape_string($_GET['aditional']); $hasLocation = mysql_real_escape_string($_GET['haslocation']); $location_PRO = mysql_real_escape_string($_GET['location']); $latitude_PRO = mysql_real_escape_string($_GET['latitude']); $longitude_PRO = mysql_real_escape_string($_GET['longitude']); $category = mysql_real_escape_string($_GET['category']); echo "$username_PRO"; </code></pre> <p>When i run the application and POST the strings to the PHP file,nothing happens,is like the PHP received a null value,i can't figure out what is wrong in my code,anyone know?The procedure is something like this:</p> <p>Application => ASIFormDataRequest(Post values) => <strong>PHP file receives request and insert strings on a MYSQL database(THE PROBLEM IS HERE).</strong></p> <p>I have already searched on the web and on ASI website but nothing seems to work.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload