Page 1 of 1

PHP form with reference number

Posted: Thu Aug 07, 2003 10:24 am
by yonibensimon
I have a request form that is managed with PHP. On the form, there has to be a reference number that has to be incremented every time a user submits. How do i do that ????

Posted: Thu Aug 07, 2003 10:29 am
by m3rajk
not sure if it'll work when you have 50 million people calling it at the same time, but try ...

$unique_id=uniqid(microtime(), 1);

Posted: Thu Aug 07, 2003 10:35 am
by yonibensimon
What i need is like, a number that starts at 1 then 2, then 3.....
I need a way smaller number than the function you gave me.
The problem is how to memorize at what number it has arrived ?

Posted: Thu Aug 07, 2003 10:40 am
by m3rajk
do you insert this data into a db?

Posted: Thu Aug 07, 2003 10:43 am
by yonibensimon
No

Posted: Thu Aug 07, 2003 10:45 am
by m3rajk
is it an option?

Posted: Thu Aug 07, 2003 10:47 am
by yonibensimon
It has to be here. Take a look at the form:

<HTML>
<HEAD><TITLE>Firewall Request Form</TITLE></HEAD>
<BODY>
<FORM method="post" action="e_firewall_form.php" enctype="multipart/form-data">




<center>
<table cols="3" border="1">
<tr>
<td align="center" colSpan="3" width="690">
<font size="5" color="#FFFFFF"><b>
<span style="background-color: #000066">Firewall Request Form
</span></b></font></td>
</tr>

<tr>
<td align="center" width="690" colspan="4">
<align="center"><b>Requester Information:</b></td>
</tr>

<tr>
<td width="225"><b>Requester: </b> <INPUT NAME="nomRequester" VALUE=""> </td>
<td width="225"><b>Telephone: </b> <INPUT NAME="noTelephone" VALUE="(514) "> </td>
<td width="150"><b>PEIN: <INPUT NAME="noPein" VALUE=""> </td>
</tr>


<TR>
<TD COLSPAN=3 ALIGN=LEFT><FONT SIZE=+1><B>Connectivity Details</B></FONT>
- For any question please visit our <a HREF="faq_e.html" target="_top">FAQ page</a></TD>
</TR>

<TR>
<TD COLSPAN=3><B><FONT SIZE=+1>Section A:</FONT></B> <u><b><font size="2">Complete this section for small firewall requests. If insufficient space exists in Section A, please complete the firewall request template provided in Section B.
</font></b></td>
</TR>

<TR>
<TH><SMALL class="advice"> <FONT COLOR = 'RED'>*</FONT>Source IP:
<INPUT NAME="srcip1" VALUE=""></TH></small>

<TH><SMALL class="advice"><FONT COLOR = 'RED'>*</FONT>Destination IP
<INPUT NAME="destip1" VALUE=""></TH></small>

<TH><SMALL class="advice"> <FONT COLOR = 'RED'>*</FONT>Port(s) / Application(s)</B>
<INPUT NAME="dport1" VALUE=""></TH></small>
</TR>

<TR>
<TH><SMALL class="advice"> <FONT COLOR = 'RED'></FONT>Source IP:
<INPUT NAME="srcip2" VALUE=""></TH></small>

<TH><SMALL class="advice"><FONT COLOR = 'RED'></FONT>Destination IP:
<INPUT NAME="destip2" VALUE=""></TH></small>

<TH><SMALL class="advice"> <FONT COLOR = 'RED'></FONT>Port(s) / Application(s):</B>
<INPUT NAME="dport2" VALUE=""></TH></small>
</TR>

<TR>
<TH><SMALL class="advice"> <FONT COLOR = 'RED'></FONT>Source IP:
<INPUT NAME="srcip3" VALUE=""></TH></small>

<TH><SMALL class="advice"><FONT COLOR = 'RED'></FONT>Destination IP:
<INPUT NAME="destip3" VALUE=""></TH></small>

<TH><SMALL class="advice"> <FONT COLOR = 'RED'></FONT>Port(s) / Application(s):</B>
<INPUT NAME="dport3" VALUE=""></TH></small>
</TR>

<TR>
<TH><SMALL class="advice"> <FONT COLOR = 'RED'></FONT>Source IP:
<INPUT NAME="srcip4" VALUE=""></TH></small>

<TH><SMALL class="advice"><FONT COLOR = 'RED'></FONT>Destination IP:
<INPUT NAME="destip4" VALUE=""></TH></small>

