473,775 Members | 2,392 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

why can not get the correct return value?

Hello
I run a simple php file as:
<?php
$result=system( "atq",$paramete r);
echo '<br>result='.$ result;
echo '<br>parameter= '.$parameter;
//phpinfo();
?>

run it on command line can get the parameter value as 0,but if use
browser to run it,the parameter value is 1,Why?
Note:I had set the user and group in httpd.conf.if change as
$result=system( "ls",$parameter );,then can get the parameter value as 0
Dec 12 '07 #1
6 1702
On Dec 12, 7:15 am, luo.feng...@gma il.com wrote:
Hello
I run a simple php file as:
<?php
$result=system( "atq",$paramete r);
echo '<br>result='.$ result;
echo '<br>parameter= '.$parameter;
//phpinfo();
?>

run it on command line can get the parameter value as 0,but if use
browser to run it,the parameter value is 1,Why?
Note:I had set the user and group in httpd.conf.if change as
$result=system( "ls",$parameter );,then can get the parameter value as 0
Since you haven't set the value of $parameter anywhere I'm not sure
why you'd expect it have any particular value.
Dec 12 '07 #2
On Wed, 12 Dec 2007 15:35:37 +0100, ZeldorBlat <ze********@gma il.com
wrote:
On Dec 12, 7:15 am, luo.feng...@gma il.com wrote:
>Hello
I run a simple php file as:
<?php
$result=system ("atq",$paramet er);
echo '<br>result='.$ result;
echo '<br>parameter= '.$parameter;
//phpinfo();
?>

run it on command line can get the parameter value as 0,but if use
browser to run it,the parameter value is 1,Why?
Note:I had set the user and group in httpd.conf.if change as
$result=system ("ls",$paramete r);,then can get the parameter value as 0

Since you haven't set the value of $parameter anywhere I'm not sure
why you'd expect it have any particular value.
It's called a reference...
http://www.php.net/system
--
Rik Wasmus
Dec 12 '07 #3
On 12ÔÂ12ÈÕ, ÏÂÎç10ʱ45·Ö, "Rik Wasmus" <luiheidsgoe... .@hotmail.comwr ote:
On Wed, 12 Dec 2007 15:35:37 +0100, ZeldorBlat <zeldorb...@gma il.com>
wrote:
On Dec 12, 7:15 am, luo.feng...@gma il.com wrote:
Hello
I run a simple php file as:
<?php
$result=system( "atq",$paramete r);
echo '<br>result='.$ result;
echo '<br>parameter= '.$parameter;
//phpinfo();
?>
run it on command line can get the parameter value as 0,but if use
browser to run it,the parameter value is 1,Why?
Note:I had set the user and group in httpd.conf.if change as
$result=system( "ls",$parameter );,then can get the parameter value as 0
Since you haven't set the value of $parameter anywhere I'm not sure
why you'd expect it have any particular value.

It's called a reference...http://www.php.net/system
--
Rik Wasmus
I has checked it,but it is a pity,still can not get the expected
result.I had modified the httpd.conf,php. ini,sudoers,at. allow
Dec 13 '07 #4
On 12 Dec, 12:15, luo.feng...@gma il.com wrote:
Hello
I run a simple php file as:
<?php
$result=system( "atq",$paramete r);
echo '<br>result='.$ result;
echo '<br>parameter= '.$parameter;
//phpinfo();
?>

run it on command line can get the parameter value as 0,but if use
browser to run it,the parameter value is 1,Why?
Note:I had set the user and group in httpd.conf.if change as
$result=system( "ls",$parameter );,then can get the parameter value as 0
When run on the command line, it is running under the userid that you
are logged in with.
When run from a browser, the web server (apache?) is running it under
its userid. Possibly this latter userid does not have the correct
authority?
Dec 13 '07 #5
On Dec 12, 9:45 am, "Rik Wasmus" <luiheidsgoe... @hotmail.comwro te:
On Wed, 12 Dec 2007 15:35:37 +0100, ZeldorBlat <zeldorb...@gma il.com>
wrote:
On Dec 12, 7:15 am, luo.feng...@gma il.com wrote:
Hello
I run a simple php file as:
<?php
$result=system( "atq",$paramete r);
echo '<br>result='.$ result;
echo '<br>parameter= '.$parameter;
//phpinfo();
?>
run it on command line can get the parameter value as 0,but if use
browser to run it,the parameter value is 1,Why?
Note:I had set the user and group in httpd.conf.if change as
$result=system( "ls",$parameter );,then can get the parameter value as 0
Since you haven't set the value of $parameter anywhere I'm not sure
why you'd expect it have any particular value.

