HTML or PHP

rs.top

New Member
Messages
52
Reaction score
0
Points
0
Well, I am making a contact form for people to apply for staff on my game. I am wanting to make it so it requires them to pick certain options. I also want it to show them that their IP is being recorded and with the message, send the persons IP (TO ban spamming IPs). I was wondering how I do this! If can be php or HTML, I don't mind =D/ If a mod or staff sees this, please rename topic to "PHP or HTML, required form options" and then delete this part! Thanks!
 
Last edited:

rs.top

New Member
Messages
52
Reaction score
0
Points
0
I am looking at the code for that, and would it work just to add <code><?php
$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>

<input type="hidden" name="ip" value="<?php echo $ipi ?>" />
<input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />
<input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" />

</code> instead of having to rewrite the whole thing?
 
Last edited:

t2t2t

New Member
Messages
690
Reaction score
0
Points
0
You really don't need to have ip included in form (besides the reason of it could be changed), just have it in mail text, etc:
PHP:
mail('caffinated@example.com', 'My Subject', wordwrap("Line 1\nLine 2\nLine 3", 70));
to
PHP:
mail('caffinated@example.com', 'My Subject', wordwrap("Line 1\nLine 2\nLine 3\nIP: {$_SERVER['REMOTE_ADDR']}", 70));
[noparse](Note that {$_SERVER['REMOTE_ADDR']} only works in case of double quotes, for single ones use:)[/noparse]
PHP:
mail('caffinated@example.com', 'My Subject', wordwrap('Line 1\nLine 2\nLine 3\nIP: '.$_SERVER['REMOTE_ADDR'], 70));
 
Top