Insert API/Webservice Using PHP-MYSQL

We will need to create 2 files.
One file would contain the insertion form.

1.Create a form called “signup.php” and put the following code into it.

<html>
<body>
<h1><b>INSERT INQUIRY DETAILS</b></h1>
<form method="POST" action="your/file/path/filename.php">
<table><tr><td>
FIRST NAME:</td><td><input type="text" name="first_name" required></td></tr><tr><td>
LAST NAME:</td><td><input type="text" name="last_name" required></td></tr><tr><td>
PHONE:</td><td><input type="text" name="phone" required></td></tr><tr><td>
EMAIL:</td><td><input type="text" name="email" required></td></tr>
<tr><td>
POSTAL CODE:</td><td><input type="text" name="postal_code" required></td></tr>
<tr><td>
APPOINTMENT DATE/TIME:</td><td><input type="date" name="appointment_date">
<input type="time" name="appointment_time"></td></tr>
<tr>
<td>
<center><input type="submit" value="SUBMIT DETAILS"></center></td>
</tr>
</table>
</form>

<style>
input[type=text], select {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}

input[type=submit] {
width: 100%;
background-color: #4CAF50;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
border-radius: 4px;
cursor: pointer;
}

input[type=submit]:hover {
background-color: #45a049;
}

div {
border-radius: 5px;
background-color: #f2f2f2;
padding: 20px;
}
</style>
</body>
</html>

===============================================================
2. Create a file for inserting data into the database.(insert.php)

 

<?php
header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json; charset=UTF-8");

$servername = "localhost"; // yourhostname
$username = "root"; //your username
$password = ""; //yourpassword

$dbh1 = mysql_connect($servername, $username, $password);

mysql_select_db($dbname, $dbh1);

if($_SERVER['REQUEST_METHOD'] == "POST"){
// Get data
$first_name = isset($_POST['first_name']) ? mysql_real_escape_string($_POST['first_name']) : "";
$last_name = isset($_POST['last_name']) ? mysql_real_escape_string($_POST['last_name']) : "";
$email = isset($_POST['email']) ? mysql_real_escape_string($_POST['email']) : "";
$phone = isset($_POST['phone']) ? mysql_real_escape_string($_POST['phone']) : "";
$postal_code = isset($_POST['postal_code']) ? mysql_real_escape_string($_POST['postal_code']) : "";
echo $appointment_date = isset($_POST['appointment_date']) ? mysql_real_escape_string($_POST['appointment_date']) : "";
echo $appointment_time = isset($_POST['appointment_time']) ? mysql_real_escape_string($_POST['appointment_time']) : "";
echo $appointment_date_time = $appointment_date." ".$appointment_time;
if( ! ini_get('date.timezone') )
{
date_default_timezone_set('GMT');
}

$created_date = date('Y-m-d H:i:s');

// Insert data into data base
$sql = "INSERT INTO `inquiry`(`first_name`, `last_name`,`phone`, `email`,`postal_code`, `appointment_date_time`, `appointment_date`, `appointment_time`,`created_date`) VALUES ('$first_name','$last_name','$phone','$email','$postal_code','$appointment_date_time','$appointment_date','$appointment_time','$appointment_notes','$created_date')";
$qur = mysql_query($sql);
$app_res=mysql_query($appointment_sql);
if($qur){
$json = array("status" => 1, "msg" => "Done User added!");
}else{
$json = array("status" => 0, "msg" => "Error adding user!");
}
}else{
$json = array("status" => 0, "msg" => "Request method not accepted");
}

/* Output header */

echo json_encode($json);

?>

