Reg Web Posted October 22, 2006 Share Posted October 22, 2006 Is there a way you can fetch the IP address of a user, then add it into a hidden field on a form using a mysql table? Quote Link to comment https://forums.phpfreaks.com/topic/24741-ip-in-forms/ Share on other sites More sharing options...
redbullmarky Posted October 22, 2006 Share Posted October 22, 2006 [code]<form name="myform"><input type="hidden" name="myhiddenfield" value="<?php echo $_SERVER['REMOTE_ADDR']; ?>" /></form>[/code]not sure why you'd need mysql at all to do this, but the above will create a hidden field with the user's IP address in it.cheersMark Quote Link to comment https://forums.phpfreaks.com/topic/24741-ip-in-forms/#findComment-112664 Share on other sites More sharing options...
LazyJones Posted October 22, 2006 Share Posted October 22, 2006 IP address can be fetched from predefined variable $_SERVER['REMOTE_ADDR']more on subject: [url=http://www.php.net/manual/en/reserved.variables.php#reserved.variables.server]http://www.php.net/manual/en/reserved.variables.php#reserved.variables.server[/url] Quote Link to comment https://forums.phpfreaks.com/topic/24741-ip-in-forms/#findComment-112665 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.