<label for"avatar">Avatar:</label> <input type="file" name="avatar" id="avatar" value"<?php if (isset($_FILES['avatar']);?>"
Trying to make Singup fourm
Trying to make Singup fourm
I am trying to make a registration forum that involves a someone to upload a img at the signup process how do i do that so far i have this and i am doing this right?
Last edited by Temor on Tue Jul 03, 2012 1:35 pm, edited 1 time in total.
Reason: Syntax tags
Reason: Syntax tags
Re: Trying to make Singup fourm
Well. That's two lines of code. There is no way to tell if you're doing it right by seeing two lines of code.
Is that all you've got?
Do you know how to make a regular signup form?
Is that all you've got?
Do you know how to make a regular signup form?
Re: Trying to make Singup fourm
Not too sure what you're trying to do exactly... But this is the fastest way:
The form:
The avatar_upload.php file:
You will need to limit filetypes and more securely hold the filesize limit.
The form:
<form action="avatar_upload.php" enctype="multipart/form-data" method="post"> <input type="hidden" name="max_size" value="100000" /> Choose a file to upload: <input name="uploadedfile" type="file" /><br /> <input type="submit" value="Upload File" /> </form>Replace the value of "max_size" to a comfortable, safe amount. That value is 100 KB.
The avatar_upload.php file:
$upload_path = "uploads/"; $upload_path = $upload_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $upload_path)) { echo "You're avatar was uploaded!"; } else{ echo "Something went wrong, oh no!"; }Now, this script was made in 3 minutes.. And there is no safety behind it.
You will need to limit filetypes and more securely hold the filesize limit.