<TH><SMALL class="advice"> <FONT COLOR = 'RED'></FONT>Port(s) / Application(s):</B>
<INPUT NAME="dport4" VALUE=""></TH></small>
</TR>

<TR>
<TH><SMALL class="advice"> <FONT COLOR = 'RED'></FONT>Source IP:
<INPUT NAME="srcip5" VALUE=""></TH></small>

<TH><SMALL class="advice"><FONT COLOR = 'RED'></FONT>Destination IP:
<INPUT NAME="destip5" VALUE=""></TH></small>

<TH><SMALL class="advice"> <FONT COLOR = 'RED'></FONT>Port(s) / Application(s):</B>
<INPUT NAME="dport5" VALUE=""></TH></small>
</TR>

<TR>
<TH><p></TH>
</TR>

<TR>
<TD COLSPAN=3><B><FONT SIZE=+1>Section B:</FONT></B> <u><b><font size="2">For large access requests, please use this <a HREF="SecurityOperationsForm.xls" target="_top">template</a></font></b></u><font size="2">.&nbsp; Once you complete this form, please make sure to use the file upload button to include the completed template into your access request.</font><b><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</font></b></td>
</TR>

<TR>
<TD COLSPAN=3><B>Comments/Explanation:</B><BR>
<TEXTAREA NAME=comments ROWS=4 COLS=60></TEXTAREA></TD>
</TR>

<TR>
<TD COLSPAN=1 ALIGN=LEFT ><B>Reference#</B>
<input NAME="refnum" value="FW20030724-3131" SIZE=20></TD>
</TR>



<TR>
<TD COLSPAN=3 ALIGN=CENTER> <input type="Submit" name="done" value="Submit Firewall Request"></TD>
</TR>

</TABLE>
</CENTER>


<INPUT TYPE=HIDDEN NAME="pein" VALUE="123456">
<INPUT TYPE=HIDDEN NAME="firstname" VALUE="Michel">
<INPUT TYPE=HIDDEN NAME="mail" VALUE="michel@abc123.com">
<INPUT TYPE=HIDDEN NAME="orgcode" VALUE="123456">
<INPUT TYPE=HIDDEN NAME="belltbelldir" VALUE="C">
<INPUT TYPE=HIDDEN NAME="address" VALUE="123 Streer">
<INPUT TYPE=HIDDEN NAME="phonenumber" VALUE="(123) 123-4567">
<INPUT TYPE=HIDDEN NAME="company" VALUE="abc123">
<INPUT TYPE=HIDDEN NAME="title" VALUE="Senior Network Analyst">
<INPUT TYPE=HIDDEN NAME="lastname" VALUE="Spoil">
<INPUT TYPE=HIDDEN NAME="mgrpein" VALUE="40054789">
<INPUT TYPE=HIDDEN NAME="mgrfirstname" VALUE="Michel">
<INPUT TYPE=HIDDEN NAME="mgrlastname" VALUE="Spoil">
<INPUT TYPE=HIDDEN NAME="mgrmail" VALUE="milo@abc123.com">
<INPUT TYPE=HIDDEN NAME="mgrorgcode" VALUE="70701470">
<INPUT TYPE=HIDDEN NAME="mgrbelltbelldir" VALUE="B">
<INPUT TYPE=HIDDEN NAME="mgrphonenumber" VALUE="(123) 456-7896">


<P><P><P><P>
<P><P><P><P>
<P><P><P><P>



</FORM>
</BODY>
</HTML>

Posted: Thu Aug 07, 2003 10:51 am
by m3rajk
1: learn that code and php tags. they're really useful
2: this looks to me like somoene's filling out an error tickect. why does it neeed to be here? the ticket number can easily be assigned by a db (which you SHOULD be using) via an autoincremeted bigint field

Posted: Thu Aug 07, 2003 10:53 am
by yonibensimon
I know it's a bit weird, but my boss wants me to do that...

Posted: Thu Aug 07, 2003 11:07 am
by m3rajk
so you're filling out a trouble shooting request ticket without a db?

my suggestion is you walk over to your boss and ask why you're not making it talk to the db. and if there isn't already one, tell him you want twice as much time to make this and the ability to create the db.

you can then give the person their ticket number so they can call up the information and see it's progress among other features that should delight your boss

Posted: Thu Aug 07, 2003 11:21 am
by yonibensimon
Thank you