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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
PHP Help digital1 Mac Programming 4 Jun 5, 2006 05:18 PM
PHP help jtalerico Mac Programming 32 Feb 2, 2006 07:21 AM
PHP help, sending variable to next page?? varmit Web Design and Development (archive) 8 Apr 17, 2005 05:25 PM
Need PHP Help - Passing a : From Flash Cooknn Web Design and Development (archive) 3 Mar 17, 2005 10:42 AM
MySQL & PHP Help! kaizer Mac Help/Tips 7 May 24, 2003 11:47 PM


All times are GMT -5. The time now is 11:57 AM.

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

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