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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:40:58+00:00 2026-06-01T18:40:58+00:00

I have a php script script1.php. I want to pass arguments to script2.php and

  • 0

I have a php script script1.php. I want to pass arguments to script2.php and execute it from script1.php. (script2.php saves the output to a text file which is used in script1.php)

Edit:

This is my script2.php

require_once('showtimes/simple_html_dom/simple_html_dom.php');

$html = new simple_html_dom();
//$requested4=$_GET['place'];
$html->load_file('http://www.google.com/movies?near=${requested4}&hl=en');
ob_start(); 

$muv='<pre>';
foreach($html->find('#movie_results .theater') as $div) {
    // print theater and address info
$muv=$muv."Theatre:  ".$div->find('h2 a',0)->innertext."\n";
$muv=$muv."Address: ". $div->find('.info',0)->innertext."\n";

    // print all the movies with showtimes
    foreach($div->find('.movie') as $movie) {
       $muv=$muv."\tMovie:    ".$movie->find('.name a',0)->innertext.'<br />';
      $muv=$muv."\tTime:    ".$movie->find('.times',0)->innertext.'<br />';
    }
    $muv=$muv. "\n\n";
}
$muv=$muv."</pre>";
//ob_get_contents(); 
ob_end_clean(); 
echo $muv;
file_put_contents('textfiles/file.txt', $muv);  
$html->clear();

?>

If I just execute this it works normally, but if I include it in script1.php i get this error

Fatal error: Call to a member function find() on a non-object in /home/anandheg/public_html/anandghegde.in/se/showtimes/simple_html_dom/simple_html_dom.php on line 879

also, I don’t have permissions on the server for shell executions.

  • 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-01T18:41:00+00:00Added an answer on June 1, 2026 at 6:41 pm

    You can simply include the script2.php inside the script1.php

    include 'script2.php';
    

    You don’t have to pass the parameter in the script2.php, variables which exists before the include statement will be available in script2.php as normal.

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

Sidebar

Related Questions

I have to pass some strings from a java servlet to a php script.
I have a PHP script, say a.php , which is called from JS using
I have a php script that is running in CLI and I want to
I have a html_headers.inc.php script that I want to include in every script on
I have an multi-dimensional array that I want to send to a PHP script
I have a change password script in PHP and I want to do is
I have a PHP script that executes a .bat file using system(cmd /c C:\dir\file.bat);
I have a PHP script (news-generator.php) which, when I include it, grabs a bunch
I have a PHP server script that SELECTs some data from a MySQL database.
Im trying to pass some variables from the URL to the PHP script. Now

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.