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 8762361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T15:30:45+00:00 2026-06-13T15:30:45+00:00

what my page do is: download an array from different server (first.php) php script

  • 0

what my page do is:

  1. download an array from different server (first.php)
  2. php script parse values
  3. parsed values are sent with ajax call
  4. on the next (ajax called) page (second.php) there are some mysql queries
  5. if values pass condition, values are written to database

…. So, when I run my first.php.. it loads second.php, everything’s fine..
but what I want to know if it is possible to let it make by cron?

If not, what should I do?
Thanks.

  • 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-13T15:30:47+00:00Added an answer on June 13, 2026 at 3:30 pm

    There are certain things you need to understand in this regard.

    The first is that PHP can be run as either a web server module or as a standalone executable. When you run it as a web server module, you open it from the browser, all related web technologies (html/css/js) etc get parsed and work in unison.

    When you run it from command line using cron like say /usr/bin/php mywebpage.php
    then the php executable DOES NOT parse/understand the other web technologies and so your page will fail.

    There are two workarounds for this:

    1. Rewrite only those web-enabled parts so that the ajax/js stuff gets
      handled by PHP. Basically rule of the thumb is that if you are
      running a CLI php script, it should contain ONLY core PHP. This is the preferred way. You will need to move the ajax calls to inside the same file and just make it a single execution flow like any regular program.

    2. If for some reason you cannot do the above, you can try something like this:
      /path/to/browser http://mysite/mywebpage.php. Here what you are doing is, you are running a browser executable and then calling the webpage URL. This way the page is being executed within the browser’s environment and it will be able to parse and understand the ajax/js calls.

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

Sidebar

Related Questions

I made a Bash script to download this page http://php.net/downloads.php and then search for
How can I pass array value from one page to another in php and
I'm trying to download the XLS file from this page: http://www.nordpoolspot.com/Market-data1/Elspot/Area-Prices/ALL1/Hourly/ (click on Export
I wrote a script to download some data from FTP by a subroutine. I
I'm doing fancy ajaxy dhtml stuff with caching. After I ajax-download a page of
I try to get a page with curl from an IIS-Server which demands user
I'd like to create a asp.net download page. I receive the file from a
I'm trying to make android download a zip file from my web server using
The download page for cmake only shows a 32 bit installer for windows. Any
On the download page for 2.3.1 it only mentions compatability with Office 2007. I

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.