Jump to content

PHP Form Handling


kcpaige
 Share

Recommended Posts

Hello everyone, My problem is this, i have built a webpage for my mother who is very computer illeterate. I want her to be able to modify the pages without haveing to look at all the php coding and such, so I made a webpage to do it. I have a form with select boxes and file type boxes. I want to have her check off the rows she wants and to have the files submitted change their names. I'll try to make an example. V Select Buttons V File to upload| x | Picture1: |C:/My Documents/Fred.JPG| |Browse...|| | Picture2: | | |Browse...|| | Picture3: | | |Browse...|| | Picture4: | | |Browse...| |Submit|On Submit I want the Fred.JPG file to be renamed Picture1.JPG for use throughout the webpage. I.E. be uploaded onto the Server with the Picture1.JPG name and not a Fred.JPG name. That seems to be the easiest way but i just can't figure out how to make a PHP file to change the name of a file uploading to it, or really how to use PHP to upload files on a server. Can anyone help???

Link to comment
Share on other sites

I also forgot...I have a PHP page "images.php" which is similar to this

<?php$Picture1='/images/Picture1.JPG';$Picture2='/images/Picture2.JPG';$Picture3='/images/Picture3.JPG';$Picture4='/images/Picture4.JPG';?>

Idk if i could keep the Fred.JPG the same name and just have a script modify this code to something like

<?php$Picture1='/images/Fred.JPG';$Picture2='/images/Picture2.JPG';$Picture3='/images/Picture3.JPG';$Picture4='/images/Picture4.JPG';?>

This seems to be a harder way but it was the original intent of having a page with all image paths stored as varibles on a sepreate page. I don't really know how to use the fopen("images.php", "a") or w very well. I can only use that function to write at the end of a file but not really modify contents already there. Any fix to this would be a large help, thanxs in advance.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...