Help Needed with Code in eCards - Sent by From IP - Ignorant to PHP Help Needed with Code in eCards - Sent by From IP - Ignorant to PHP
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Help Needed with Code in eCards - Sent by From IP - Ignorant to PHP

Started by suzherm, August 13, 2004, 09:37:39 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

suzherm

I figured out from previous threads what lines I need to change to correct this in the email but I must admit my ignorance to the values.

How do I get this code:

message .= "Sent by $sender_name from IP {$_SERVER['REMOTE_ADDR']} at ".gmstrftime("%A,  %B,%V,%Y %I:%M %p ", time())." [GMT]";

to output this

Sent by Send_Name on August 13, 2004

Is the IP supposed to be my host IP or my URL?

I would love if it could say:

Sent by Sender_Name from www.aupairhost.com

For example:

Sent by suzherm@aupairhost.com from www.aupairhost.com on August 13, 2004

I am struggling with the what to put here

IP {$_SERVER['REMOTE_ADDR']} at ".gmstrftime("%A,  %B,%V,%Y %I:%M %p ", time())." [GMT]";


Right now, this is what comes out on ecards

Sent by tofindamber from IP on Friday, August,33,2004 07:17 PM [GMT]

I am trying to fix what is in bold

skybax

Ok first, you're trying to remove the IP address from the ecard? If so just take out the part in bold:

"Sent by $sender_name from IP {$_SERVER['REMOTE_ADDR']} at ".gmstrftime("%A,  %B,%V,%Y %I:%M %p ", time())." [GMT]"

and replace with:

{$_SERVER["HTTP_HOST"]}

Cut and past the following code for the complete line:
$message .= "Sent by $sender_name from {$_SERVER["HTTP_HOST"]} at ".gmstrftime("%A,  %B,%V,%Y %I:%M %p ", time())." [GMT]";


Changes output from:
Sent by USERNAME from IP xxx.xxx.xxx.xxx at long date of server
To =>:
Sent by USERNAME from www.domian.com at long date of server

This IP that you're changing is the IP of the sender's computer. You could send the host IP, but that's not really nesseciary.
gethostbyname ($SERVER_NAME)

** normally you want some way to handle abuse issues. Having the IP of the sender helps if people are being spammed from your site. They can contact you with the IP info and date stamp... allowing you to resolve the problem. I think this should be a little more descriptive than it is currently. Such as giving a disclaimer with this info listed, but the general reason for this line for troubleshooting or abuse issues.

If you want a complete solution, complete with clickable links, cut and paste the following code:

       $sendToday = date("F j, Y, g:i a");
       $tempDomain = $_SERVER["HTTP_HOST"];
       $tempEmail = explode(".", $tempDomain);
       $tempEmail = "abuse@" . $tempEmail[1] . "." . $tempEmail[2];
       $message .= "Sent by $sender_name [<a href=\"mailto:$sender_email\">$sender_email</a>] from <a href=\"$tempDomain\" target=\"blank\">$tempDomain</a> at $sendToday <br>";
       $message .= "<strong>IMPORTANT:</strong> If you believe this to be spam please email the site admin: <a href=\"mailto:$tempEmail\">$tempEmail</a><br>";
       $message .= "Include these details $sender_name, $sender_email, {$_SERVER['REMOTE_ADDR']}, $sendToday";

*updated code to fix timestamp bug

Outputs:
Sent by username (user@email.com) from www.domain.com at time stamp
IMPORTANT: If you believe this to be spam please email the site admin: abuse@domain.com
Include these details username, user@email.com, xxx.xxx.xxx.xxx, time stamp
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.skybax.com%2FhotImage%2Fpost_footer.gif&hash=338b65c57a59f0b06311094e697c87794e43d945)
Don't contact me for support over PM or email unless I requested you to do so. Instead: post on the proper board.

Nibbler

Also check the bug fix here. There is no 33rd August, I'm sure you already realised that. ;)

skybax

Thanks I fixed it, it slipped my mind and I just copied the old code I had for the timestamp... updated to a simplier form using date()

$sendToday = date("F j, Y, g:i a");

-T 8)
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.skybax.com%2FhotImage%2Fpost_footer.gif&hash=338b65c57a59f0b06311094e697c87794e43d945)
Don't contact me for support over PM or email unless I requested you to do so. Instead: post on the proper board.