Page 1 of 1

simple net send

Posted: Tue Dec 19, 2006 2:58 am
by Regit
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Im having frustrations... i cannot get php to do a net send, how is this done? or what am I doing wrong?

Code: Select all

<?php
	$output = shell_exec("net send myipaddress test");

	print $output;

?>
I did the above, and nothing was sent. I know this is simple but im not sure why its not working...


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Wed Dec 20, 2006 2:44 pm
by buttie
what result do you get when you try this command (the one called by shell_exec) directly on the command line?

be aware that shell_exec does not work (is disabled) when php is in safe_mode

Posted: Wed Dec 20, 2006 3:22 pm
by Regit
I am getting this error

Fatal error: Call to undefined function shell_exe() in c:\Inetpub\wwwroot\testing fun\netsend.php on line 2

is there something I need to add to the php.ini file? and i am not running php in safe mode

Posted: Wed Dec 20, 2006 3:56 pm
by nickvd
Um... no, but you do need to call the correct function... shell_exec()

Posted: Wed Dec 20, 2006 4:05 pm
by Regit
:) ok i fixed the typo in the code but now it gives me

Code: Select all

Warning: shell_exec() [function.shell-exec]: Unable to execute 'net send tn-sys-386 test' in c:\Inetpub\wwwroot\testing fun\netsend.php on line 2

Posted: Wed Dec 20, 2006 4:27 pm
by Kieran Huggins
Does it work on the command line? if so, copy it exactly into your php document.

Also, remember: php does not necessarily have the same privileges you do, you might need to su to another user. look up the "su - -c" command in linux.

Cheers,
Kieran

Posted: Wed Dec 20, 2006 8:44 pm
by Ollie Saunders
is 'net send' not windows specific?