Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Furgster

macrumors 6502
Original poster
Jun 16, 2007
260
1
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

PHP:
<?

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

macrumors 68000
Feb 23, 2006
1,642
0
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

macrumors 6502a
Mar 20, 2005
575
0
Diddily Daddily...
http://www.php.net/manual/en/function.curl-init.php said:
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.