troubleshooting Question

PHP to accept POST data from 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 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 " ".  

 $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 = '' and ProgPCcode = '647A2C9A'") or die( "Unable to select database");
while($row = mysql_fetch_array($result))
   echo $row['name'] . "^" . $row['UserCrd'] . "^" . $row['ProgPCcode'];


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

thank you


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