msg_raw_ip & msg_hdr_ip msg_raw_ip & msg_hdr_ip
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

msg_raw_ip & msg_hdr_ip

Started by boii, October 16, 2003, 04:04:42 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

boii

are these two columns/variables supposed to both be the ip address of the user who posted the comment. during a comment addition, both get stored in the db as the ip address. (i was wodnering if one was supposed to be the hostname).

my table still has the fields for user_host (and user_agent) on comment postings, (and i've modified the code accordingly), and the getenv(USER_HOST) works. so i was just wondering if both fields were supposed to be the ip, and if so, why double it up? :)

(i'm only assuming one is supposed to be the hostname becasue when viewing a comment its form is (x.x.x.x[x.x.x.x]). (by the way, anyoen want the simple mod of also seeing the ip/host in the admin review comments section?

cheers.
ken

Tarique Sani

SANIsoft PHP applications for E Biz

boii

okay in that case.
if anyone is interested in also having a hostname field, i liek to give a quick glance so i can see where the user posted from (ratehr then doing nslookups on each ip).. [i know hostanmes can be spoofed, but youd have to be a real _____ to spoof a hostname on a image gallery :P], then here's the mod to support it (i also threw user_agent in there, just becasue!).

in db_input.php, add:

        $user_host = getenv ("REMOTE_HOST");
        $user_agent = getenv ("HTTP_USER_AGENT");

under the     case 'comment': block with the other variables.

and then, in the same file, find the two lines:

if (!USER_ID) { // Anonymous users, we need to use META refresh to save the cookie
} else { // Registered users, we can use Location to redirect

and edit the input statements below them to add:
, user_host, user_agent,        and   '$user_host','$user_agent'
where appropriate.

then in reviewcom.php where i put it, find the line in commented code comment it out and change to:

                       <!-- <td><b>{$row['msg_author']}</b> - {$msg_date}</td> -->
                        <td><b>{$row['msg_author']}</b> - {$msg_date} : {$row['user_host']}</td>


oh and above it add user_host to the db select query.

cheers.
ken

ps: make sure you add user_host and user_agent columsn to the comments table in the db, and i look at the user_agents in the db, but you can always add it as above to the reviewcom page

lasa

Maybe you could also make some mysql/php code, that it makes the columns....