Login |

2005 Members Only Area

<?php $year = "2005"; /* User submitted login form */ if(isset($_POST['member_user'])){ $user = $_POST['member_user']; $pass = $_POST['member_pass']; #print "user: $user"; #print "pass: $pass"; $ch = curl_init("http://www.draftinsiders.com/members/$year/short.shtml"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_USERPWD, "$user:$pass"); #curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $links = curl_exec($ch); curl_close($ch); #print $links; # add user:pass to each of the links so user doesn't have to login again $auth_links = str_replace("http://www.draftinsiders.com/members/", "http://www.draftinsiders.com/members/getfile.php?user=$user&pass=$pass&file=", $links); #$auth_links = $links; #print "replaced...br>"; print $auth_links; } else{ print " $year Member Login "; /** * User not logged in, display the login form. */ /* this would make php display an HTTP auth form with "-uid" added to realm if (!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm="DraftInsiders"'); header('HTTP/1.0 401 Unauthorized'); echo 'Please press reload and login to access the members section'; exit; } else { echo " Hello {$_SERVER['PHP_AUTH_USER']}. "; echo " You entered {$_SERVER['PHP_AUTH_PW']} as your password. "; } */ ?> Username: Password: <? } ?>