It's called a reference...http://www.php.net/system
--
Rik Wasmus
Doh! Thanks, Rik.
Dec 13 '07 #6
On 12ÔÂ13ÈÕ, ÏÂÎç9ʱ29·Ö, Captain Paralytic <paul_laut...@y ahoo.comwrote:
On 12 Dec, 12:15, luo.feng...@gma il.com wrote:
Hello
I run a simple php file as:
<?php
$result=system( "atq",$paramete r);
echo '<br>result='.$ result;
echo '<br>parameter= '.$parameter;
//phpinfo();
?>
run it on command line can get the parameter value as 0,but if use
browser to run it,the parameter value is 1,Why?
Note:I had set the user and group in httpd.conf.if change as
$result=system( "ls",$parameter );,then can get the parameter value as 0

When run on the command line, it is running under the userid that you
are logged in with.
When run from a browser, the web server (apache?) is running it under
its userid. Possibly this latter userid does not have the correct
authority?
Yes,I know your meaning,My web server is apache,I had changed the user
and group as Test_bench,thse user that I logged in Linux is Test_bench
too,so,I don't think this issue is about User Setting.
Dec 14 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
7764
by: Richard Golebiowski | last post by:
I have been trying to figure this out for quite some time and cannot find any examples in VB.Net or in VB that work correctly. I am working on an application where I want the user to be able to select a peinter and printer tray to print reports out. In Crystal Reports 8.5, I can select a printer and tray and it prints correctly. I did a test report that I use to tell me the value that Crystal Reports is using for the paper source. When I...
8
1919
by: Huibuh | last post by:
I start hating RETURN!!! list<happy> //#include <list>// is searched via iterator (ptr) so long until the argument "number" of the class "happy" is equal now. The function "findhappy" works fine, finds the right pointer "nownumber" with correct values. Behind "return" the memory address remains correct but the values are wrong (a huge negative number and all the same).
2
6471
by: Sean Dockery | last post by:
Which is the following is correct? a) <form ... onSubmit="return checkData()"> b) <form ... onSubmit="return checkData();"> c) <form ... onSubmit="checkData()"> d) <form ... onSubmit="checkData();">
53
4603
by: Alf P. Steinbach | last post by:
So, I got the itch to write something more... I apologize for not doing more on the attempted "Correct C++ Tutorial" earlier, but there were reasons. This is an UNFINISHED and RAW document, and at the end there is even pure mindstorming text left in, but already I think it can be very useful. <url: http://home.no.net/dubjai/win32cpptut/special/pointers/preview/pointers_01__alpha.doc.pdf>.
4
1813
by: Steve Carter | last post by:
The following code fragment prompts the user to enter two integers separated by a space. It works the way I want it to, but a friend said it's not correct and said it can cause a buffer overflow. I don't really see anything wrong with it. Can someone enlighten me? int main(void) { int i,j; char buff;
8
5605
by: yangtono | last post by:
Hi, I'm working on a program using javascript to create a dynamic table. Initially was developing this in IE environment. It work fine, but realise that it doesn't work on Mozilla FireFox. So I change it to using DOM Table to construct the table. But now I can't get the correct row no from the "Browse" button that I clicked on. It will only return the total number of rows instead of the currect row no I clicked on. On previous working...
4
2266
by: banansol | last post by:
I read the thread Floating point rounding error and I saw Richard Heathfield's description with several lines like: 0.1 = 1/2 = 0.5 - too large 0.01 = 1/4 = 0.25 - too large 0.001 = 1/8 = 0.125 - too large .... And I wanted to write such a program that output lines like that. My attempt is below, and I don't
1
2611
by: kang jia | last post by:
hi currently i am editing signup page, when user enter deupicated NRIC and click signup, they will go to do_signuppage and read the error message and then after 5 seconds, they will be redirected to signup page again, however, this time they go back, all the correct value will be remain. how should i achieve this. my current code for singup.php is like this <html> <head> <link rel="stylesheet" type="text/css" href="gallery.css" />
6
1843
by: jt | last post by:
#include <stdio.h> void f(); int main() { long int i; i=20; f(); i = 10; printf ("\n%d\n",i);
3
1341
by: raghulvarma | last post by:
I did a small sample with three tier architecture and i need to know whether the flow of the program is correct or not.The pgm works fine. Inside web.config <configuration> <appSettings> <add key="Connection" value="server=.;trusted_connection=true;initial catalog=sanjay"/> </appSettings></configuration> Inside Data Access Layer private string username; private string password; public string UserName
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10270
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10051
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7464
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6718
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5360
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4017
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3611
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2853
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.