PDA

View Full Version : I need a little help with a form



nycguurl
11-10-2008, 12:32 AM
Hello everyone. Long time no see. :o

In an effort not to have to bother anyone, I have been working on this form for the last 3 days, day and night. It works great now except for one thing. See where the date and time stamp are? They are supposed to be changing with each person who fills in the form, but they are staying the same as what's in the HTML I pasted. Obviously I made a big :eek:

Can someone please tell me what I should be adding (or taking out) so the date and time register accurately?
Thanks so much in advance! :p



<form action="http://www.aweber.com/scripts/addlead.pl" method="post" name="form1">
<input name="user" id="user" value="My name" type="hidden"><a name="errors"></a><a name="errors">
<input name="custom invitername" id="user" value="My name" type="hidden">
<input name="custom inviterusername" id="user" value="My name" type="hidden">
<input name="custom invitermail" id="user" value="Myemail@aol.com" type="hidden">
<input name="custom inviterphone" id="user" value="555-555-5555" type="hidden">
<input type="hidden" value="" id="user" name="custom phone">
<input name="date" id="date" value="11/08/2008 11:56 AM" type="hidden">
<input name="time" id="time" value="11/08/2008 11:56 AM" type="hidden">
<input name="custom date" id="date" value="11/08/2008 11:56 AM" type="hidden">
<input name="custom time" id="time" value="11/08/2008 11:56 AM" type="hidden">
<input name="ipaddress" id="ip" value="96.250.22.67" type="hidden">
<input name="custom ipaddress" id="ip" value="96.250.22.67" type="hidden">
<input name="meta_web_form_id" value="1698772472" type="hidden"><input value="" name="meta_split_id" type="hidden">
<input value="prospects" name="unit" type="hidden">
<input id="redirect_1dd2c22469d63f9f40bff0a086570925" value="http://site.com/thankyou_addlead5.php" name="redirect" type="hidden">
<input value="http://site.com/thankyou_addlead.php" name="meta_redirect_onlist" type="hidden">
<input value="" name="meta_redirect_onlist" type="hidden">
<input value="" name="meta_adtracking" type="hidden"><input value="1" name="meta_message" type="hidden">
<input value="name,from,phone" name="meta_required" type="hidden">
<input value="1" name="meta_forward_vars" type="hidden"></a>
<br>
<br>
<br>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td><font face="Tahoma" size="1" color="#FFFFFF"><strong>Your Name:</strong></font></td>
<td><input type="text" name="name" value size="20"></td>
</tr>
<tr>
<td><font face="Tahoma" size="1" color="#FFFFFF"><strong>Your Email:</strong></font></td>
<td style="padding-top: 2pt"><input type="text" name="from" value size="20"></td>
</tr>
<tr>
<td><font face="Tahoma" size="1" color="#FFFFFF"><strong>Your Phone #:</strong></font></td>
<td style="padding-top: 2pt"><input id="Phone" name="phone" value size="20"></td>
</tr>
<tr>
<td><font face="Tahoma" size="1" color="#FFFFFF"><strong>How did you find me?</strong></font></td>
<td style="padding-top: 2pt"><select size="1" id="how" name="adcode">
<option>Choose One...</option>
<option>Google</option>
<option>YouTube</option>
<option>Email</option>
<option>MySpace ad</option>
<option>Facebook ad</option>
<option>Other</option>
</select></td>
</tr>
<tr>
<td align="center" colspan="2" style="padding-top: 2pt"><input type="submit" name="submit" value="Submit"></td>
<tr>
<td colspan="2" style="padding-top: 5pt">
<div align="center">
<p><font face="Arial" size="2" color="#FFFF66"><strong>We value your
privacy!<br>
</strong>Your info won't be sold or shared with any 3rd party.<br>
You may opt-out at anytime.</font>
</div>
</td>
</tr>
</table>
</form>

Kenny
11-10-2008, 01:20 AM
Well, you should study the date object or put this into your page just before the closing

<script>
document.forms[0].elements[6].value=new Date()

</script>
</body>
</html>

nycguurl
11-10-2008, 05:38 AM
Wow... thank you so much! It worked like a charm! :o

Would I use the same bit of code to make sure the person't unique IP registers, putting "ip" where "Date" was?

Kenny
11-10-2008, 05:41 PM
Sorry, can't help on that one. Ask again with a fresh thread.

nycguurl
11-10-2008, 05:56 PM
Thank you again Kenny. :o
I don't know if people will be annoyed if I start a fresh thread on the same topic, so I'll try here first.

Now that I have the time and date squared away with Kenny's fine help, does anyone out there (looking at my code above) know how to get the person's IP to register uniquely each time someone fills in the form? Right now they're all being reflected as the same one in the code. I tried Kenny's date thing for IP but it didn't apply.

Please help me... :(

rangana
11-11-2008, 02:09 AM
You need server-side for this. PHP:


<input type="text" value="<?php echo $_SERVER['REMOTE_ADDR']; ?>" />


Hope that helps.

nycguurl
11-11-2008, 09:07 PM
Thank you so much! :o

I'm about to look really stupid, but do I totally delete this line?

<input name="ipaddress" id="ip" value="96.250.22.67" type="hidden">


And replace it with yours?

<input type="text" value="<?php echo $_SERVER['REMOTE_ADDR']; ?>" />

rangana
11-11-2008, 11:59 PM
Yes, but with slight modification to match that of yours:


<input type="hidden" name="ipaddress" id="ip" value="<?php echo $_SERVER['REMOTE_ADDR']; ?>" />

nycguurl
11-12-2008, 07:28 AM
Thanks, I'll try it out! ;)