Results 1 to 12 of 12
  1. #1
    Newbie
    Join Date
    August 19th, 2008
    Posts
    6
    Using GoldCan & Curl
    I am trying to use a GoldCan script on another one of my sites and I get a blank page. My webhost (Webstrike) says I cannot include a remote file within your PHP code. I also cannot use the "readfile" option! They told me the alternative however is to use CURL. I have looked at the curl online manual and have no idea how to use it with GoldCan. Any help would be appreciated.

  2. #2
    notary sojac Herb ԿԬ's Avatar
    Join Date
    January 18th, 2005
    Location
    Central/Western NY State
    Posts
    7,741
    Lightbulb
    here's a solution I used for a different problem, your mileage may vary:

    substitute the SID number as given in the GC code

    <?php

    $URL = "http://si.goldencan.com/GetData.aspx...xxxxxxxxxxxxxx;"

    $PageURL = urlencode($_SERVER['SCRIPT_NAME'].'?'.$_SERVER['QUERY_STRING']);

    $IPAddress = urlencode($_SERVER['REMOTE_ADDR']);

    $UserAgent = urlencode($_SERVER['HTTP_USER_AGENT']);

    $goldencanurl=$URL.'&PageURL='.$PageURL.'&IPAddress='.$IPAddress.'&UserAgent='.$UserAgent;

    // create a new CURL resource

    $ch = curl_init();

    // set URL and other appropriate options

    curl_setopt($ch, CURLOPT_URL, "$goldencanurl");

    curl_setopt($ch, CURLOPT_HEADER, false);

    // grab URL and pass it to the browser

    curl_exec($ch);

    // close CURL resource, and free up system resources

    curl_close($ch);

    ?>

  3. #3
    ABW Ambassador Caseyfern's Avatar
    Join Date
    May 18th, 2007
    Location
    Yes, sadly I'm in California
    Posts
    518
    Herb, thank you! That might just solve the 8-month problem I've been having with GoldenCAN. Appreciate the post.

  4. #4
    notary sojac Herb ԿԬ's Avatar
    Join Date
    January 18th, 2005
    Location
    Central/Western NY State
    Posts
    7,741
    Talking
    Quote Originally Posted by Caseyfern
    Herb, thank you! That might just solve the 8-month problem I've been having with GoldenCAN. Appreciate the post.
    I used it for a while because my php settings in the servers wouldn't allow allow_url_fopen.

    If you ever run into Oscar (who hasn't posted here in a while) thank her for the code (especially if it works) because she gave it to me.

  5. #5
    notary sojac Herb ԿԬ's Avatar
    Join Date
    January 18th, 2005
    Location
    Central/Western NY State
    Posts
    7,741
    just noticed the forum software confuses part of the url in that:


    it is
    GetData.aspx?SID=xxxxxxxxxxx

  6. #6
    ABW Veteran Mr. Sal's Avatar
    Join Date
    January 18th, 2005
    Posts
    6,795
    Quote Originally Posted by Herb ԿԬ
    I used it for a while because my php settings in the servers wouldn't allow allow_url_fopen.

    If you ever run into Oscar (who hasn't posted here in a while) thank her for the code (especially if it works) because she gave it to me.
    Come on Herb, two times?

    Oscar is a male name!

  7. #7
    notary sojac Herb ԿԬ's Avatar
    Join Date
    January 18th, 2005
    Location
    Central/Western NY State
    Posts
    7,741
    Quote Originally Posted by Mr. Sal
    Come on Herb, two times?

    Oscar is a male name!
    No, in this case oscar is a knickname the person uses on ABW.

  8. #8
    ABW Ambassador writerguy's Avatar
    Join Date
    January 17th, 2005
    Location
    Springfield, Missouri, USA
    Posts
    3,248
    Quote Originally Posted by Herb ԿԬ
    No, in this case oscar is a knickname the person uses on ABW.
    Yeah, that's true. She customized a script for me a couple of years ago. She's really good at what she does and sells a number of ready-made datafeed scripts and templates.

    I thought I was the only one who noticed Oscar hasn't been around here for awhile.
    Generate more fake news.

  9. #9
    ABW Veteran Mr. Sal's Avatar
    Join Date
    January 18th, 2005
    Posts
    6,795
    Red face
    Quote Originally Posted by Herb ԿԬ
    No, in this case oscar is a knickname the person uses on ABW.
    Thanks for the clarifications Herb.

    I did it again .

    I just took a trip back to a 03' post, and now I see that you're right!

  10. #10
    Newbie
    Join Date
    August 19th, 2008
    Posts
    6
    I get this error when I use the crl scipt mentioned above

    Parse error: parse error, unexpected T_VARIABLE in d:\websites\gatormaniacscom\test.php on line 14

  11. #11
    notary sojac Herb ԿԬ's Avatar
    Join Date
    January 18th, 2005
    Location
    Central/Western NY State
    Posts
    7,741
    Lightbulb
    just googling around I find mention of either a curly brace missing or a space between <? and php


    other than that, if that is fixed we still don't know if it is going to work for you but I hope it does

  12. #12
    All Around Web Guy Cursal's Avatar
    Join Date
    January 18th, 2005
    Posts
    829
    Asif

    This may be another addition for FAQ on GC site.
    Oregon Publishing: Web Development, Graphic Design, Domains & Marketing
    Deluxe Banners Bartender's Guide Cooking Jobs

  13. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. List Managers & cURL
    By Hyphen in forum Building Traffic, Newsletters & Advertising
    Replies: 2
    Last Post: January 21st, 2011, 10:13 AM
  2. CURL PHP Option for GoldenCAN?
    By Caseyfern in forum GoldenCAN
    Replies: 0
    Last Post: May 27th, 2008, 01:29 AM
  3. cURL & PHP to email a webpage
    By Code Monkey in forum Programming / Datafeeds / Tools
    Replies: 1
    Last Post: November 6th, 2007, 03:31 PM

Posting Permissions

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