Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


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

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

I have typed the following code:

<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" />
this is my "upload.php" file

shell_exec("cd /usr/local/floder");
 $target = "upload/";
 $target = $target . basename( $_FILES['uploaded']['name']) ;
 //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>";

        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
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");
Old 03-02-2011, 09:08 AM   #3
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
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.


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 > Forums > Non-*NIX Forums > Programming

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

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