depends on your setup. are you using cgi-wrappers?
if your scripts are run as nobody/apache, then i think you will have a lot of difficulty: IIRC you must be root to look at everyone's quotas.
Most setups won't run an SUID script, and cgi-wrappers, suexec etc. are a pain in the arse to set up SECURELY.
My personal suggestion would be to write a script which gets this info from quota and dumps it to a text file the webserver can read. run this script every x minutes from root's crontab, and just parse the text file with your scripts.