flamerail Posted April 16, 2006 Share Posted April 16, 2006 How can I go about this,edit.php?action=rename&filename=test.txtHow can i determin with $_GET that action is set to rename...Thanks! Quote Link to comment Share on other sites More sharing options...
AndyB Posted April 16, 2006 Share Posted April 16, 2006 [code]$doit = $_GET['action'];if ($doit == "rename") { echo "Rename ...."; ... more code ...}[/code] Quote Link to comment Share on other sites More sharing options...
flamerail Posted April 17, 2006 Author Share Posted April 17, 2006 [!--quoteo(post=365407:date=Apr 16 2006, 06:35 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ Apr 16 2006, 06:35 PM) [snapback]365407[/snapback][/div][div class=\'quotemain\'][!--quotec--][code]$doit = $_GET['action'];if ($doit == "rename") { echo "Rename ...."; ... more code ...}[/code][/quote]I got it to work but im having problems with the permissions...Warning: rename(,2314.txt) [function.rename]: Permission denied in C:\website\flamerail\edit\rename.php on line 15Any ideas?[code]<?phpswitch ($_GET['action']) {case rname;print '<form action="?action=rname&filename="'.$_GET['filename'].'" method="post">rename to<input name="rnamed" type="text" /> <input type="submit" name="Submit" value="Submit" /></form>';if ($_GET['action'] == "rname"){ if (isset($rnamed)) {$original = $_GET['filename'];rename($original, $rnamed);} else {print "No rename specified!";}} else {print "action rname not true";}break;}?>[/code] Quote Link to comment Share on other sites More sharing options...
redbullmarky Posted April 17, 2006 Share Posted April 17, 2006 it means that the file does not allow the required permissions to modify (ie, rename) the file. take a look at [a href=\"http://www.php.net/chmod\" target=\"_blank\"]http://www.php.net/chmod[/a] for more on permissions Quote Link to comment Share on other sites More sharing options...
flamerail Posted April 17, 2006 Author Share Posted April 17, 2006 [!--quoteo(post=365489:date=Apr 17 2006, 06:39 AM:name=redbullmarky)--][div class=\'quotetop\']QUOTE(redbullmarky @ Apr 17 2006, 06:39 AM) [snapback]365489[/snapback][/div][div class=\'quotemain\'][!--quotec--]it means that the file does not allow the required permissions to modify (ie, rename) the file. take a look at [a href=\"http://www.php.net/chmod\" target=\"_blank\"]http://www.php.net/chmod[/a] for more on permissions[/quote]The server is windows... it dosnt support chmod. Would I need to copy the file with a new name then unlink the old.... :S Quote Link to comment Share on other sites More sharing options...
flamerail Posted April 18, 2006 Author Share Posted April 18, 2006 [!--quoteo(post=365628:date=Apr 17 2006, 02:54 PM:name=flamerail)--][div class=\'quotetop\']QUOTE(flamerail @ Apr 17 2006, 02:54 PM) [snapback]365628[/snapback][/div][div class=\'quotemain\'][!--quotec--]The server is windows... it dosnt support chmod. Would I need to copy the file with a new name then unlink the old.... :S[/quote]No ideas? Quote Link to comment Share on other sites More sharing options...
Ninjakreborn Posted April 18, 2006 Share Posted April 18, 2006 probably a stupid blank guess here, but is it possible, that you are trying to get the file to access your root directory, and the file is in a sub directory if so you will probably have to add some more commands, to get it to find the sub directory?? just a guess. Quote Link to comment Share on other sites More sharing options...
flamerail Posted April 20, 2006 Author Share Posted April 20, 2006 [!--quoteo(post=365844:date=Apr 17 2006, 10:32 PM:name=businessman332211)--][div class=\'quotetop\']QUOTE(businessman332211 @ Apr 17 2006, 10:32 PM) [snapback]365844[/snapback][/div][div class=\'quotemain\'][!--quotec--]probably a stupid blank guess here, but is it possible, that you are trying to get the file to access your root directory, and the file is in a sub directory if so you will probably have to add some more commands, to get it to find the sub directory?? just a guess.[/quote]There both in a subdirectory... edit.php is in the same dir as the file im trying to rename. Quote Link to comment Share on other sites More sharing options...
Ninjakreborn Posted April 20, 2006 Share Posted April 20, 2006 you may have to rebuild that section for it to work right. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.