I'm working on a dashboard to monitor several stats for several of our in-house and client websites...I found a script to grab the Google PR, but it uses a form, which I want to replace. In the end, the data will be passed from a variable, but while I'm trying to get it working, it's just hard coded in. Here is the part of the code from the original script that contains the form:
I've gone through a lot of trial and error, and here is where I am, though it is obviously wrong:
Am I at least on the right track? I know it can be done...any idea how?
Code:
if ((!isset($_POST['url'])) && (!isset($_GET['url']))) { echo '<form action="" method="post"><input name="url" type="text"><input type="submit" name="Submit" value="Get Pagerank"></form>'; } if (isset($_REQUEST['url'])) { echo pagerank($_REQUEST['url']); }
I've gone through a lot of trial and error, and here is where I am, though it is obviously wrong:
Code:
$action = "";
$method = "POST";
$ref = "";
$data_array['url'] = "msn.com";
$data_array['Submit'] = "Get Pagerank";
$response = http($target=$action, $ref, $method, $data_array, EXCL_HEAD);
if ((!isset($_POST['url'])) && (!isset($_GET['url']))) {$response;}
if (isset($_REQUEST['url'])) { echo pagerank($_REQUEST['url']); }
Am I at least on the right track? I know it can be done...any idea how?