Results 1 to 6 of 6

Thread: Need Help - Include php file

  1. #1
    Join Date
    Sep 2008
    Posts
    6

    Default Need Help - Include php file

    Need help,

    i'm trying to use thumbalizr.com, to generate website thumbnails.

    they have one api, to check if thumbnail is in cache.

    Ho can tel me hown include the php file in template?

    this the php file:
    <?
    define ("_THUMBALIZR",1);

    require_once("config.inc.php"); // get config and functions
    $image=new thumbalizrRequest(); // create object
    $image->request("http://www.ebay.com"); // send request

    if ($image->headers['Status']=="OK" || $image->headers['Status']=="LOCAL") { // if picture is available
    $image->output(); //dump binary image data
    } else {
    print_r($image->headers); // print text result output - you can dump your own "queued" picture here
    }

    ?>

    In attachements are the other php files.

    thanks
    Attached Files Attached Files

  2. #2
    Join Date
    May 2007
    Location
    NJ, United States
    Posts
    1,651

    Default

    I'm just taking a stab at this, but I think your going to want this put in your Header.html file. Probably just after the part where it defines the CSS files.
    FSGDAG | IndexU Hosting | Owner
    Website | NiceCoder Script Hosting and More! | Web4URL is For Sale!
    Follow Us On Twitter | FaceBook Profile | YouTube Videos

  3. #3
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    <%php%>include ('http://www.yoururl.com/path/to/file'); <%/php%>

  4. #4
    Join Date
    May 2007
    Location
    NJ, United States
    Posts
    1,651

    Default

    Bruce...

    Just for my own knowledge.. I know what your saying about making an include file and calling it... That would definitely be a much cleaner way of doing it. But *could* you just insert it in the header file after defining the CSS files or that wouldn't work?!?!?
    FSGDAG | IndexU Hosting | Owner
    Website | NiceCoder Script Hosting and More! | Web4URL is For Sale!
    Follow Us On Twitter | FaceBook Profile | YouTube Videos

  5. #5
    Join Date
    Sep 2008
    Posts
    6

    Default

    Quote Originally Posted by Bruceper View Post
    <%php%>include ('http://www.yoururl.com/path/to/file'); <%/php%>
    Hi Bruce,

    I try that solution but don't work.
    <%php%>include ('http://www.yoururl.com/path/to/file'); <%/php%>
    I get this error:

    Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/.../domains/sitiopt.com/public_html/dir/templates_c/%%8A/8AA/8AAA3FA0%%detail_link.html.php on line 67

    Warning: include(http://www.sitiopt.com/dir/thumbs/index.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/.../domains/sitiopt.com/public_html/dir/templates_c/%%8A/8AA/8AAA3FA0%%detail_link.html.php on line 67

    Warning: include() [function.include]: Failed opening 'http://www.sitiopt.com/dir/thumbs/index.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/.../domains/sitiopt.com/public_html/dir/templates_c/%%8A/8AA/8AAA3FA0%%detail_link.html.php on line 67

    Can you help me?

    Thanks

  6. #6
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    Frank, yes that should work too. But quite often you want to keep the code clean, using an include does this perfectly.

    sitiopt The error you are getting is because your host is not allowing URL file access. Perhaps you could just use a relative URL like

    <%php%>include ('/home/username/public_html/path/to/file'); <%/php%>

    But that may not work either. Your best bet is to talk to your host and ask for URL file access to be enabled.

Similar Threads

  1. how to include xml file?
    By vsevedko in forum v5.x
    Replies: 2
    Last Post: 10-17-2007, 02:27 PM
  2. How to include a [php] or [html] file in a [.tpl] file
    By althahabi in forum Website development, hosting and promotion
    Replies: 3
    Last Post: 07-04-2006, 11:21 PM
  3. PHP include
    By Datentechnik in forum Tutorials, Hints & Tips
    Replies: 3
    Last Post: 06-14-2006, 08:18 PM
  4. Replies: 5
    Last Post: 01-01-2006, 05:11 PM
  5. Include file
    By lexpression in forum v5.x
    Replies: 11
    Last Post: 08-30-2005, 06:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •