why can not get the correct return value? | Bytes (2024)

luo.fengkui

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

Subscribe Reply

6 why can not get the correct return value? | Bytes (1) 1698 why can not get the correct return value? | Bytes (2)

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

Rik Wasmus

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

luo.fengkui

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

Captain Paralytic

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

ZeldorBlat

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

luo.fengkui

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 7762

printersettings papersources does not return correct values

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...

.NET Framework

8 1915

pointer return: address correct / value nonesense

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).

C / C++

2 6469

Question about which is the correct style of JavaScript to pass to FORM's onSubmit attribute

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();">

HTML / CSS

53 4585

Pointers and polymorphism explained [preview, PDF, part of my attempted "Correct C++ Tutorial"]

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>.

C / C++

4 1808

Correct way of taking in two integers

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;

C / C++

8 5602

DOM Table: how to get the correct row no

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...

Javascript

4 2261

Correct precision with printf

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

C / C++

1 2606

how to remain the correct value in signuppage

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" />

PHP

6 1840

Is this correct..??

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);

C / C++

3 1338

Check whether my Process flow is correct or not

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

.NET Framework

8828

What is ONU?

by: marktang |last post by:

ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...

General

8725

Changing the language in Windows 10

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,...

Windows Server

9360

Problem With Comparison Operator <=> in G++

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...

C / C++

1 9123

The easy way to turn off automatic updates for Windows 10/11

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,...

Windows Server

9053

Discussion: How does Zigbee compare with other wireless protocols in smart home applications?

by: tracyyun |last post by:

Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...

General

1 6658

Access Europe - Using VBA to create a class based on a table - Wed 1 May

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...

Microsoft Access / VBA

5971

Couldn’t get equations in html when convert word .docx file to html file in C#.

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();...

C# / C Sharp

4481

Trying to create a lan-to-lan vpn between two differents networks

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...

Networking - Hardware / Configuration

1 3185

transfer the data from one system to another through ip address

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

C# / C Sharp

why can not get the correct return value? | Bytes (2024)
Top Articles
Latest Posts
Article information

Author: Ouida Strosin DO

Last Updated:

Views: 5930

Rating: 4.6 / 5 (56 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Ouida Strosin DO

Birthday: 1995-04-27

Address: Suite 927 930 Kilback Radial, Candidaville, TN 87795

Phone: +8561498978366

Job: Legacy Manufacturing Specialist

Hobby: Singing, Mountain biking, Water sports, Water sports, Taxidermy, Polo, Pet

Introduction: My name is Ouida Strosin DO, I am a precious, combative, spotless, modern, spotless, beautiful, precious person who loves writing and wants to share my knowledge and understanding with you.