I've written this code to link to an affiliate program on the Net which uses CGI to track clicks:
<?php
$fd = fopen ("http://refer.ccbill.com/cgi-bin/clicks.cgi?CA=xxxxx&PA=xxxx&HTML=gotothispage.html", "r");
$query_string = "astring";
$buffer = "";
$newpage = "";
while (!feof ($fd)) {
$buffer = $buffer . fgets ($fd,4096);
}
fclose ($fd);
$newpage = str_replace("astring", "bstring", $buffer);
echo $newpage;
?>
Basically, my question is: Is this CGI call I made using fopen going to execute properly? The rest of the code just uses the page taken to AFTER the click is registered and changes some text on the page. All I want to know is if such a use of fopen will work, or if you need to use 'include' or header redirect for cgi calls...