|  | |  |
01-20-2003, 06:14 PM
|
#31 (permalink)
| | Guest | Yeah, but using shell_exec() you can get the output into a variable, *hint*  =)
Also if you are just way lazy and using something that doesn't redirect the output to a variable just do
some_command("$command|tee /blah");
then just use shell_exec to get the contents of blah. Of course thats just plain messy.
PS. Blah! Did you get passthrough thing with the errors back from php.net? I saw it yesterday and was looking today but couldn't find anything.  | |
| |
01-20-2003, 06:51 PM
|
#32 (permalink)
| | Moderator
Join Date: May 2002 Location: us.ca
Posts: 4,532
| Vlad, you are like talking to a wall. i wonder if you even read your own posts .. or my posts... and if you do, then you need some serious comprehension help. your responses are completely inconsistant. i think you should be reading these posts with the intent to ask more questions rather than answer. ( ok there i vented )
from what i've read, you haven't got shell_exec() to give you any output .. and neither have i. there is a setting in your php.ini file that you have to set.
output_buffer "On"
i've set that and restarted apache, but it still doesn't give me any output. i've had other friends test it and it works fine. could be something buggy on my server. rh8/php4.2.3/apache1.2.7 |
| |
01-20-2003, 06:59 PM
|
#33 (permalink)
| | Guest | Probably because I just think what you are saying is something else...
Because from what I understood is you explained that if you can get output into a variable you can do much more than if you just printed it. I agree there completely. So what I am saying is that to get output to a variable just use shell_exec(). So you can do:
$output = shell_exec("ls");
and now you can print it to screen, save it into a DB, mass mail it, loop it infinitely to crash NN  whatever... Because other things like system() print it to screen directly. I have gotten shell_exec() to give me output.... All you have to do is $blah=shell_exec() and then $blah has the output. Or am I just reading your post wrong?  | |
| |
01-20-2003, 07:02 PM
|
#34 (permalink)
| | Moderator
Join Date: May 2002 Location: us.ca
Posts: 4,532
| Quote: Originally posted by sde i've tested both of these to make sure that shell_exec() will actually work.
this is putting the command in the arguments PHP Code: <?
$output = shell_exec('touch new_file.txt');
echo $output;
?> and this would do the same thing except putting an executable filename in the arguments PHP Code: <?
$output = shell_exec('script.sh');
echo $output;
?> both of these will create 'new_file.txt' ( assuming script.sh just contains the same command as my first example. )
the problem is when you use any command that generates output. i tested it with 'echo' commands and also 'rm' commands that should not detect a file and give error output.
this bugs the heck out of me. | and this was my point .. this was quite a few posts ago ( posted by me ) .. i know how to do it , and it's not working. this is why i am saying you don't read. |
| |
01-20-2003, 07:10 PM
|
#35 (permalink)
| | Techno Rat
Join Date: Jan 2003 Location: San Diego
Posts: 559
| Quote: Originally posted by Vlad902 Probably because I just think what you are saying is something else...
Because from what I understood is you explained that if you can get output into a variable you can do much more than if you just printed it. I agree there completely. So what I am saying is that to get output to a variable just use shell_exec(). So you can do:
$output = shell_exec("ls");
and now you can print it to screen, save it into a DB, mass mail it, loop it infinitely to crash NN whatever... Because other things like system() print it to screen directly. I have gotten shell_exec() to give me output.... All you have to do is $blah=shell_exec() and then $blah has the output. Or am I just reading your post wrong? | Damn you are malicious!
Ilya
__________________ > SELECT * FROM users WHERE clue > 0
0 rows returned |
| |
01-20-2003, 07:18 PM
|
#36 (permalink)
| | Guest | OK, I now get what you mean  . But truly it doesn't bother me that much, I am content using system("blah 2>&1"); if I need output and shell_exec if I need it stored in a variable.
1.)Do you mean Apache 1.3.27?
2.)Have you looked at their httpd.conf or php.ini files?
3.)Worth a try, make look at :
A.)updating Apache
B.)updating PHP (unlikely)
C.)Both | |
| |
01-20-2003, 07:19 PM
|
#37 (permalink)
| | Techno Rat
Join Date: Jan 2003 Location: San Diego
Posts: 559
| this works for me: PHP Code: <?
$foo = shell_exec('pico test');
print "$foo";
?> although it is un-readable, i can definetly see a connection...
Ilya
__________________ > SELECT * FROM users WHERE clue > 0
0 rows returned |
| |
01-20-2003, 07:23 PM
|
#38 (permalink)
| | Techno Rat
Join Date: Jan 2003 Location: San Diego
Posts: 559
| Quote: Originally posted by Vlad902 OK, I now get what you mean . But truly it doesn't bother me that much, I am content using system("blah 2>&1"); if I need output and shell_exec if I need it stored in a variable.
1.)Do you mean Apache 1.3.27?
2.)Have you looked at their httpd.conf or php.ini files?
3.)Worth a try, make look at :
A.)updating Apache
B.)updating PHP (unlikely)
C.)Both | 1. ya, apache 1.2.x only went up to 1.2.6
2. how do we need he needs to update apache if we dont know his version!!!!
Ilya
__________________ > SELECT * FROM users WHERE clue > 0
0 rows returned |
| |
01-20-2003, 08:37 PM
|
#39 (permalink)
| | Moderator
Join Date: May 2002 Location: us.ca
Posts: 4,532
| that box is a mess anyway, .. i should just try it on another system, i'm sure it works cause of everyone who's tested it. i would just put something besides redhat 8 on it, but it's a game server, and full most of the time with players.
i'm just imagining how i can use that now, .. it's a pretty powerful feature. |
| |
01-20-2003, 08:56 PM
|
#40 (permalink)
| | Guest | /me if I owned a game server
MWHAHAHAHAHA!
sniff everything! EVERYTHING! HAHAHAHAHA!
Check refferer and spoof them for null sessions! HAHAHAHA! YES! YES!
Check usernames and IP and spoof on ports of popular IM protocols! MWAHAHAHAHAHAHAHAHA!  | |
| |
01-20-2003, 09:15 PM
|
#41 (permalink)
| | Moderator
Join Date: May 2002 Location: us.ca
Posts: 4,532
| i'll give you the ip.. why don't you join? haha  |
| |
01-21-2003, 06:26 AM
|
#43 (permalink)
| | Techno Rat
Join Date: Jan 2003 Location: San Diego
Posts: 559
| Quote: Originally posted by sde i'll give you the ip.. why don't you join? haha | whats the ip?
or are you just kidding...
Ilya
__________________ > SELECT * FROM users WHERE clue > 0
0 rows returned |
| |
01-21-2003, 07:00 AM
|
#44 (permalink)
| | Moderator
Join Date: May 2002 Location: us.ca
Posts: 4,532
| no, it's a couinter-strike server |
| |
01-21-2003, 10:59 AM
|
#45 (permalink)
| | Techno Rat
Join Date: Jan 2003 Location: San Diego
Posts: 559
| I love that game!
Ilya
__________________ > SELECT * FROM users WHERE clue > 0
0 rows returned |
| | | Thread Tools | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | All times are GMT -8. The time now is 09:35 PM. |
Copyright © 2000-2008, Milano Interactive Web Hosting provided by Portal 360 Web Hosting |  | |