php script problem


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting php script problem
# 1  
Old 07-05-2012
php script problem

Code:
 $result = shell_exec("/sbin/checkscript.sh jdoe");
 echo "$result" ;

i am running a script through php. the script is /sbin/checkscript jdoe.

this script is supposed to output something similar to this:

Code:
################################
####  Welcome John Doe
################################

The problem is, in the webpage, php doesn't show the output of the script as cleanly as this.

it meshes them all together in one line like this:

Code:
####################################  Welcome John Doe ################################

how can i modify my php code so that whatever the script returns shows up in the webpage just as it would have from the commandline?

i have tried removing the quotes on the "results". same problem. any ideas?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Running multiple php scripts into one php only, cron mail alert problem...

hi, while separated they produce the usual mail alert and i can see the output... if i write into the php script: <?php system('php -f /var/www/vhosts/domain.com/httpdocs/folder/script1.php'); system('php -f /var/www/vhosts/domain.com/httpdocs/folder/script2.php'); system('php -f... (0 Replies)
Discussion started by: 7stars
0 Replies

2. Solaris

problem in php installation..

hi am senthil, am trying to install PHP in my solaris 10 x86 ... i installed oracle,apache,tomcat,mysql .. the only thing am missing is PHP.. i tried to install php using ./configure .. my ./configure command.. ./configure \ --with-apxs=/usr/apache/bin/apxs \... (4 Replies)
Discussion started by: senkerth
4 Replies

3. Solaris

php installation problem..

hi am senthil, i want to install php 5 in my solaris 10 x86server.. i already enabled apache and my mysql 5 is woking fine.. i want to know the procedure to install php.. i googled it and got some info .. i have doubt in the following thing /configure -with-apache2=/opt/httpd-2.0.49... (1 Reply)
Discussion started by: senkerth
1 Replies

4. Shell Programming and Scripting

php date script problem

i want to store the output of date into a variable and be able to echo out that variable in a sentence. but the below isn't working. <?php #$date_time = date('Y-m-d H:i:s'); putenv("TZ=US/Eastern"); date_time = "date('h:i:s')."\n""; echo ("<li>Today's date is: ($date_time)</li>\n"); ... (1 Reply)
Discussion started by: SkySmart
1 Replies

5. Shell Programming and Scripting

problem with a php script

The script is called php-ping and it is taken from theworldsend.net I modified it so that instead of ping he will execute another command called scr witch telnets to a switch and changes the vlan on an interface the telnet script: #! /bin/bash ( sleep 0.2; echo admin; sleep 0.2; echo... (1 Reply)
Discussion started by: silently
1 Replies

6. UNIX for Dummies Questions & Answers

PHP scripts problem!

Hi, I've configured a server with Debian Etch 4.0. I followed these instructions: Install and Configure Apache2 with PHP5 and SSL Support in Debian Etch -- Debian Admin But when I try to launch a php script with phpinfo() in my browser, It showed me the download manager window.(i.e. wanna to... (9 Replies)
Discussion started by: mjdousti
9 Replies

7. Shell Programming and Scripting

i have a serious problem in php

hello guys, well as i mentioned first i have a serious problem, i need your help. i have a hosting plan with linux, apache and php. i have a script (that have my UID=32256) inside my web site (in the panel folder -see below-) that creates new scripts (in the pages folder) (the new scripts... (0 Replies)
Discussion started by: mehdi
0 Replies

8. Linux

PHP problem

Hi frnds I installed phpmyadmin for OTRS but when ever i tried to open the phpMyAdmin-2.6.2/index.php page i m getting the following error " urldecode the db name if (isset($lightm_db)) { // no longer urlencoded because of html entities in the db name // $db =... (8 Replies)
Discussion started by: naik_mit
8 Replies

9. Shell Programming and Scripting

Problem with PHP and MySQL

Okay, I'm new to this PHP and MySQL stuff, so help would be VERY much appreciated. :) On my iMac runnning Panther, it has MySQL and PHP installed. Yet when I view a PHP file from the iMac or another computer at my house, I get the source code. What's wrong? (11 Replies)
Discussion started by: Danny_10
11 Replies

10. Shell Programming and Scripting

PHP: problem with index.php

iam geting a error with this index script. heres the error Parse error: parse error in c:\phpdev\www\dev\compulearn\in work\index.php on line 39 Whats wrong?? ------------------------ <?php //display header and left bars include ('header.php'); include ('left.php'); //connect... (13 Replies)
Discussion started by: perleo
13 Replies
Login or Register to Ask a Question