954,123 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Scripts Linux

I have writen a scipts in linux its called user.sh

i wounder how do i run it in a php script

I can if i just run it in command line ./user.sh it works perfect

but can i add it into my code.

thanks

namit
Light Poster
44 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 

I have writen a scipts in linux its called user.sh

i wounder how do i run it in a php script

I can if i just run it in command line ./user.sh it works perfect

but can i add it into my code.

thanks

You sure can do that. Assuming that user.sh is in the same directory as the php page, just use the backtick operator:

[PHP]<?php
`./user.sh`;
?>[/PHP]

If user.sh isn't in the same directory, try using the full path name to user.sh instead of ./user.sh. Good luck.

-Fredric

Daishi
Junior Poster in Training
80 posts since Aug 2005
Reputation Points: 10
Solved Threads: 2
 

no this does not seam to be working

do not know why

namit
Light Poster
44 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 

do i have to set permitions or should it just work?

namit
Light Poster
44 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You