[PHP] PHP ftp web client
Hello! Can someone recommend me a good/stable PHP-FTP Web client? I wasnt quite happy with the google search results :P Thanks a lot! Mario -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] shell_exec with pipes
Hello! I think we are almost there yet :) On Wednesday 12 November 2003 21:48, Mario Ohnewald wrote: ok, i am running the script like this now: [snip] This seems to suggest that shell_exec() does not like your command and is not executing it, so: Try tackling it logically, step-by-step: Have you: 1) Turned on full error reporting? How do i turn that on? In php.ini, once you've enabled it, restart webserver and see what errors, if any, you get. ok, i have enabled that with error_reporting(E_ALL); 2) Checked that (i) you're not running in safe_mode, or (ii) if you are, that you are allowed to access those executables? i am running in safe mode. What is the answer to (ii)? Yes, i do have acces to those files and the permissions are correct. Are you able to execute any shell programs/commands at all? Hint try something simple like shell_exec('touch /tmp/testfile') and see whether /tmp/testfile is being created. Yes, i am. I think the key is here somewhere: PHP Output from shell_exec(/usr/local/bin/mplayer -identify -frames 0 /tmp/pitstop.mpeg); MPlayer 1.0pre2-3.3.2 (C) 2000-2003 MPlayer Team CPU: Advanced Micro Devices Athlon MP/XP Thoroughbred 1466 MHz (Family: 6, Stepping: 1) Detected cache-line size is 64 bytes CPUflags: MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0 Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE Reading config file /usr/local/etc/mplayer/mplayer.conffont: can't open file: (null) font: can't open file: /usr/local/share/mplayer/font/font.desc Using usleep() timing Playing /tmp/pitstop.mpeg MPEG-PS file format detected. VIDEO: MPEG1 320x240 (aspect 1) 29.970 fps 1151.2 kbps (143.9 kbyte/s) PHP Output from normal shell /usr/local/bin/mplayer -identify -frames 0 /tmp/pitstop.mpeg MPlayer 1.0pre2-3.3.2 (C) 2000-2003 MPlayer Team CPU: Advanced Micro Devices Athlon MP/XP Thoroughbred 1466 MHz (Family: 6, Stepping: 1) Detected cache-line size is 64 bytes CPUflags: MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0 Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE Reading config file /usr/local/etc/mplayer/mplayer.conf: No such file or directory Reading config file /home/lansinplayer/.mplayer/config Reading /home/lansinplayer/.mplayer/codecs.conf: Can't open '/home/lansinplayer/.mplayer/codecs.conf': No such file or directory Reading /usr/local/etc/mplayer/codecs.conf: Can't open '/usr/local/etc/mplayer/codecs.conf': No such file or directory Using built-in default codecs.conf font: can't open file: /home/lansinplayer/.mplayer/font/font.desc font: can't open file: /usr/local/share/mplayer/font/font.desc Failed to open /dev/rtc: Permission denied (mplayer should be setuid root or /dev/rtc should be readable by the user.) Using usleep() timing Can't open input config file /home/lansinplayer/.mplayer/input.conf: No such file or directory Can't open input config file /usr/local/etc/mplayer/input.conf: No such file or directory Falling back on default (hardcoded) input config Playing /tmp/pitstop.mpeg MPEG-PS file format detected. VIDEO: MPEG1 320x240 (aspect 1) 29.970 fps 1151.2 kbps (143.9 kbyte/s) == Opening audio decoder: [mp3lib] MPEG layer-2, layer-3 MP3lib: init layer23 finished, tables done AUDIO: 44100 Hz, 2 ch, 16 bit (0x10), ratio: 16000-176400 (128.0 kbit) Selected audio codec: [mp3] afm:mp3lib (mp3lib MPEG layer-2, layer-3) == ID_FILENAME=/tmp/pitstop.mpeg ID_VIDEO_FORMAT=0x1001 ID_VIDEO_BITRATE=1151200 ID_VIDEO_WIDTH=320 ID_VIDEO_HEIGHT=240 ID_VIDEO_FPS=29.970 ID_VIDEO_ASPECT=0. ID_AUDIO_CODEC=mp3 ID_AUDIO_FORMAT=80 ID_AUDIO_BITRATE=128000 ID_AUDIO_RATE=44100 ID_AUDIO_NCH=2 ID_LENGTH=16 vo: couldn't open the X11 display ()! vo: couldn't open the X11 display ()! VO XOverlay need a subdriver vo: couldn't open the X11 display ()! Can't open /dev/fb0: Permission denied [fbdev2] Can't open /dev/fb0: Permission denied == Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough VDec: vo config request - 320 x 240 (preferred csp: Mpeg PES) VDec: using Mpeg PES as output csp (no 0) Movie-Aspect is undefined - no prescaling applied. VO: [null] 320x240 = 320x240 Mpeg PES Selected video codec: [mpegpes] vfm:mpegpes (Mpeg PES output (.mpg or Dxr3/DVB card)) == Checking audio filter chain for 44100Hz/2ch/16bit - 44100Hz/2ch/16bit... AF_pre: af format: 2 bps, 2 ch, 44100 hz, little endian signed int AF_pre: 44100Hz 2ch Signed 16-bit (Little-Endian) audio_setup
RE: [PHP] shell_exec with pipes
Hi, $var=shell_exec(/usr/local/bin/mplayer -identify -frames 0 /tmp/pitstop.mpeg 2/dev/null | grep ID_LENGTH | cut -d \=\ -f 2); $var=shell_exec(/usr/local/bin/mplayer -identify -frames 0 /tmp/pitstop.mpeg 2/dev/null | grep ID_LENGTH | cut -d \=\ -f 2); echo Output: $var; Still gives nothing back :/ Told you, its not that easy :P Thank you very much, Mario -- NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien... Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService Jetzt kostenlos anmelden unter http://www.gmx.net +++ GMX - die erste Adresse für Mail, Message, More! +++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] shell_exec with pipes
ok, i am running the script like this now: START - $var=shell_exec(/home/lansinplayer/server/apache/htdocs/lansinplayer/getfilelength.sh /tmp/pitstop.mpeg); echo --$var--; STOP - Where echo returns nothing. I did a chmod 777 on the getfilelength.sh file. When i run the file in shell i get this: $ /home/lansinplayer/server/apache/htdocs/lansinplayer/getfilelength.sh /tmp/pitstop.mpeg 16 The Shell file looks like that: if [ $1 ];then length=`mplayer -identify -frames 0 $1 2/dev/null| grep ID_LENGTH | cut -d \=\ -f 2` echo $length On Wednesday 12 November 2003 17:21, Mario Ohnewald wrote: $var=shell_exec(/usr/local/bin/mplayer -identify -frames 0 /tmp/pitstop.mpeg 2/dev/null | grep ID_LENGTH | cut -d \=\ -f 2); $var=shell_exec(/usr/local/bin/mplayer -identify -frames 0 /tmp/pitstop.mpeg 2/dev/null | grep ID_LENGTH | cut -d \=\ -f 2); echo Output: $var; Still gives nothing back :/ Told you, its not that easy :P Have you: 1) Turned on full error reporting? How do i turn that on? 2) Checked that (i) you're not running in safe_mode, or (ii) if you are, that you are allowed to access those executables? i am running in safe mode. 3) Confirmed that the left side of the pipe is working and giving the expected output? $var2=shell_exec(mplayer -identify -frames 0 /tmp/pitstop.mpeg | /bin/grep ID_LENGTH); gives nothing back. Thats what i get in Shell: - $ mplayer -identify -frames 0 /tmp/pitstop.mpeg | grep ID_LENGTH : No such file or directory Can't open '/home/lansinplayer/.mplayer/codecs.conf': No such file or directory Can't open '/usr/local/etc/mplayer/codecs.conf': No such file or directory Failed to open /dev/rtc: Permission denied (mplayer should be setuid root or /dev/rtc should be readable by the user.) Can't open input config file /home/lansinplayer/.mplayer/input.conf: No such file or directory Can't open input config file /usr/local/etc/mplayer/input.conf: No such file or directory Falling back on default (hardcoded) input config vo: couldn't open the X11 display ()! vo: couldn't open the X11 display ()! VO XOverlay need a subdriver vo: couldn't open the X11 display ()! Can't open /dev/fb0: Permission denied [fbdev2] Can't open /dev/fb0: Permission denied audio_setup: Can't open audio device /dev/dsp: Permission denied ID_LENGTH=16 4) Tried giving the full path to grep? yes i did If you're still having trouble with it you can try sticking the above into a little shell script and shell_exec() the shell script instead. See above. Any further ideas? Thank you, Mario -- NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien... Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService Jetzt kostenlos anmelden unter http://www.gmx.net +++ GMX - die erste Adresse für Mail, Message, More! +++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] shell_exec with pipes
Hello List! I have tried to get this command working with php for about 2Weeks now, and i would like you to try to get this thing working. This shell command: /usr/local/bin/mplayer -identify -frames 0 /tmp/pitstop.mpeg 2/dev/null| grep ID_LENGTH | cut -d = -f 2 gives me the result 16 back, the LENGHT of the filename. $var=shell_exec(/usr/local/bin/mplayer -identify -frames 0 /tmp/pitstop.mpeg 2/dev/null| grep ID_LENGTH | cut -d = -f 2); just wont for some reason! $var ist just empty. I was playing around with stderr and stdout and stuff, but i dont know why php wont deal with it as shell does. $var=shell_exec(ls -al); for examle works just fine! Could someone please give it a try, cause i have spent hours in irc channels and googeling around to get this solved :/ Thanks a LOT!! Mario -- NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien... Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService Jetzt kostenlos anmelden unter http://www.gmx.net +++ GMX - die erste Adresse für Mail, Message, More! +++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] shell_exec with pipes
Have you tried escaping the pipes and quotes? Try this: $var=shell_exec(/usr/local/bin/mplayer -identify -frames 0 /tmp/pitstop.mpeg 2/dev/null\| grep ID_LENGTH \| cut -d \=\ -f 2); nope, still get nothing back. Mario Ohnewald wrote: $var=shell_exec(/usr/local/bin/mplayer -identify -frames 0 /tmp/pitstop.mpeg 2/dev/null| grep ID_LENGTH | cut -d = -f 2); -- NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien... Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService Jetzt kostenlos anmelden unter http://www.gmx.net +++ GMX - die erste Adresse für Mail, Message, More! +++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] exec(echo ... issuse
Hello! I want to write a line into a file (called $script) wich goes like that: echo `date` 192.168.10.123 is down, lets call the admin. I was sleeping for 10 Minutes | smbclient -M Computer This is what i have tried: exec(echo echo `date` === $ip is down, lets call the admin. I was sleeping for $var_timer_rechner1 Minutes | smbclient -M $popup_1 $script); The problem is that after exec(echo its command ends due to that . I tried \ to let php ignore this but then it doesn´t write my anymore: exec(echo \echo \`date` === $ip is down, lets call the admin. I was sleeping for $var_timer_rechner1\ | smbclient -M $popup_1\ $script); this is the result: echo Wed Sep 25 12:29:17 CEST 2002 === 192.168.10.1 is down, lets call the admin. I was sleeping for | smbclient -M Server but i want: echo Wed Sep 25 12:29:17 CEST 2002 === 192.168.10.1 is down, lets call the admin. I was sleeping for | smbclient -M Server ^^ ^^ missing missing Can anyone tell me where the my mistake is? Cheers, Mario -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: exec(echo ... issuse
Hi Henry, From: Henry [mailto:[EMAIL PROTECTED]] Have you tried using single quotes arround the main string? i.e. 'echo echo blah blah' I have tried serveral of version, maybe you could give me your example from the lines below. I couldnt work it out ;( Henry Henry [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... use \ instead of so that you don't actually end the string Henry Mario Ohnewald [EMAIL PROTECTED] wrote in message 001801c2647a$070aa100$350aa8c0@W2KDP">news:001801c2647a$070aa100$350aa8c0@W2KDP... Hello! I want to write a line into a file (called $script) wich goes like that: echo `date` 192.168.10.123 is down, lets call the admin. I was sleeping for 10 Minutes | smbclient -M Computer This is what i have tried: exec(echo echo `date` === $ip is down, lets call the admin. I was sleeping for $var_timer_rechner1 Minutes | smbclient -M $popup_1 $script); The problem is that after exec(echo its command ends due to that . I tried \ to let php ignore this but then it doesn´t write my anymore: exec(echo \echo \`date` === $ip is down, lets call the admin. I was sleeping for $var_timer_rechner1\ | smbclient -M $popup_1\ $script); this is the result: echo Wed Sep 25 12:29:17 CEST 2002 === 192.168.10.1 is down, lets call the admin. I was sleeping for | smbclient -M Server but i want: echo Wed Sep 25 12:29:17 CEST 2002 === 192.168.10.1 is down, lets call the admin. I was sleeping for | smbclient -M Server ^^ ^^ missing missing Can anyone tell me where the my mistake is? Cheers, Mario mario -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: exec(echo ... issuse
Hi Henry! From: Henry [mailto:[EMAIL PROTECTED]] How about ?php $command=\`date` === $ip is down, lets call the admin. I was sleeping for $var_timer_rechner1 Minutes\ | smbclient -M $popup_1 $script; exec(echo \$command\); ? Nope, hasnt worked either ;( any other idea? this is quite important ;) Cheers, Mario Mario Ohnewald [EMAIL PROTECTED] wrote in message 001901c26480$5e280df0$350aa8c0@W2KDP">news:001901c26480$5e280df0$350aa8c0@W2KDP... Hi Henry, From: Henry [mailto:[EMAIL PROTECTED]] Have you tried using single quotes arround the main string? i.e. 'echo echo blah blah' I have tried serveral of version, maybe you could give me your example from the lines below. I couldnt work it out ;( Henry Henry [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... use \ instead of so that you don't actually end the string Henry Mario Ohnewald [EMAIL PROTECTED] wrote in message 001801c2647a$070aa100$350aa8c0@W2KDP">news:001801c2647a$070aa100$350aa8c0@W2KDP... Hello! I want to write a line into a file (called $script) wich goes like that: echo `date` 192.168.10.123 is down, lets call the admin. I was sleeping for 10 Minutes | smbclient -M Computer This is what i have tried: exec(echo echo `date` === $ip is down, lets call the admin. I was sleeping for $var_timer_rechner1 Minutes | smbclient -M $popup_1 $script); The problem is that after exec(echo its command ends due to that . I tried \ to let php ignore this but then it doesn´t write my anymore: exec(echo \echo \`date` === $ip is down, lets call the admin. I was sleeping for $var_timer_rechner1\ | smbclient -M $popup_1\ $script); this is the result: echo Wed Sep 25 12:29:17 CEST 2002 === 192.168.10.1 is down, lets call the admin. I was sleeping for | smbclient -M Server but i want: echo Wed Sep 25 12:29:17 CEST 2002 === 192.168.10.1 is down, lets call the admin. I was sleeping for | smbclient -M Server ^^ ^^ missing missing Can anyone tell me where the my mistake is? Cheers, Mario mario -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] dropdown Newbie question
Hello, after a little break ( i really needed it ;P), i tried to get this thing wotkig again. I changed action to .$PHP_SELF. and i added the echo to test if it works: echo $_POST['test']; But still emtpy, what do i do wrong? ?php echo ' form name=test action='.$PHP_SELF.' method=POSTbr select id=colorPicker onChange=changeColor(this.options[this.selectedIndex].value) optionBackground Color option value=FFBlue option value=FFRed option value=00FF00Green option value=00Black /select input type=submit value=Click To View Submission /form '; echo $_POST['test']; ? /body /html From: Jay Blanchard [mailto:[EMAIL PROTECTED]] [snip] Did you put a closing form tag? /form you are right, the closeing tag was missing, well, it still doesnt work/stays emty ;/ [/snip] Does this form refer to itself, or another page? Also, like Justin said, echo the variable before writing to a directory to see what is getting written, if anything. Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] dropdown Newbie question
Hello! I am very new in php and i have a little dummy question ;D I have a dropdown box with a entry in it called Coctail Blue Now i want to put the selected string (Coctail Blue in this case) in to a variable when i press the button below. options.php is the page it should go after. // ..SNIP ... // Start Dropdown echo ' form name=theme action=options.php target=right class=menu nbsp;nbsp;select name=theme'; for($i=0;$isizeof($theme_name);$i++) { echo option value='.$i.'.$theme_name[$i]./option\n; } //end dropdown // Button echo '/selectnbsp;nbsp;input type=submit name=get value=select'; //doesnt work: $var_from_dropdown = theme // ..SNIP ... What did i do wrong? Thank you! Mario -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] dropdown Newbie question
Hi, I tried it but i wasnt luck: // Theme echo ' form name=theme action=options.php target=right class=menu nbsp;nbsp;select name=theme'; for($i=0;$isizeof($theme_name);$i++) { echo option value='.$i.'.$theme_name[$i]./option\n; } echo '/selectnbsp;nbsp;input type=submit name=get value=select METHOD=POST'; // or: echo '/selectnbsp;nbsp;input type=submit name=get value=select METHOD=POST'; $var_from_dropdown = $_POST['theme']; exec(echo $var_from_dropdown /tmp/varfromdropdown); the exec line seems to works since it created the file. But it stays emty. Cheers, Matio From: Scott Houseman [mailto:[EMAIL PROTECTED]] Hi there. The value from that dropdown will be returned to you in the variable $_POST OR $_GET, depending on which method you used to submit the form. Assuming you use POST, you can access the selected value like this: $var_from_dropdown = $_POST['theme']; Regards -|Scott -Original Message- From: Mario Ohnewald [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 05, 2002 1:11 PM To: [EMAIL PROTECTED] Subject: [PHP] dropdown Newbie question Hello! I am very new in php and i have a little dummy question ;D I have a dropdown box with a entry in it called Coctail Blue Now i want to put the selected string (Coctail Blue in this case) in to a variable when i press the button below. options.php is the page it should go after. // ..SNIP ... // Start Dropdown echo ' form name=theme action=options.php target=right class=menu nbsp;nbsp;select name=theme'; for($i=0;$isizeof($theme_name);$i++) { echo option value='.$i.'.$theme_name[$i]./option\n; } //end dropdown // Button echo '/selectnbsp;nbsp;input type=submit name=get value=select'; //doesnt work: $var_from_dropdown = theme // ..SNIP ... What did i do wrong? Thank you! Mario -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] dropdown Newbie question
Well, this is my original Code: -- // Theme echo ' form name=theme action=options.php target=right class=menu METHOD=POST nbsp;nbsp;select name=theme'; for($i=0;$isizeof($theme_name);$i++) { echo option value='.$i.'.$theme_name[$i]./option\n; } echo '/selectnbsp;nbsp;input type=submit name=get value=select'; $var_from_dropdown = $_POST['theme']; exec(echo $var_from_dropdown /tmp/varfromdropdown); The file /tmp/varfromdropdown is still emty. (the dropdown field is NOT emty by the time i press the select button) Any other ideas? From: Jay Blanchard [mailto:[EMAIL PROTECTED]] [snip] // Theme echo ' form name=theme action=options.php target=right class=menu nbsp;nbsp;select name=theme'; for($i=0;$isizeof($theme_name);$i++) { echo option value='.$i.'.$theme_name[$i]./option\n; } echo '/selectnbsp;nbsp;input type=submit name=get value=select METHOD=POST'; // or: echo '/selectnbsp;nbsp;input type=submit name=get value=select METHOD=POST'; $var_from_dropdown = $_POST['theme']; exec(echo $var_from_dropdown /tmp/varfromdropdown); the exec line seems to works since it created the file. But it stays emty. [/snip] You need to place METHOD=POST in the original form tag and remove it from the submit tag. Try that HTH! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] dropdown Newbie question
From: Jay Blanchard [mailto:[EMAIL PROTECTED]] Did you put a closing form tag? /form you are right, the closeing tag was missing, well, it still doesnt work/stays emty ;/ // Theme echo ' form name=theme action=options.php target=right class=menu method=POST nbsp;nbsp;select name=theme'; for($i=0;$isizeof($theme_name);$i++) { echo option value='.$i.'.$theme_name[$i]./option\n; } echo '/selectnbsp;nbsp;input type=submit name=get value=select'; echo '/form'; //i tried it here $var_from_dropdown = $_POST['theme']; exec(echo $var_from_dropdown /tmp/varfromdropdown); //echo '/form'; //and here, to be sure. Of course never toghether! Mario Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php