1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Site Search With Google Errors

Discussion in 'Products & Tools' started by j_mac, Mar 31, 2004.

  1. #1
    Hi I'm trying to implement your search function to my website but I keep getting this error output when I run it:

    Warning : feof(): supplied argument is not a valid File-Handle resource in /w2/h/www.hannonfoundation.org/html/results.php on line 39

    Warning : fclose(): supplied argument is not a valid File-Handle resource in /w2/h/www.hannonfoundation.org/html/results.php on line 42

    Parse error : parse error in /w2/h/www.hannonfoundation.org/html/results.php(44) : eval()'d code on line 1

    I do have a google key which I entered into results.php and I have site set to "". I also tried it with my site name and got the same results. Do you have any idea what may be wrong?
     
    j_mac, Mar 31, 2004 IP
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    On the line that has: $handle = @fopen (... remove the @ from the command, and it will return to your browser any errors it may have encountered.

    - Shawn
     
    digitalpoint, Mar 31, 2004 IP
  3. j_mac

    j_mac Guest

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    This is what it says now:


    Warning: fopen("http://search.digitalpoint.com/?q=hannon&key=***************************&site=&start=0", "r") - No such file or directory in /w2/h/www.hannonfoundation.org/html/results.php on line 38

    Warning: feof(): supplied argument is not a valid File-Handle resource in /w2/h/www.hannonfoundation.org/html/results.php on line 39

    Warning: fclose(): supplied argument is not a valid File-Handle resource in /w2/h/www.hannonfoundation.org/html/results.php on line 42
     
    j_mac, Mar 31, 2004 IP
  4. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #4
    digitalpoint, Mar 31, 2004 IP
  5. j_mac

    j_mac Guest

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    j_mac, Mar 31, 2004 IP
  6. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #6
    Hmmmm... Try using the default results.php file and see if it works...

    - Shawn
     
    digitalpoint, Mar 31, 2004 IP
  7. j_mac

    j_mac Guest

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Yeah, i did that and still nothing. When I look at the source for the page that is generated after the search I notice that it is only printing the header file info. There is no code beyond that. Another strange thing is that if I upload the original header and footer that came with the download I get an error message that says that the browser couldn't load any data from that location. Then when I upload the header and footer that I created for my site, it works again. I have attached text files with the header, footer, and results (with my google key removed) files. If you want to see the test search it's here http://209.151.246.229/test_search.html Also if you want to see the info for my php install it's here http://209.151.246.229/version.php
     

    Attached Files:

    j_mac, Apr 1, 2004 IP
  8. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #8
    Hmmmm... I really have no idea, you may want to check the httpd error log to see if it logs any errors on your server. I setup those 3 files on this end (no changes other than the extension), and they worked fine (of course it said invalid authorization key).

    It seems like your end completely drops out after the header.php include. Try removing that line from results.php and see if it works without the include for some reason.

    - Shawn
     
    digitalpoint, Apr 1, 2004 IP
  9. j_mac

    j_mac Guest

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Hmmm. Starnge. When I take out all the includes, I get that same error message that says that the browser couldn't load any data from that location. But when I leave the includes in and take everything else out, the entire template page loads (header and footer). So it seems that something in the code that goes between the header and footer includes is stopping the entire php script from running. Is there anything else that needs to be activated in the php setup that would prevent it from working? I don't know if you looked at my server setup, but I am running php 4.2.3 on a unix server (I believe it is apache 1.3.27).
     
    j_mac, Apr 1, 2004 IP
  10. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #10
    Well the inability to load data from that location is the previous problem I mentioned (where you wold need to have URL support for fopen() in your version of PHP). There is nothing wrong with the files though, as I tried yours on this end, and they work. Strange it drops the script out on the fopen() error when there is an include though.

    - Shawn
     
    digitalpoint, Apr 1, 2004 IP
  11. j_mac

    j_mac Guest

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Is there any way I could get the phpinfo() for the server that you ran the php search file on that worked? Or could you run php diff comparing your server and mine? Thech support for the hosting company i'm using can't seem to figure it out. That is what they reccomended asking for.
     
    j_mac, Apr 1, 2004 IP
  12. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #12
    See attachment...

    - Shawn
     
    digitalpoint, Apr 1, 2004 IP
  13. j_mac

    j_mac Guest

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    is there anything in the code on your side that would be version dependent of the version of php that i am running on my machine? or could there be some sort of server setting on my server that could be blocking me from sending data to http://search.digitalpoint.com?

    sorry to keep posting, but this frustrating because it works on the little web server i have on my machine at home no problem.
     
    j_mac, Apr 1, 2004 IP
  14. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #14
    Nope... there is nothing on this end that makes it PHP version dependent.

    It just needs support for URLs within fopen() (which is on by default).

    - Shawn
     
    digitalpoint, Apr 1, 2004 IP