homepage Welcome to WebmasterWorld Guest from 54.205.197.66
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
form validation and file uploading
randompunter




msg:1290277
 9:13 pm on Apr 15, 2006 (gmt 0)

Hi, I have a form that has to upload a file, either pdf or cad, this isn't a problem. I can do this and I validate the file type, check its size and use is_uploaded_file().

The problem is that the rest of the form needs to be validated as well and there's alot of fields including emails and phone numbers. I was wondering if there's a way to validate the rest of the form input without uploading the file because the file could be quite large and it would suck to have to upload it twice if a phone number wasn't numeric.

I already use javascript to do client-side validation, but I think I need to use server side validation just in case as well. I was thinking of using opendir but wasn't sure if this would open the clients directory or a server directory and also if the input type wasn't file how would I include the browse button to open a window.

any answers welcome

 

dmmh




msg:1290278
 9:23 pm on Apr 15, 2006 (gmt 0)

you could simply upload the file and re-direct the user to a new script/ page or the same page and have them only enter the fields again that where entered wrong ;)

randompunter




msg:1290279
 9:54 pm on Apr 15, 2006 (gmt 0)

so if I redirect them to the same page to re-enter other fields it won't upload the file a second time. CHeers

dmmh




msg:1290280
 10:01 pm on Apr 15, 2006 (gmt 0)

simple solution to a simple problem :)

sometimes you just need an outsiders view aight? :)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved