PDA

View Full Version : php help!




Furgster
Jun 21, 2007, 07:34 PM
i am not sure what goes inside of the parenthesis in $ch = curl_init(); on line 8 or 9, any help would be great thanks! :D

<?

require "inc/global.php";

if ($_POST["username"] && $_POST["password"]) {
$_SESSION["username"] = $_POST["username"];
$url = get_url(false, false) ."session.php?username=". urlencode(base64_encode($_POST["username"])) ."&password=". urlencode(base64_encode($_POST["password"])) ."&sessionId=". session_id();
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_TIMEOUT, 1);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_exec($ch);
curl_close($ch);
$loggedIn = true;
usleep(3000000);
header("Location: index.php");
exit();
}



SC68Cal
Jun 21, 2007, 07:50 PM
Hmmm. Never used curl before in php. Try setting the $url to a hard link and see if it gives you a problem. I couldn't find any documentation on the get_url function

pengu
Jun 21, 2007, 08:11 PM
Description
resource curl_init ( [string $url] )

Initializes a new session and return a cURL handle for use with the curl_setopt(), curl_exec(), and curl_close() functions.
Parameters

url

If provided, the CURLOPT_URL option will be set to its value. You can manually set this using the curl_setopt() function.

you dont have to set anything. you either specify $url OR you use curl_setopt to set the URL, as you have done.

Furgster
Jun 21, 2007, 08:18 PM
ok, i think i figured it out, thanks!