Hello all community,
Here’s how I do to send data in my database with the GET method. But it does not add.
As soon as you have an idea?
C# CODE
namespace Wifi
{
public partial class Program
{
void ProgramStarted()
{
Debug.Print("Program Started");
if (Startwifi())
{
ReqGet();
}
}
bool Startwifi()
{
if (wifi_RS21 != null)
{
if (wifi_RS21.Interface.IsOpen)
{
wifi_RS21.Interface.Disconnect();
}
}
string SSID = "SGC";
string password = "TechCFPT_2012";
bool conn = false;
wifi_RS21.Interface.Open();
NetworkInterfaceExtension.AssignNetworkingStackTo(wifi_RS21.Interface);
WiFiNetworkInfo[] infos = wifi_RS21.Interface.Scan();
foreach (WiFiNetworkInfo info in infos)
{
if (info.SSID == SSID)
{
wifi_RS21.Interface.NetworkInterface.EnableDhcp();
wifi_RS21.Interface.Join(info, password);
Debug.Print(SSID + " Connected");
conn = true;
break;
}
else
{
conn = true;
Debug.Print(SSID + " not found");
}
}
return conn;
}
void ReqGet()
{
string finalUri = "http://albentrix.com/fez.php?value=20";
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(finalUri);
HttpWebResponse rsponse = (HttpWebResponse)request.GetResponse();
Debug.Print("ReqGet OK");
}
}
}
PHP CODE
<?php
require 'id.php';
mysql_connect($dbhost, $dbuser, $dbpassword) or die(mysql_error());
mysql_select_db("134387_ecole") or die(mysql_error());
mysql_query("INSERT INTO fez (current) VALUES (" .$_GET['value']. ")") or die(mysql_error());
?>