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

The Archive Base Latest Questions

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

i am working on windows XP . i can successfully run a system() command

  • 0

i am working on windows XP . i can successfully run a system() command through my browser by calling a TCL script that automates a ssh session. I also return a value from the script. however my problem is that the script dumps the entire ssh session in the browser.

my php script looks like :

$lastline=system('"C:\tcl\bin\tclsh.exe" \path to file\filename.tcl '.$username.' '.$pass,$val);  

filename.tcl:

spawn plink -ssh $user@$host   
expect "password:"  
send "$pass\r"  
expect "\prompt:/->"   
set $return_value [string compare /..string../ $expect_out(buffer)]   
/...some code...this runs fine/  
exit $return_value   

everything runs fine and i get $return_value back correctly but the php file prints the result of the execution of the entire ssh session in my browser which looks like:

Using username "admin". admin@10.135.25.150’s password: === /*some text*/ === \prompt:/->…/some text/

i want to prevent the system() function from printing this in my browser
i have used the shell_exec() function but it returns the entire ssh session result (which i have parsed in the tcl script and got a precise value to return to the php script)
is there a way i can do this without using shell_exec() but using system() instead

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-05-23T17:47:43+00:00Added an answer on May 23, 2026 at 5:47 pm

    The documentation for system() specifically says:

    Execute an external program and display the output

    On that page are listed alternatives. If you use the exec function instead, it will only execute the commands without displaying any output.

    Example:

    <?php
    echo "Hello, ";
    system("ls -l");
    echo "world!\n";
    ?>
    

    will display the output of system:

    $ php -q foo.php
    Hello, total 1
    -rw-r--r-- 1 bar domain users 59 Jul 15 16:10 foo.php
    world!
    

    while using exec will not display any output:

    <?php
    echo "Hello, ";
    exec("ls -l");
    echo "world!\n";
    ?>
    
    $ php -q foo.php
    Hello, world!
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on an application that displays some child windows which can either be
Where can I find the option to switch between the Windows Working Set in
I am developing a mobile application that is to run on a Windows Mobile
I am working on windows with JDK, Android SDK and eclipse set successfully. I
Occasionally working in Windows Vista the O.S. will desaturate the screen, rendering all colors
i'm working on windows mobile app (c#, .net 2.0). i would like to make
I am working on Windows Server 2003 (IIS6), which has two asp.net sites running
I have an Open Source app and I have it working on Windows, Linux
Has anyone managed to get subsonic or a variant working on Windows Mobile? We
Ok, this is working on windows. My Java app is running and functioning normally

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.