| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Account Closed Join Date: Jul 2005
Posts: 573
![]() ![]() ![]() ![]() ![]() ![]() | Help Converting fopen to curl! need help to convert 2 pieces of code Code: function cdb_build_links($console, $letter, $cdb_link_int) {
Global $path_to_backend, $password, $username;
$cdb_build_path = "$path_to_backend" . "client=2&console=" . urlencode($console) . "&letter=".urlencode($letter)."&username=".urlencode($username)."&password=".urlencode($password);
$cdb_file = fopen ("$cdb_build_path", "r");
if (!$cdb_file) {
return "<p>Unable to connect to cheats database.\n";
exit;
}
while (!feof ($cdb_file)) {
$cdb_buffer .= fgets ($cdb_file, 1024);
}
if (!strstr($cdb_buffer, '/||n||/') === 0) {
return $cdb_buffer;
} ????: NamePros.com http://www.namepros.com/programming/254348-help-converting-fopen-to-curl.html and this also i get a url file-acess disabled in server message Code: <? include($urlBase.'/Train/_module.php');?> thanks a ton! |
| |
| | #2 (permalink) |
| Buy my domains. Join Date: Feb 2006
Posts: 2,796
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | class.curl.php PHP Code: Code: include('class.curl.php');
function cdb_build_links($console, $letter, $cdb_link_int) {
Global $path_to_backend, $password, $username;
$cdb_build_path = "$path_to_backend" . "client=2&console=" . urlencode($console) . "&letter=".urlencode($letter)."&username=".urlencode($username)."&password=".urlencode($password);
$cbd_file = $curl->get($cbd_build_path);
if (!strstr($cdb_buffer, '/||n||/') === 0) {
return $cdb_buffer;
} ????: NamePros.com http://www.namepros.com/showthread.php?t=254348 (Also: I don't like working with functions that much due to the private variables and other things like that. If you get an error with the $curl->get line, add global $curl; somewhere before it.) |
| |