Move File

SpaceshipSpaceship
SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
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
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
you can http://ca3.php.net/rename if you want
 
0
Close
0
Close
0
Close
(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
Close
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
Close
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back