View Full Version : requesting a form processor
AnOdeToNoOne
07-29-2002, 05:59 PM
I was helped in the CGI forum by Spookster, and he had said that he had done a script very similar to the one i was requesting and gave a link to it [here (http://www.codingforums.com/showthread.php?s=&threadid=2276)]
only thing is i dont know howto set it up to print out into a template sort of deal. and i do need an upload feature that would work like:
user gives path to file to upload to site, and then php script uses that url as his "image" on his biography... perferrably only allowing jpg and gif of a certain size. or relitive size.
------------------------
but maybe i can show you wut im trying to do, to give you a better understanding. and maybe go from there?
http://www.dancecity.net/cs/mage111/bio2.html
thats wut the output should look like.
form will be asking:
full name
alias (which will be put in those brackets)
age
location
Email, icq, AIM, YIM, MSN... and if they are not filled in then they are left with a #
and then
Favorite wep (kinda wanna make a drop down menu)
Favorite map
Quote
-----------------
the one big problem is: i cant use MySQL, so thats why it has to be outputted to a HTML file :/
but i thankyou for reading this, and thankyou for any help anyone has to offer :-)
Peace
AnOdeToNoOne
08-02-2002, 08:46 PM
small bump
Spookster
08-02-2002, 11:08 PM
How are all the files going to be structured? Are all the bio pages going to be in the same directory as well as the photos? Or is each person going to have their own directory with their bio and photo?
AnOdeToNoOne
08-03-2002, 11:20 PM
each photo and bio page will be in the same directory as the photo's
edit: URL now works. srry didnt kno it was broke
Spookster
08-04-2002, 07:36 AM
Ok since you are planning on having everything in the same directory this gets a bit more tricky. This is because of file names. Since you are creating static html pages then you have to devise a naming scheme so that no conflicts in names arise. If there are going to be many bio pages using the persons name is not wise as there could be more than one person with the same name. The same thing applies to the photos. Obviously the image file name will have to be changed after they upload it so a naming scheme for those will have to be devised so as to prevent conflicts in file names.
Will these people have to register to use the site and be assigned a user id or username or something?
AnOdeToNoOne
08-04-2002, 08:42 AM
ok forgive me im quite drunk while im writing this: yuo said its going to be kinda tricky because of the naming of files.
when the PHP program does its thing, could it extract the username from the form, and rename the output HTML and the .jpg/.gif to that name?
would that be possible or is there an easier way...
sorry kinda drunk n ideas are on low :p
LALA
Spookster
08-04-2002, 06:15 PM
Yes if the username is in the same form as the one being used for filling in the info for the bio page and uploading the image. The username can be used for the file names.
Will the usernames be unique?
AnOdeToNoOne
08-04-2002, 08:53 PM
yeh the form will be asking like
First name
Username/alias
Last name
and be displayed
John (n00bie) Doe
so in short, yes it will be unique depending on the persons alias used in the clan
Spookster
08-04-2002, 10:40 PM
Is there something else in place already that ensures that two people will not use the same username?
AnOdeToNoOne
08-05-2002, 11:23 AM
hmmm besides the fact that noone in the clan has same user name that they would fill form out with... only thing i can suggest is that if someone uses the same name more then once...
it creates the HTML page and jpg/gif image like
username.html - username.jpg
username(1).html - username1.jpg
username(2).html - username2.jpg
dillieo
08-05-2002, 04:16 PM
I did something similar to this a while back and a quick option that might help would be to create a file that simply has the list of user names already created. When a user goes to create their profile, you can open the file, do a simple find and see if the name already exists, and if it does, report an error message telling them to choose another user name. Similarly, if the username doesn't exist, you can then write that user name into the file and continue with the process. Hope this helps...
AnOdeToNoOne
08-05-2002, 04:19 PM
if its not too much trouble, that may be a good addition to it...
but if spookster is going to work on it, its his call... im only greatful of the help so far :-)
Spookster
08-05-2002, 05:38 PM
That's a very good suggestion. The only other option would be to scan the filenames in the directory which could take a bit longer. How many people do you anticipate having bio pages?
AnOdeToNoOne
08-05-2002, 06:17 PM
initially there will be approximately 50-60, this clans one if not thee largest clan in canada, and we can members at a high rate imho.
so, its more or less an ongoing list.
Spookster
08-05-2002, 06:35 PM
Since you don't utilize a database for this then I guess you have no choice but to just use a text file to store the data. If it starts getting really large then it could slow things down a bit.
So to summarize...
User goes to form (btw you should post the code for your form) and fills out the form.
When form is submitted it will open up the username file and check to see if username already exists. If it does, print a message saying sorry try another name. If it doesn't then adds their name and generates the html page with the info they submitted along with the photo.
Question: Is the photo going to be a requirement? If not a default image can be placed in the page instead stating no photo available.
As for the html and image file names, once the image is uploaded the file name will be changed to the username of the person and the html page will be named as the username.
Question: Do you wish that they be redirected to their newly created bio page?
AnOdeToNoOne
08-05-2002, 07:55 PM
Question: Is the photo going to be a requirement? If not a default image can be placed in the page instead stating no photo available.
yes, if it helps its called "ct.gif" (or it will be if you use that), and will be located in the same DIR as the rest of the files. i figure its better to have something rather then nothing. keeps it a little more well done.
as for redirection, not nessesary, me n the other webmaster will need to work on there profiles a bit to add certain clan statistics. from there we manually link em all up.. uhg... cant wait till we get a server wiff a database
anywho, i think thats all that
Spookster
08-05-2002, 11:46 PM
Also are you implementing specific file size and dimensions limitations on the photo?
btw post the code for the form.
AnOdeToNoOne
08-06-2002, 01:21 AM
i would like height and width: 125x115 (in that order HxW), as for restricting them if size dont match, i would like it if it would just force it to the size, even if it looks bad we can change it.
and for my form, you may edit the values obviously to suit the script, sorry for not posting it sooner had to remake one cus other one lost ina crash :/
DCN Profile makeup. <br>
Fill out all the blank spaces possible, dont forget the ones marked in the <font color="#CC0000">*</font>,
they need to be filled out</font><br>
<form name="form1" method="post" action="" enctype="multipart/form-data">
<table width="520" border="1" cellspacing="0" cellpadding="0" bordercolor="#000000">
<tr bgcolor="#000000">
<td colspan="2">
<div align="center"><font face="Verdana" size="2">Personal Information</font></div>
</td>
</tr>
<tr>
<td width="120"> <font face="Verdana" size="2">
<input type="text" name="First Name">
</font></td>
<td width="388"><font face="Verdana" size="2">First Name</font></td>
</tr>
<tr>
<td width="120"> <font face="Verdana" size="2">
<input type="text" name="Last Name">
</font></td>
<td width="388"><font face="Verdana" size="2">Last Name</font></td>
</tr>
<tr>
<td width="120"> <font face="Verdana" size="2">
<input type="text" name="Alias">
</font></td>
<td width="388"><font face="Verdana" size="2"> Alias (DCN name, leave
out DCN)</font></td>
</tr>
<tr>
<td width="120"> <font face="Verdana" size="2">
<input type="text" name="Location">
</font></td>
<td width="388"><font face="Verdana" size="2">Location</font></td>
</tr>
<tr bgcolor="#000000">
<td colspan="2">
<div align="center"><font face="Verdana" size="2">Contact Information</font></div>
</td>
</tr>
<tr>
<td width="120"> <font face="Verdana" size="2">
<input type="text" name="Age">
</font></td>
<td width="388"><font face="Verdana" size="2">Age</font></td>
</tr>
<tr>
<td width="120"> <font face="Verdana" size="2">
<input type="text" name="Email">
</font></td>
<td width="388"><font face="Verdana" size="2">Email</font></td>
</tr>
<tr>
<td width="120"> <font face="Verdana" size="2">
<input type="text" name="AIM">
</font></td>
<td width="388"><font face="Verdana" size="2">AIM</font></td>
</tr>
<tr>
<td width="120"> <font face="Verdana" size="2">
<input type="text" name="ICQ">
</font></td>
<td width="388"><font face="Verdana" size="2">ICQ</font></td>
</tr>
<tr>
<td width="120"> <font face="Verdana" size="2">
<input type="text" name="MSN">
</font></td>
<td width="388"><font face="Verdana" size="2">MSN</font></td>
</tr>
<tr>
<td width="120"> <font face="Verdana" size="2">
<input type="text" name="YIM">
</font></td>
<td width="388"><font face="Verdana" size="2">YIM</font></td>
</tr>
<tr bgcolor="#000000">
<td colspan="2">
<div align="center"><font size="2" face="Verdana">Biography Information</font></div>
</td>
</tr>
<tr>
<td width="120"> <font face="Verdana" size="2">
<input type="text" name="favweapon">
</font></td>
<td width="388"><font face="Verdana" size="2">Favorite Weapon</font></td>
</tr>
<tr>
<td width="120"> <font face="Verdana" size="2">
<input type="text" name="favmap">
</font></td>
<td width="388"><font face="Verdana" size="2">Favorite Map</font></td>
</tr>
<tr>
<td width="120"> <font face="Verdana" size="2">
<input type="text" name="favquote">
</font></td>
<td width="388"><font face="Verdana" size="2">Favorite Qupte</font></td>
</tr>
<tr>
<td width="120"><font face="Verdana" size="2">
<input type="file" name="image upload">
</font></td>
<td width="388"><font face="Verdana" size="2">Upload pic of yourself (not
required)</font></td>
</tr>
</table>
</form>
thanks once again.
*god*
:p
Spookster
08-07-2002, 02:08 AM
Your form doesn't have fields for units, rank or commendations. And is the Name suppose to be their real name or their alias?
AnOdeToNoOne
08-07-2002, 04:51 AM
<tr>
<td width="120"> <font face="Verdana" size="2">
<input type="text" name="First Name">
</font></td>
<td width="388"><font face="Verdana" size="2">First Name</font></td>
</tr>
<tr>
<td width="120"> <font face="Verdana" size="2">
<input type="text" name="Last Name">
</font></td>
<td width="388"><font face="Verdana" size="2">Last Name</font></td>
</tr>
<tr>
<td width="120"> <font face="Verdana" size="2">
<input type="text" name="Alias">
</font></td>
<td width="388"><font face="Verdana" size="2"> Alias (DCN name, leave
out DCN)</font></td>
</tr>
i put
First name (real)
Last name (real)
Alias (DCN name, leave out DCN) (DCN name)
as for the commendations, unit, and all that... we will add all that information...
but the output will have the places for that for us to edit later in the html file i showed you.
Spookster
08-07-2002, 05:08 AM
I was referring to the Name in this page:
http://www.dancecity.net/cs/mage111/bio2.html
Is that suppose to be their real name or their alias?
AnOdeToNoOne
08-07-2002, 08:32 PM
DCN Alias for the title
with a DCN- prefix if possible
Spookster
08-07-2002, 10:59 PM
Ok but is this part suppose to be their real name or alias?
Name:
Hazling <-- Is that suppose to be the real name or an alias?
AnOdeToNoOne
08-07-2002, 11:12 PM
Terribley sorry... i looked @ it and was talking to my friend next to me while replying so i wasnt paying a whole lotta attention
as far as Name: go's i wanted it to output in a manner such as
First Name (DCN-Alias) Last Name
color red = php output from form
color blue = prefix
DCN- again a prefixxed in the brackets, then there name)
(reason i want it Prefixxed is because some members dont doit in the format we tend to push on our members)
sorry for the stupidity spookster :/
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.