Advertisement
Guest User

Untitled

a guest
Feb 29th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. NSString *strURL = [NSString stringWithFormat:@"http://www.example.com/post.php?dishname=%@&description=%@, dishname.text, description.text];
  2. NSData *dataURL = [NSData dataWithContentsOfURL:[NSURL URLWithString:strURL]];
  3. NSString *strResult = [[NSString alloc] initWithData:dataURL encoding:NSUTF8StringEncoding];
  4. NSLog(@"%@", strResult);
  5.  
  6. <?php
  7.  
  8. // Create connection
  9. $servername = "localhost";
  10. $username = "admin";
  11. $password = "root";
  12. $dbname = "dbname";
  13. $con=mysqli_connect("localhost","admin","root","dbname");
  14.  
  15. if (!$con) {
  16. die("Connection failed: " . mysqli_connect_error());
  17. echo "Nothing happened";
  18.  
  19. }else{
  20.  
  21.  
  22. }
  23.  
  24.  
  25. if (isset ($_GET["dishname"]))
  26. $dishname = $_GET["dishname"];
  27.  
  28. else
  29. $dishname = "Null";
  30. if (isset ($_GET["description"]))
  31. $description = $_GET["description"];
  32. else
  33. $description = "Null";
  34.  
  35. echo "dishname : ". $dishname;
  36. echo "description : ". $description;
  37.  
  38. $sql = "insert into RecipeFeed (DishName, Description) values ('".$dishname."','".$description."')";
  39. $result = mysqli_query($con, $sql);
  40. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement