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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:39:32+00:00 2026-06-13T14:39:32+00:00

How to run php file with parameter using notepad++ test.php <?php /* ——- test.php

  • 0

How to run php file with parameter using notepad++

test.php

<?php 
    /* ------- 
        test.php
    ------- */
    if(!isset($_GET['file'])){
        exit;
    }
    $code=file_get_contents($_GET['file']);
    echo $code;

?>

demo_file.php —–$(FULL_CURRENT_PATH)

contents:

hello world


cd "D:\PHPnow-1.5.6\htdocs\zc_default\my_debug_fw"<br>
"d:\PHPnow-1.5.6\php-5.2.14-Win32\php.exe" "test.php" [what here?]

how to send “demo_file.php” as $_GET['file'] to test.php ?

The console finally should output:...... hello world

  • 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-13T14:39:33+00:00Added an answer on June 13, 2026 at 2:39 pm

    When utilizing PHP from the command line the arguments aren’t passed in as part of the $_GET superglobal. They’re passed in as part of the $_SERVER – superglobal where $_SERVER[‘argc’] is the number of arguments and $_SERVER[‘argv’] is an array of the argument values. $_SERVER[‘argv’][0] is the name of the php script and $_SERVER[‘argv’][1] would be the first argument.

        if($_SERVER['argc'] < 2){
            exit("Usage: php test.php <file>");
        }
    
        $code = file_get_contents($_SERVER['argv'][1]);
    

    Per your example above…

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

Sidebar

Related Questions

I'm using the following line of code to run my php file that I
As a newbie I am trying to run a PHP file and then an
I'm making a php file that will run an event after five minutes have
I'm attempting to run kohana classes in the install.php file but am having no
Can you run some script before the uploading of a file starts in php?
Using Apache 2.2 and PHP 5, what's the best way to run PHP without
On a Windows machine, the following script: <?php mkdir(c:\\[test]); file_put_contents(c:\\[test]\\test.txt, some content); chdir(c:\\[test]); echo
I have a weird problem with $_GET method. I have a php code like
I have a php file that needs to be run on a cronjob and
I am runing a .bat file from a php using exec on a Windwos

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.