php help!

Discussion in 'Mac Programming' started by Furgster, Jun 21, 2007.

  1. macrumors 6502

    Furgster

    Joined:
    Jun 16, 2007
    #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(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();
    }
     
  2. macrumors 68000

    Joined:
    Feb 23, 2006
    #2
    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
     
  3. macrumors 6502a

    Joined:
    Mar 20, 2005
    Location:
    Diddily Daddily...
    #3
    you dont have to set anything. you either specify $url OR you use curl_setopt to set the URL, as you have done.
     
  4. thread starter macrumors 6502

    Furgster

    Joined:
    Jun 16, 2007
    #4
    ok, i think i figured it out, thanks!
     

Share This Page