First thing: regardless of what language you use, your program *must* run as root in order to add or modify users. Unix has a feature called SUID (Set User ID) that will allow you to make a program run like this.If you have a script called "adduser.cgi", you'd run the following commands as root to make it SUID :
chown root adduser.cgi
chgrp root adduser.cgi
chmod 6755 adduser.cgi
Note that if you modify adduser.cgi in any way, the SUID bits will be disabled, and you'll have to run the chmod command again.
Beyond that, it depends on what language you use. Since you're pressed for time, go with what you know... at some point you'll have to use the Unix useradd command to create the user, so you'll want to pull up the man page for that and study it carefully.
I don't know about PHP, but Perl will automatically places any script running SUID in "taint mode," so read up on that if you're using Perl.
Your best bet may be to write a small C wrapper for useradd. Have it run SUID, and let the rest of your script run normally.