LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-02-2011, 04:33 AM   #1
xerox
Member
 
Registered: Mar 2011
Posts: 43

Rep: Reputation: 0
Unhappy calling script from php page is not working


I have typed the following code:

Code:
<html>
<form enctype="multipart/form-data" action="upload.php" method="POST">
 Please choose a file: <input name="uploaded" type="file" /><br />
 <input type="submit" value="Upload" />
 </form>
</html>
this is my "upload.php" file

Code:
 <?php
shell_exec("cd /usr/local/floder");
shell_exec("./copy.sh");
 $target = "upload/";
 $target = $target . basename( $_FILES['uploaded']['name']) ;
 $ok=1;
 //This is our limit file type condition 
$filename = basename($_FILES['uploaded_file']['name']);
$ext=substr($filename, strrpos($filename, '.') + 1);
 if ($uploaded_type == "text")
 {
 echo "No PHP files<br>";
 $ok=0;

}
        if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
        {
        echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";
        }

 else {
 echo "Sorry, there was a problem uploading your file.  : $ext";
 }
 ?>

the shell script is not is not executed as required....

Kindly check my code...and suggest resolution...
 
Old 03-02-2011, 05:34 AM   #2
kuyalfinator
Member
 
Registered: Jul 2003
Location: Los Angeles
Distribution: RedHat8 2.4.18-14 RedHat9 2.4.20-8 FreeBSD 5.2.1 Ubuntu 10_4 Mandrake 2.4.21-0.13mdk
Posts: 118

Rep: Reputation: 16
Check your spelling?

shell_exec("cd /usr/local/floder");
floder?
 
Old 03-02-2011, 09:08 AM   #3
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 474Reputation: 474Reputation: 474Reputation: 474Reputation: 474
Moved to Programming.
 
Old 03-03-2011, 01:12 AM   #4
xerox
Member
 
Registered: Mar 2011
Posts: 43

Original Poster
Rep: Reputation: 0
I found the solution...and no its not the spelling mistake...

---------- Post added 03-03-11 at 11:43 AM ----------

I found the solution...and no its not the spelling mistake...

Last edited by xerox; 03-03-2011 at 01:14 AM.
 
  


Reply


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] calling bash script in php comp_j Programming 14 07-19-2010 02:39 AM
Calling perl script and passing variable from php script hosea Programming 5 10-21-2008 09:01 AM
Calling a bash script from PHP - permission denied helsing Linux - Server 3 08-21-2008 08:30 AM
calling mplayer -identify via php script? bai_design Programming 8 01-27-2005 02:37 PM
PHP & MySQL, working, and yet getting a blank results page linxtc Programming 5 08-24-2003 05:51 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration