Move File

NamecheapNamecheap
Watch

NetworkTown.Net

Account Closed
Impact
2
HI

I need some help, im making a small mod for a script i use and i need the following, when i fill in a form in 2 of the feilds it is a drop down menu that list's all the files in the files directory and the other in the images directory.

So what i want is when i select the two files from each of the files e.g:

File: blabla.txt (would be located in content/uploaded/blabla.txt)
Img: blabla.gif (would be located in images/uploaded/blabla.gif)

I want is when i click submit the script will move the files to one directory down so then it will be located as this:

blabla.txt would then be located in content/blabla.txt
blabla.gif would then be located in images/blabla.gif

Please if you could help me i would be pleased.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable Domains — AI StorefrontUnstoppable Domains — AI Storefront
you can http://ca3.php.net/rename if you want
 
0
•••
0
•••
0
•••
(Without seeing your form:) Most likely it would be something like:
Code:
<input name="oldname" type="text"> and <input name="newname" type="text">
If that's how it is, you'd use
PHP:
<?php rename($_POST['oldname'], $_POST['newname']); ?>
 
0
•••
So it would look like this:
PHP:
  <?php

rename($_POST['image'], $_POST['file']);

rename("/images/upload/$_POST['image']", "images/$_POST['image']);

 ?>

Something like that?
 
0
•••
Dynadot — .com TransferDynadot — .com Transfer
CatchedCatched

We're social

Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomainEasy — Payment Flexibility
DomDB
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back