Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6175579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:56:56+00:00 2026-05-23T23:56:56+00:00

I have a iphone application when the user presses the button i collect data

  • 0

I have a iphone application when the user presses the button i collect data and send it to web server that is written by php.I made a form there and of course my form has a submit button but when the user press the button in the application how can i tell the form to submit the text that user choses. here is my php code

<?php require_once('Connections/local.php')?>
<?php
if (isset($_POST['appy_level'])){
$id=mysql_insert_id();

$appy_level=$_POST['appy_level'];
$year=$_POST['year'];
$date =date('Y');
$year=$date-$year;
$reasons = $_POST['reasons'];
$reasons = str_replace(","," ",$reasons); 
if(isset($_POST['sex']))
 $sex=$_POST['sex'];
$country=$_POST['country'];
$city=$_POST['city'];
$id=mysql_insert_id();

$insertSQL = "INSERT INTO user (age,wname,slid,time,sex) VALUES                 (".$year.",".$reasons.",".$appy_level.",CURRENT_TIMESTAMP,".$sex.")";
 $insertSQL1="INSERT INTO country (c_name) VALUES (".$country.")";
 $insertSQL2="INSERT INTO city (ci_name) VALUES (".$city.")";
mysql_select_db($database_local, $local);
mysql_query($insertSQL, $local) or die(mysql_error());
mysql_query($insertSQL1, $local) or die(mysql_error());
mysql_query($insertSQL2, $local) or die(mysql_error());

}
?>


  <body>
    <form action="" method="post" name="form1" id="form1">
 <table>
<tr>
<td>Happyness level:</td>
<td>
<input type="text" name="appy_level" value="" maxlength="100" />
</td>
</tr>
<tr>
<td>Reasons:</td>
<td>
<input type="text" name="reasons" value="" maxlength="100" />
</td>
</tr>
<tr>
<td>Gender:</td>
<td>
<input type="text" name="sex" value=""  maxlength="100" />
</td>
</tr>
<tr>
<td>Country:</td>
<td>
<input type="text" name="country" value="" maxlength="100" />
</td>
</tr>
<tr>
<td>City:</td>
<td>
<input type="text" name="city" value="" maxlength="100" />
</td>
</tr>
<tr>
<td>Year:</td>
<td>
<input type="text" name="year" value="" maxlength="100" />
</td>
</tr>
<tr><td> </td>
<td>
<input type="submit" value="Submit" />
</td>
</tr>
</table>        
</body>

How can i submit my form without a submit button. when the user presses the button ok in iphone application i want to submit his information to database.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T23:56:56+00:00Added an answer on May 23, 2026 at 11:56 pm

    I do not see where you are connecting to your database, the connection you are trying to use is $local, here:

    mysql_query($insertSQL, $local) or die(mysql_error());
    

    If the values you are trying to insert are strings, you need to enclose them in single quotes:

    INSERT INTO tableName(col1, col2, col3, ..., colN) VALUES('val1', 'val2', 'val3', ..., 'valN')
    

    You should wrap the string values in quotes and not forget to protect against sql injection by escaping the strings:

    $val1 = mysql_real_escape_string($_POST['val1']);
    $query = "INSERT INTO tableName(val1) VALUES('" . $val1 . "')";
    mysql_query($query, $local);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an iPhone application that has a user preference page where the user
I have a user class that I use through the iPhone application, this is
In my iPhone application I have a table view. When user taps any row,
I have an iPhone application with a settings.bundle that handles various settings for my
I have an application that works some what similar to how iPhone's Contact application
I have a core data iPhone application. I have two views on a navigation
I have an iPhone application, which lets the user add and and modify Assignments.
I have an iPhone application which will exit on it's own after a user
Can User follow up on twitter using iphone application. I have done the functionality
I am building an iPhone application that requires the user to enter his credentials

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.