Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 06-28-2022, 10:37 AM   #1
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,125
Why isnt this capturing & sending the ip address?

Quote:
<form action="https://www.domain.com/submission.php" method="post">
<input type="text" name="name" id="name" style="width: 180px" value="Full Name" />
<input type="text" name="email" id="email" style="width: 180px" value="Email Address" />
<input type="hidden" name="date" id="date" style="width: 180px" value="June 28, 2022, 12:28 pm" />
<input type="hidden" name="ip" id="ip" style="width: 180px" value="123.12.12.123" />
<input type="submit" value="Get Updates" />
</form>
When I view the source of the page, the ip address shows, it just doesnt seem to be storing it in the DB?

These are the row settings I'm using in the table, are these right?

Row: address
Type: varbinary(16)
Null: No
Default: None

Is there a specific setting needed to store the ip address of a submission? If i use varbinary(16) I get nothing and binary(16) gives me this:

0x00000000000000000000000000000000

__________________
SOMETHING EXTREME IS COMING SOON!
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-28-2022, 10:39 AM   #2
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,125
Oh, and this is how I'm attempting to capture the ip on the form:

Quote:
<input type="hidden" name="ip" id="ip" style="width: 180px" value="<?php echo $_SERVER['REMOTE_ADDR']; ?>" />
__________________
SOMETHING EXTREME IS COMING SOON!
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-28-2022, 10:43 AM   #3
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,125
Nmind, found the issue as soon as posted

I had the wrong form field in the code.
__________________
SOMETHING EXTREME IS COMING SOON!
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-28-2022, 10:51 AM   #4
k0nr4d
Confirmed User
 
k0nr4d's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,228
You could also just use $_SERVER['REMOTE_ADDR'] directly on submission.php which would prevent anyone from manipulating it...
k0nr4d is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-28-2022, 12:02 PM   #5
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,125
Quote:
Originally Posted by k0nr4d View Post
You could also just use $_SERVER['REMOTE_ADDR'] directly on submission.php which would prevent anyone from manipulating it...
Interesting, I didnt even think of that, does that work the same for anything form related, such as time, etc?
__________________
SOMETHING EXTREME IS COMING SOON!
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-28-2022, 12:04 PM   #6
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,125
I'd basically just have to add this right?

Quote:
$address = mysqli_real_escape_string($link, $_SERVER['REMOTE_ADDR']['address']);
__________________
SOMETHING EXTREME IS COMING SOON!
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-28-2022, 12:23 PM   #7
k0nr4d
Confirmed User
 
k0nr4d's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,228
Quote:
Originally Posted by Publisher Bucks View Post
I'd basically just have to add this right?
$address = mysqli_real_escape_string($link, $_SERVER['REMOTE_ADDR']);

It works for time too.
$date = date("F j, Y, g:i a");
k0nr4d is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-28-2022, 12:28 PM   #8
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,125
Quote:
Originally Posted by k0nr4d View Post
$address = mysqli_real_escape_string($link, $_SERVER['REMOTE_ADDR']);

It works for time too.
$date = date("F j, Y, g:i a");
Awesome, thank you for the advice and suggestion
__________________
SOMETHING EXTREME IS COMING SOON!
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-28-2022, 12:48 PM   #9
redwhiteandblue
Bollocks
 
redwhiteandblue's Avatar
 
Industry Role:
Join Date: Jun 2007
Location: Bollocks
Posts: 2,792
Quote:
Originally Posted by Publisher Bucks View Post
Interesting, I didnt even think of that, does that work the same for anything form related, such as time, etc?
Time isn't form related! You can always get the current time on the server with time() which returns a UNIX timestamp, you can convert that into a readable date/time string with date(). If you put it in a hidden input field in the form it will give you the time you served the page to the client, not the time the user submitted it. If you get it when processing the POSTed form it will be the time on the server when the form was received back from the client.
redwhiteandblue is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks

Tags
address, row, varbinary16, default, specific, setting, crap, binary16, submission, store, source, page, view, capturing, sending, table, type, settings, storing, null



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.