troubleshooting Question

PHP to accept POST data from VB.net webrequest

Avatar of MichMat
MichMat asked on
PHP.NET Programming
3 Comments1 Solution906 ViewsLast Modified:
I have 'constructed' the following code, from all over the internet, it is meant to collect 2 pieces of information POSTed to it from a VB.net webrequest identifing a user and then returning some information about that user.

The code works when I specificaly type in the variables into the select * statement
I cant seam to get it to accept variables from a post. I would really appreciate someones help in altering the code to accept 2 variables (email address and ProgPCcode) and change the select string to utalise those variables to create a dynamic string. I have tried and when I did it the PHP was returning " ".  

<?php
$user="someuser";
$password="correctpassword";
$database="databasename";
 $con = mysql_connect(localhost,$user,$password);
 if (!$con)
   {
   die('Could not connect: ' . mysql_error());
   }
 
@mysql_select_db($database) or die( "Unable to select database");

$result = mysql_query("SELECT * FROM table WHERE email = 'user@comewhere.com' and ProgPCcode = '647A2C9A'") or die( "Unable to select database");
 
while($row = mysql_fetch_array($result))
   {
   echo $row['name'] . "^" . $row['UserCrd'] . "^" . $row['ProgPCcode'];
   }

mysql_close($con);
 ?> 


I have also removed the real credentials for the database for security.

thank you

Michal
ASKER CERTIFIED SOLUTION
Member_2_4694817

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros