how to apply css to browse button in file type tag

I wan to apply css to file type browse button.

Page 1 of 1

7 Replies - 5176 Views - Last Post: 22 December 2008 - 06:04 PM Rate Topic: -----

#1 shraddha404  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 22-December 08

how to apply css to browse button in file type tag

Posted 22 December 2008 - 03:22 AM

I want to apply css to file type browse button.
Is This A Good Question/Topic? 0
  • +

Replies To: how to apply css to browse button in file type tag

#2 jjsaw5  Icon User is offline

  • I must break you
  • member icon

Reputation: 90
  • View blog
  • Posts: 3,060
  • Joined: 04-January 08

Re: how to apply css to browse button in file type tag

Posted 22 December 2008 - 06:05 AM

Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Post your code like this: :code:

Thanks.
Was This Post Helpful? 0
  • +
  • -

#3 Valek  Icon User is offline

  • The Real Skynet
  • member icon

Reputation: 542
  • View blog
  • Posts: 1,713
  • Joined: 08-November 08

Re: how to apply css to browse button in file type tag

Posted 22 December 2008 - 05:05 PM

You'll want the HTML & CSS section for that.
Was This Post Helpful? 0
  • +
  • -

#4 ~NJ  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 8
  • View blog
  • Posts: 52
  • Joined: 22-December 08

Re: how to apply css to browse button in file type tag

Posted 22 December 2008 - 05:19 PM

From what I can understand, you want to allow people to upload CSS files via an upload form and validate that the file is in fact a CSS file?

If so, you would need to create and array or string holding values that you would allow as file uploads. In this case:
$allowed_extensions = array('.css');


Next you would grab the filename and extension which I'm sure we all know how to do:
$filename= $_FILES['userfile']['name'];
$extension = substr($filename, strpos($filename,'.'), strlen($filename)-1);


Finally, we will check if the extension is apart of our array, if it isn't we'll stop the script from executing any further...

if(!in_array($extension,$allowed_extensions))
die('You cannot upload this type of file.');


Was This Post Helpful? 0
  • +
  • -

#5 Valek  Icon User is offline

  • The Real Skynet
  • member icon

Reputation: 542
  • View blog
  • Posts: 1,713
  • Joined: 08-November 08

Re: how to apply css to browse button in file type tag

Posted 22 December 2008 - 05:29 PM

Actually, I think they just want to customize the appearance of the Browse button, which doesn't require any PHP.
Was This Post Helpful? 0
  • +
  • -

#6 ~NJ  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 8
  • View blog
  • Posts: 52
  • Joined: 22-December 08

Re: how to apply css to browse button in file type tag

Posted 22 December 2008 - 05:34 PM

Haha! My understanding was COMPLETELY wrong... :P

As for applying CSS to the submit button:
1) This is the wrong forum
2) It's as easy as:
input.file {
color:#FFF;
}


This post has been edited by ~NJ: 22 December 2008 - 05:53 PM

Was This Post Helpful? 0
  • +
  • -

#7 Valek  Icon User is offline

  • The Real Skynet
  • member icon

Reputation: 542
  • View blog
  • Posts: 1,713
  • Joined: 08-November 08

Re: how to apply css to browse button in file type tag

Posted 22 December 2008 - 05:56 PM

View Post~NJ, on 22 Dec, 2008 - 07:34 PM, said:

Haha! My understanding was COMPLETELY wrong... :P


It's okay though. It's always more fun writing PHP anyway ;)

EDIT: Welcome to </dream.in.code>, by the way :)

This post has been edited by Valek: 22 December 2008 - 06:02 PM

Was This Post Helpful? 0
  • +
  • -

#8 ~NJ  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 8
  • View blog
  • Posts: 52
  • Joined: 22-December 08

Re: how to apply css to browse button in file type tag

Posted 22 December 2008 - 06:04 PM

Yes, my heart lies with PHP :)

And thank-you, I'm loving it already!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1