Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6103949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:47:12+00:00 2026-05-23T13:47:12+00:00

My host has allow_url_fopen disabled and they will not enable it for me. I

  • 0

My host has allow_url_fopen disabled and they will not enable it for me. I need the following code to work for a WordPress plugin. Can someone please give me pointers as to how to convert this code to cURL?

else:
    $results = $wpdb->get_results($wpdb->prepare("SELECT mcd_id FROM mcd_cl_coupons WHERE coupon_list_id = %d AND created_by = 'mcd'", array($coupon_list_id)));
    $mcd_id = ''; foreach($results as $row): $mcd_id .= '-' . $row->mcd_id; endforeach; $mcd_id = substr($mcd_id, 1);
    if($mcd_id): 
        $options = get_option('mcd_list');
        $token = $options['api_key'];
        $xml_file = 'http://www.mycoupondatabase.com/api/coupons-xml.php?token=' . $token . '&id_string=' . $mcd_id;
        $xml = simplexml_load_file($xml_file);
    endif;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:47:13+00:00Added an answer on May 23, 2026 at 1:47 pm

    WordPress has a function build in to request a file called wp_remote_get:

        $xml_file = 'http://www.mycoupondatabase.com/api/coupons-xml.php?token=' . $token . '&id_string=' . $mcd_id;
        $xml_data = wp_remote_get($xml_file);
        $xml = simplexml_load_string($xml_data['body']);
    

    That function internally makes use of the HTTP abstraction wordpress comes with which normally figures out the best way to do HTTP requests for the system it’s running on. So it will use cUrl if everything else is restricted on your host.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

PHP's parse_url() has a host field, which includes the full host. I'm looking for
I host a project on CodePlex, but a bunch (200+) files need to have
How can I host a ( .Net, Java, VB6, MFC, etc ) application in
I need to host a WCF service in IIS that exposes a wsHttpBinding. That
I need to host and run managed controls inside of a purely unmanaged C++
My web host has a process killer which terminates any process running longer than
Can you host demos of open source apps online, similar to how http://php.opensourcecms.com/ does
We host the .NET runtime as part of a Win32 program, and lately it
We host a C++ based WebServices application in IIS and we're finding that when
I would like to host a Maven repository for a framework we're working on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.