php and .htaccess

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • shotokan99

    #1

    php and .htaccess

    hi,

    i wanted to check if that certain url is active or not, and ive used
    fopen, file_get_conten t()..however these functions didnt worked out
    because allow_url_open to our webserver is set to off.

    someone recommended that i can modify it or achieve the same goal
    through .htaccess. is this possible? how?

  • iktorn

    #2
    Re: php and .htaccess

    shotokan99 napisał(a):
    hi,
    >
    i wanted to check if that certain url is active or not, and ive used
    fopen, file_get_conten t()..however these functions didnt worked out
    because allow_url_open to our webserver is set to off.
    >
    someone recommended that i can modify it or achieve the same goal
    through .htaccess. is this possible? how?
    >
    You cannot set this value in .htaccess file.
    (but you can try put your own php.ini file in your directory)

    My advice - use curl library instead


    --
    Wiktor Walc

    Comment

    • shotokan99

      #3
      Re: php and .htaccess

      actually that's the major problem..becaus e my hosting co. wont allow
      me or won't edit the php.ini file. the main reason is we are on a
      shared server. regarding curl i did try it using this code:

      $curl_handle=cu rl_init();
      curl_setopt($cu rl_handle,CURLO PT_URL,'$xurl') ;
      curl_setopt($cu rl_handle,CURLO PT_CONNECTTIMEO UT,2);
      curl_setopt($cu rl_handle,CURLO PT_RETURNTRANSF ER,1);
      $buffer = curl_exec($curl _handle);
      curl_close($cur l_handle);
      if (empty($buffer) )
      {
      print "Sorry - no content.<p>";
      }
      else
      {
      echo "<h1>HERE IS CONTENT:</h1><hr$buffer";
      }

      still faild ;-)
      is there something wrong with my code or simply it doesnt support curl
      as well?
      is there another workaround to attain my goal? some folks suggested i
      try snoopy.

      Comment

      • Schraalhans Keukenmeester

        #4
        Re: php and .htaccess

        At Tue, 12 Jun 2007 19:43:59 -0700, shotokan99 let h(is|er) monkeys type:
        actually that's the major problem..becaus e my hosting co. wont allow
        me or won't edit the php.ini file. the main reason is we are on a
        shared server. regarding curl i did try it using this code:
        >
        $curl_handle=cu rl_init();
        curl_setopt($cu rl_handle,CURLO PT_URL,'$xurl') ;
        curl_setopt($cu rl_handle,CURLO PT_CONNECTTIMEO UT,2);
        curl_setopt($cu rl_handle,CURLO PT_RETURNTRANSF ER,1);
        $buffer = curl_exec($curl _handle);
        curl_close($cur l_handle);
        if (empty($buffer) )
        {
        print "Sorry - no content.<p>";
        }
        else
        {
        echo "<h1>HERE IS CONTENT:</h1><hr$buffer";
        }
        >
        still faild ;-)
        is there something wrong with my code or simply it doesnt support curl
        as well?
        is there another workaround to attain my goal? some folks suggested i
        try snoopy.
        If they've disabled all kinds of stuff, don't offer cURL suppport (quite
        commonly used I'd say) should you not consider switching hosts?
        Don't know any details about snoopy, can't help you there I'm afraid.

        Or is the failure of above code not caused by curl being unavailable?

        --
        Schraalhans Keukenmeester - schraalhans@the .Spamtrapexampl e.nl
        [Remove the lowercase part of Spamtrap to send me a message]

        "strcmp('apples ','oranges') < 0"

        Comment

        Working...