467 thoughts on “Insert API/Webservice Using PHP-MYSQL

  1. Pingback: Google
  2. Pingback: VIP Desert Safari
  3. Pingback: Porn City XXX
  4. Pingback: website
  5. Pingback: mail order brides
  6. Pingback: milf dating
  7. Pingback: саврасый
  8. Pingback: rencontres sexe
  9. Pingback: rabbit vibrators
  10. Pingback: Annemarie Börlind
  11. Pingback: app for laptop
  12. Pingback: play free pc games
  13. Pingback: bullet eggs
  14. Pingback: cursos gratuitos
  15. Pingback: Gurgaon
  16. Pingback: gay sex
  17. Pingback: webcambabes
  18. Pingback: sexe webcam
  19. Pingback: prostate toy
  20. Pingback: double sided dildo
  21. Pingback: thick dildo
  22. Pingback: спарыш
  23. Pingback: sex toy store
  24. Pingback: thick dildo
  25. Pingback: top rated strapons
  26. Pingback: using penis pump
  27. Pingback: easy payday loans
  28. Pingback: персть
  29. Pingback: vaginal balls
  30. Pingback: best dildos
  31. Pingback: splorch review
  32. Pingback: best sex games
  33. Pingback: panty vibrator
  34. Pingback: viagra
  35. Pingback: satta matka
  36. Pingback: double vibrator
  37. Pingback: male stroker toy
  38. Pingback: clit vibe
  39. Pingback: g gasm curve
  40. Pingback: adam male toys
  41. Pingback: gay bondage gear
  42. Pingback: porn city
  43. Pingback: porn land
  44. Pingback: butterfly vibrator
  45. Pingback: gay underwear
  46. Pingback: cyberskin stroker
  47. Pingback: male stroker
  48. Pingback: Suan Sunandha
  49. Pingback: suction cup dong
  50. Pingback: rampant rabbit
  51. Pingback: adult toys for men
  52. Pingback: spanking paddle
  53. Pingback: best sex toy 2018
  54. Pingback: bondage kit
  55. Pingback: lingerie
  56. Pingback: look at here
  57. Pingback: Julia Ann
  58. Pingback: bdjobs sign in
  59. Pingback: Pakistani Suits
  60. Pingback: Pentair Ichlor
  61. Pingback: sexboer
  62. Pingback: geile sex filmpjes
  63. Pingback: porno files
  64. Pingback: gratis films
  65. Pingback: pornofilmpjes
  66. Pingback: liteblue login
  67. Pingback: liteblue
  68. Pingback: fingo vibrator
  69. Pingback: dildo
  70. Pingback: outdoors
  71. Pingback: male enhancement
  72. Pingback: hunter hundeseng
  73. Pingback: best nipples
  74. Pingback: beeg bbw
  75. Pingback: large sex toys
  76. Pingback: walmartone.com
  77. Pingback: onewalmartwire.com
  78. Pingback: Bluechew reviews
  79. Pingback: Don Juravin
  80. Pingback: type 1 diabetes
  81. Pingback: bdsm
  82. Pingback: bondage gear
  83. Pingback: gay male sex toys
  84. Pingback: clone my willy
  85. Pingback: podcast
  86. Pingback: judi online
  87. Pingback: best cock rings
  88. Pingback: home decor gifts
  89. Pingback: maxbet indonesia
  90. Pingback: Hotmail login
  91. Pingback: porn free
  92. Pingback: gay men underwear
  93. Pingback: gay man sex toys
  94. Pingback: Brøndby ultras
  95. Pingback: iraniporn
  96. Pingback: free xxx
  97. Pingback: gays and toys
  98. Pingback: mp3 download
  99. Pingback: one.walmart.com
  100. Pingback: websites
  101. Pingback: afrikaans
  102. Pingback: hotmail.com
  103. Pingback: gay sex toys
  104. Pingback: anal training toy
  105. Pingback: step sister xxx
  106. Pingback: Instagram Likes
  107. Pingback: penis pump
  108. Pingback: anal sex tips
  109. Pingback: NHDTB-308
  110. Pingback: 192.168 254
  111. Pingback: pegging toys
  112. Pingback: wand vibrator
  113. Pingback: xxx video download
  114. Pingback: btc to neteller
  115. Pingback: CAWD-003
  116. Pingback: glowing dildo
  117. Pingback: buttplug porn
  118. Pingback: guitar solo lick
  119. Pingback: credit card buy
  120. Pingback: Boston Car Service
  121. Pingback: Eweka
  122. Pingback: Minyak VCO
  123. Pingback: best blow job tips
  124. Pingback: walmart schedule
  125. Pingback: dank vapes
  126. Pingback: العاب حرب
  127. Pingback: Dankwoods
  128. Pingback: mario cartridges
  129. Pingback: Commercial Lawyer
  130. Pingback: Packwoods
  131. Pingback: sallyskitchen
  132. Pingback: online business
  133. Pingback: Baccarat Strategy
  134. Pingback: ABP 898
  135. Pingback: runelite
  136. Pingback: MEYD 525
  137. Pingback: Sexy girl clothing
  138. Pingback: hoops
  139. Pingback: Bitcoin news
  140. Pingback: Tally ERP 9 Crack
  141. Pingback: WalmartOne login
  142. Pingback: properties UK
  143. Pingback: bondage straps
  144. Pingback: nipple tweezer
  145. Pingback: Agen Judi Slot
  146. Pingback: IPX 369
  147. Pingback: gold investing
  148. Pingback: anal cleaning
  149. Pingback: SEO Vancouver
  150. Pingback: PPPD-792
  151. Pingback: GVG 941
  152. Pingback: Worli Escorts
  153. Pingback: vibrating bullet
  154. Pingback: play online games
  155. Pingback: free app download
  156. Pingback: gay anal toys
  157. Pingback: beginner strap on
  158. Pingback: milfgilf sex
  159. Pingback: crazy bulk dbal
  160. Pingback: GDHH-168
  161. Pingback: XVSR 499
  162. Pingback: basketball
  163. Pingback: sewa led
  164. Pingback: سكس
  165. Pingback: nipple suckers
  166. Pingback: big dildo review
  167. Pingback: hotmail login
  168. Pingback: nasstoys cock ring
  169. Pingback: wegmans connect
  170. Pingback: fake pussy
  171. Pingback: g spot women
  172. Pingback: we-b-tv.com
  173. Pingback: hs;br
  174. Pingback: tureckie_serialy
  175. Pingback: 00-tv.com
  176. Pingback: +1+
  177. Pingback: watch
  178. Pingback: ++++++
  179. Pingback: HD-720
  180. Pingback: 2020
  181. Pingback: Video
  182. Pingback: wwin-tv.com
  183. Pingback: EKDV-600
  184. Pingback: Vape near me
  185. Pingback: txxx
  186. Pingback: latest jobs update
  187. Pingback: thc vape oil
  188. Pingback: Thuy Wiseley
  189. Pingback: flexospy
  190. Pingback: ADN 227
  191. Pingback: liteblue login
  192. Pingback: best double dildo
  193. Pingback: penis ring review
  194. Pingback: love egg
  195. Pingback: bullet massager
  196. Pingback: Sky Go
  197. Pingback: engagement ring
  198. Pingback: zopiclone online
  199. Pingback: Best smm panel
  200. Pingback: anal massage
  201. Pingback: about blogging
  202. Pingback: Order marijuana
  203. Pingback: TEFL jobs
  204. Pingback: strapon dildo
  205. Pingback: Century Sankya
  206. Pingback: viagra
  207. Pingback: buy viagra
  208. Pingback: Honeywell
  209. Pingback: buy weeds online
  210. Pingback: suction cup dildo
  211. Pingback: wand vibrator
  212. Pingback: butterfly vibrator
  213. Pingback: pc app
  214. Pingback: uber referral code
  215. Pingback: cbd oil for sale
  216. Pingback: cbd for sale
  217. Pingback: cialis
  218. Pingback: butterfly sex toy
  219. Pingback: vibrator

Leave a Reply