Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jun 21, 2007, 07:34 PM   #1
Furgster
macrumors 6502
 
Join Date: Jun 2007
php help!

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!

PHP Code:
<?

require "inc/global.php";

if (
$_POST["username"] && $_POST["password"]) {
    
$_SESSION["username"] = $_POST["username"];
    
$url get_url(falsefalse) ."session.php?username="urlencode(base64_encode($_POST["username"])) ."&password="urlencode(base64_encode($_POST["password"])) ."&sessionId="session_id();
    
$ch curl_init();
    
curl_setopt($chCURLOPT_URL$url);
    
curl_setopt($chCURLOPT_CONNECTTIMEOUT30);
    
curl_setopt($chCURLOPT_TIMEOUT1);
    
curl_setopt($chCURLOPT_HEADERfalse);
    
curl_exec($ch);
    
curl_close($ch);
    
$loggedIn true;
    
usleep(3000000);
    
header("Location: index.php");
    exit();
}
Furgster is offline   0 Reply With Quote
Old Jun 21, 2007, 07:50 PM   #2
SC68Cal
macrumors 68000
 
Join Date: Feb 2006
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
SC68Cal is offline   0 Reply With Quote
Old Jun 21, 2007, 08:11 PM   #3
pengu
Banned
 
Join Date: Mar 2005
Location: Diddily Daddily...
Quote:
Originally Posted by http://www.php.net/manual/en/function.curl-init.php
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.
pengu is offline   0 Reply With Quote
Old Jun 21, 2007, 08:18 PM   #4
Furgster
Thread Starter
macrumors 6502
 
Join Date: Jun 2007
ok, i think i figured it out, thanks!
Furgster is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
[php] - php problems os x mountain lion 10.8.2 cakas6933 OS X 10.8 Mountain Lion 4 Jun 10, 2014 08:08 AM
PHP - stream_context_create larswik Mac Programming 13 Jun 28, 2012 10:00 PM
mylove.php? Help! :/ postingq Mac Basics and Help 3 Jun 27, 2012 12:10 PM
How many frameworks available in PHP? ifuturzcom iPhone 0 Jun 4, 2012 02:24 AM

Forum Jump

All times are GMT -5. The time now is 04:16 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC