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

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
`./user.sh`;
?>

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

no this does not seam to be working

do not know why

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.