I am trying to find out how I can consume a PHP Webservice as seen below. I THINK that I need to somehow open the url and send post variables, then parse the xml response and pull out the info I need. But I can not figure out how... Should I be looking at HttpWebRequest class?
Any help is greatly appreciated.
http://www.dreaminco...ure-user-login/
<?php
session_start();
try {
$dbh = new PDO("mysql:host=mysql.fake.net;dbname=crlogin",'username', 'password');
} catch (PDOException $e)
{
echo $e->getMessage();
}
if ($_POST['user'] != null and $_POST['user'] != "" and $_POST['password'] != null and $_POST['password'] != "")
{
$username = $_POST['user'];
$password = $_POST['password'];
$sth = $dbh->query("SELECT COUNT(*) FROM users WHERE username='$username' and password='$password'");
$result = $sth->fetchAll(PDO::FETCH_OBJ);
$sth1 = $dbh->query("SELECT * FROM tblItem");
$result1 = $sth1->fetchAll(PDO::FETCH_OBJ);
switch ($result[0]->{'COUNT(*)'})
{
case 0;
echo 'Invalid username or password';
break;
case 1;
$_SESSION['x'] = 'success';
print_r($result1);
echo "it worked!";
break;
}
//echo $result[0]->{'COUNT(*)'};
//print_r($result);
}
?>

New Topic/Question
Reply


MultiQuote


|