Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 12-10-2009, 05:45 AM Running Bat file
Skilled Talker

Posts: 97
Trades: 0
I made a file test.bat all that i need is to run this file when the user press submit

this is my coed
PHP Code:
<?php
if(isset($_POST['submit']))
{
echo 
exec('test.bat');
echo 
"Done!";
} else {
// display the form
?>
<form action="" method="post">
<input type="submit" name="submit" value="DO IT!">
</form>
<?php
}
?>
but it did not work well, can anyone one help me in executing a batch file??

because when i press submit the explorer shows loading but the file did not work....

please i need to know how ti fix this problem
john_zakaria is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-10-2009, 05:53 AM Re: Running Bat file
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
And is your host server running Windows?
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-10-2009, 06:03 AM Re: Running Bat file
Experienced Talker

Posts: 48
Name: Pieter
Location: Holland
Trades: 0
Do you want to run it client or server side, because client is imposible.

If you will vieuw your serrver you'll probably see a bat file running
elcosmo is offline
Reply With Quote
View Public Profile
 
Old 12-10-2009, 06:54 AM Re: Running Bat file
Skilled Talker

Posts: 97
Trades: 0
Quote:
Originally Posted by elcosmo View Post
Do you want to run it client or server side, because client is imposible.

If you will vieuw your serrver you'll probably see a bat file running
i have bit defender and firewall is not activated

i tried to write the full path but it did not work

PHP Code:
<?php
shell_exec
("c:\wamp\www\testimonial\CJohnss.bat") or die ("<br><br>Error in executing  file");


?>

and it shows for me the error message
i tried to make the permissions 777 in wamp but also it did not

i think that the problem is in wamp?? right????

do u have any idea
john_zakaria is offline
Reply With Quote
View Public Profile
 
Old 12-10-2009, 07:03 AM Re: Running Bat file
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
The Windows OS has no idea what "777" means
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-10-2009, 10:32 AM Re: Running Bat file
Experienced Talker

Posts: 48
Name: Pieter
Location: Holland
Trades: 0
Does the account your apace server uses have write acces to the location of the .bat file?

user "everybody" should have write permissions in your windows folder.

And the batch should be outside of the web root folder.

Last edited by elcosmo; 12-10-2009 at 10:33 AM..
elcosmo is offline
Reply With Quote
View Public Profile
 
Old 12-13-2009, 02:11 AM Re: Running Bat file
Skilled Talker

Posts: 97
Trades: 0
Quote:
Originally Posted by elcosmo View Post
Does the account your apace server uses have write acces to the location of the .bat file?

user "everybody" should have write permissions in your windows folder.

And the batch should be outside of the web root folder.

how i can make your idea in wamp server?
john_zakaria is offline
Reply With Quote
View Public Profile
 
Old 12-16-2009, 04:36 AM Re: Running Bat file
Experienced Talker

Posts: 48
Name: Pieter
Location: Holland
Trades: 0
this is'nt scripting, this is just windows.

You need to right-click on your www map.
and go to properties, select the sequrity tab.
Give all users read/write rights.

And then it should work.
elcosmo is offline
Reply With Quote
View Public Profile
 
Old 12-16-2009, 04:43 AM Re: Running Bat file
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
Give all users read/write rights
Great plan if your server is open to the Internet! NOT!!

put the batch file in a folder that the Apache service username has "execute" permissions to. DO NOT open the permissions to the entire C: drive, that will be courting disaster!
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Running Bat file
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.41319 seconds with 12 queries