Save Data Menggunakan Vfpconnection

kali ini saya lagi mood buka buka vfp lagi, langsung aja nih tentang vfpconnection ke Php,script di foxpro


SET LIBRARY TO (LOCFILE("vfpconnection.fll","FLL"))
LOCAL ARRAY aryPost(4,2) &&(nrow,nColumn)
aryPost(1,1) = "nim" && name
aryPost(1,2) = "011" && value
aryPost(2,1) = "nama" && name
aryPost(2,2) = "aku" && value
aryPost(3,1) = "jkel" && name
aryPost(3,2) = "l" && value
aryPost(4,1) = "tglmasuk" && name
aryPost(4,2) = "2001-12-12" && value
?HttpPost("http://localhost:81/login/simpansiswa.php", @aryPost, "", "MyTrace()")
SET LIBRARY TO

Function MyTrace() && Callback from the FLL - used to provide a detailed trace of the operation
***********************
*!* You can create your own function, procedure or method to handle this and name it whatever you want.
*!* The nTraceDataType and cTraceData are private variables created on-the-fly by the FLL
#Define TYPE_TEXT 0
#Define TYPE_HEADER_IN 1
#Define TYPE_HEADER_OUT 2
#Define TYPE_DATA_IN 3
#Define TYPE_DATA_OUT 4
#Define TYPE_SSL_DATA_IN 5
#Define TYPE_SSL_DATA_OUT 6
#Define TYPE_END 7
?Icase(m.nTraceDataType = TYPE_TEXT, "STATUS:", ;
m.nTraceDataType = TYPE_HEADER_IN, "<RECV HEADER: ", ;
m.nTraceDataType = TYPE_HEADER_OUT, ">SEND HEADER: ", ;
m.nTraceDataType = TYPE_DATA_IN, "<RECV DATA: ", ;
m.nTraceDataType = TYPE_DATA_OUT, ">SEND DATA: ", ;
m.nTraceDataType = TYPE_SSL_DATA_IN, "<RECV SSL DATA: ", ;
m.nTraceDataType = TYPE_SSL_DATA_OUT, ">SEND SSL DATA: ", ;
m.nTraceDataType = TYPE_END, "END: ", "UNKNOWN: ")
??m.cTraceData
Strtofile(m.cTraceData,'c:\temp.txt',1)
ENDFUNC

script Php

</pre>
<?php
$db_server="localhost";
$db_database="dataku";
$db_username="root";
$db_password="toor";

try{
$conn=new PDO("mysql:host=$db_server;dbname=$db_database",$db_username,$db_password);
}
catch(PDOException $aError){
echo " Not Connected :".$aError->Getmessage();
}

$nim=$_POST['nim'];
$nama=$_POST['nama'];
$jkel=$_POST['jkel'];
$tglmasuk=$_POST['tglmasuk'];
$sql="insert into siswa(nim,nama,jkel,tglmasuk)values (:nim,:nama,:jkel,:tglmasuk)";
$stmt=$conn->prepare($sql);
$stmt->bindparam(":nim",$nim);
$stmt->bindparam(":nama",$nama);
$stmt->bindparam(":jkel",$jkel);
$stmt->bindparam(":tglmasuk",$tglmasuk);
$stmt->execute();

?>
<pre>

naa untuk download silahkan https://www.mediafire.com/?dah3yx0gnbbx3s6

 

sumber lengkap pemakaiannya disini http://www.sweetpotatosoftware.com/spsblog/2008/12/05/VFPConnectionUpdateHTTPPostFTPCommandsAndMore.aspx

 

 

2 Balasan ke Save Data Menggunakan Vfpconnection

  1. Romil Amali mengatakan:

    Newbie#
    gan saya mau nanya ada gak tutorial untuk menampilkan aplikasi foxpro di web?maksudnya foxpro berbasis web…terima kasih…salam sukses!!!

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: