Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NSString *strURL = [NSString stringWithFormat:@"http://www.example.com/post.php?dishname=%@&description=%@, dishname.text, description.text];
- NSData *dataURL = [NSData dataWithContentsOfURL:[NSURL URLWithString:strURL]];
- NSString *strResult = [[NSString alloc] initWithData:dataURL encoding:NSUTF8StringEncoding];
- NSLog(@"%@", strResult);
- <?php
- // Create connection
- $servername = "localhost";
- $username = "admin";
- $password = "root";
- $dbname = "dbname";
- $con=mysqli_connect("localhost","admin","root","dbname");
- if (!$con) {
- die("Connection failed: " . mysqli_connect_error());
- echo "Nothing happened";
- }else{
- }
- if (isset ($_GET["dishname"]))
- $dishname = $_GET["dishname"];
- else
- $dishname = "Null";
- if (isset ($_GET["description"]))
- $description = $_GET["description"];
- else
- $description = "Null";
- echo "dishname : ". $dishname;
- echo "description : ". $description;
- $sql = "insert into RecipeFeed (DishName, Description) values ('".$dishname."','".$description."')";
- $result = mysqli_query($con, $sql);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement