Script not accepting parameters via HTTP WebRequest
Posted: Mon Jul 12, 2010 5:39 am
Hi,
I'm a newbie working on a PHP script to retrieve information from a mySQL database. The script works fine when executed from the Browser with the following URL format:
http://www.myDomain.com/QueryOrderTable ... abase=myDB
But, when I attempt to call it programmatically using HTTP WebRequest (local .NET app) I get an 'undefined index' error message for all four parameters that I am attempting to pass in:
<b>Notice</b>: Undefined index: server in... (partial error message)
If I 'hard-code' these values into the script (rather than using $server = $_GET['server']) everything executes properly and I get my content back programmatically via the RequestStream.
The following is the very top part of my script that utilizes the $_GET statements to assign variables:
So, in a nutshell, I'm not able to effectively pass in my parameter values. Any help/direction would be greatly appreciated.
Thanks,
Scott
I'm a newbie working on a PHP script to retrieve information from a mySQL database. The script works fine when executed from the Browser with the following URL format:
http://www.myDomain.com/QueryOrderTable ... abase=myDB
But, when I attempt to call it programmatically using HTTP WebRequest (local .NET app) I get an 'undefined index' error message for all four parameters that I am attempting to pass in:
<b>Notice</b>: Undefined index: server in... (partial error message)
If I 'hard-code' these values into the script (rather than using $server = $_GET['server']) everything executes properly and I get my content back programmatically via the RequestStream.
The following is the very top part of my script that utilizes the $_GET statements to assign variables:
Code: Select all
<?php
$server = $_GET['server'];
$username = $_GET['username'];
$password = $_GET['password'];
$database = $_GET['database'];
$conn = mysql_connect($server, $username, $password);
Thanks,
Scott