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

  • SEARCH
  • Home
  • 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 8257255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:08:13+00:00 2026-06-08T02:08:13+00:00

My problem is the following, I have an EmailReports.php on my server which I

  • 0

My problem is the following, I have an EmailReports.php on my server which I use to send mails like EmailReports.php?who=some@gmail.com&what=123456.pdf

I can NOT modify EmailReports.php since that belongs to a diferent project and it instantly sends an email and has been aproved by QA team and all that stuff.

Now, on a diferent LookReports.php I need to offer a service like “Send me the reports I reviewed” which manually can be easily executed as just calling EmailReports.php, the question is, how can I do it by PHP code? so it calls the other PHP automatically.

I have tried without success:

$stuff = http_get("http://...<the url here>");

and

$stuff =  file_get_contents("http://...<the url here>");

I was thinking on import the EmailReports.php but does not seem right since there is no functions, it automatically sends an email.

Or I could replicate EmailReports.php code but that is against the QA policy since extra tests would be needed.

Could you guide me a bit?

Thanks in advance.

  • 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-06-08T02:08:15+00:00Added an answer on June 8, 2026 at 2:08 am

    You could use a Curl request to retrieve information (xml/html/json/etc) from any website.

    What is CURL? (short answer)

    PHP has a very powerful library of calls that are specifically designed to safely fetch data from remote sites. It’s called CURL.

    Source : PHP, CURL, and YOU!

    Example of Curl function in PHP

    /* gets the data from a URL */
    function get_data($url)
    {
     if(function_exists('curl_init')){
     $ch = curl_init();
     $timeout = 5;
     curl_setopt($ch,CURLOPT_URL,$url);
     curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
     curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
     $data = curl_exec($ch);
     curl_close($ch);
     return $data;
     } else 'curl is not available, please install';
     }
    

    Source : Download a URL’s Content Using PHP cURL

    Alternatively, you could do what you are currently doing with file_get_contents but many hosts don’t allow this. (Walsh, 2007)

    Usage

    <?php
    $mydata = get_data('http://www.google.co.nz');
    echo '<pre>';
    print_r($mydata); //display the contents in $mydata as preformatted text
    echo '</pre>';
    ?>
    

    Try to test it, with other websites because more often than not google will return a 404 request (this is to be expected), after a curl has been executed.

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

Sidebar

Related Questions

Hi i have following Problem. I write a Mediawiki Extension where i need some
I have the following problem, from c++ I send huge string[] to java. huge
if have the following problem: I have a List which i am going through
I have following problem. In my view model I defined some list properties as
i have following problem To decode the Biquinary code use the number 5043210. At
I have following problem: in my layout xml I have relative layout in which
I have following problem. I want to make some graphics in c# windows form.
I have following problem. I have a team page like this example: http://www.social-markets.de/social-commerce-team.html small
I have following problem. I use this tutorial to creating a multiple file uploader:
I have the following problem which ripped my soul for the past 2 weeks:

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.