我通过这种形式从本地电脑向服务器发送数据:
<form method="post" action="proses.php">
<input type="hidden" name="id"><br>
Tanggal <input type="text" name="tgl"><br>
Pesan <textarea name="isi" cols="29" rows="5"></textarea> <br>
Nomor Hp <input type="text" name="nope"><br>
<input type="submit" name="submit" value="Submit"> </form>
这是代码proses.php
<?php
$id = $_POST['id'];
$tgl = $_POST['tgl'];
$isi = $_POST['isi']; $nope= $_POST['nope'];
$curlHandle = curl_init();
curl_setopt($curlHandle, CURLOPT_URL, 'http://adibiken.com/SEM/kir.php');
curl_setopt($curlHandle, CURLOPT_POSTFIELDS, "id=".$id."&tgl=".$tgl."&isi=".$isi."&nope=".$nope);
curl_setopt($curlHandle, CURLOPT_HEADER, 0);
curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curlHandle, CURLOPT_TIMEOUT,30);
curl_setopt($curlHandle, CURLOPT_POST, 1);
curl_exec($curlHandle);
curl_close($curlHandle); ?>
这是 kir.php 的代码(在服务器中)
<?php $id = $_POST['id']; $tgl = $_POST['tgl']; $isi = $_POST['isi']; $nope = $_POST['nope'];
$quer = "INSERT INTO `adibiken_sem`.`inbox` (`id`,`tgl` ,`isi` ,`nope`)VALUES ( '$id','$tgl', '$isi', '$nope')";
mysql_query($quer); ?>
问题:数据已成功发送数据库服务器中的空记录... 需要帮助