-
Posts
195 -
Joined
-
Last visited
Everything posted by ajetrumpet
-
strategies to prevent spamming out of PHP emails
ajetrumpet replied to ajetrumpet's topic in PHP Coding Help
kicken, this morning I added: v=spf1 include:secureserver.net ~all as a line in a text file and put it in my DNS settings. I have to wait a couple of days for it to be recognized. i'll let u guy know if it works. thanks. -
thanks much sir! I ran it with and without "date_default_timezone_set() and it reverted back to original UTC when it was not included. am I to assume that I have to include this date_default....() function in every script I run if I want to capture the proper time? in this case, I am using include() to one file only to capture the report data, so I won't need it more than once this go round, but does the default timezone only get set once per PHP script?
-
kicken, cuz i'm on shared hosting, i do not have access to the default PHP.ini file or the "httpd.conf" file. But the godaddy agent did say I could add a line in my own PHP.ini file that does what you say: set "HostnameLookups" to "On. If I did this, what does this statement look like? Is it just a line of text that says "set HostnameLookups = true"?? or something different??
-
this code: if (date_default_timezone_get()) { echo 'date_default_timezone_set() function return value : ' . date_default_timezone_get() . '<br /><br />'; } if (ini_get('date.timezone')) { echo 'date.timezone() function return value (presumably set in INI file) : ' . ini_get('date.timezone'); } returns this printout: date_default_timezone_set() function return value : UTC date.timezone() function return value (presumably set in INI file) : UTC I've heard that you can also check in godaddy's cPanel UI what time is listed there, but I cannot find that info in mine. Would that also help?
-
that originally was working for me when I would visit the site and it would return my own isp domain, which is "client.mchsi.com". but now those damn records are returning something different in the time field! does this have something to do with the fact that I am storing the date field as type "DATE" and the time field as type "TIME" in the MYSQL database? There are other type options for both of these 2 fields, like "DATETIME" and "TIMESTAMP".
-
not sure what to think of this. my code is: $time = date("H:i:s", strtotime("+19 hours")); mysqli_report(MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT); $conn = new mysqli($dbHost, $dbUsername, $dbPassword, $dbName); $stmt = $conn->prepare("INSERT INTO tblTraffic (ip, host, page, date, time) VALUES (?, ?, ?, ?, ?)"); $stmt->bind_param("sssss", $ip, $host, $page, $date, $time); what I get is in the attached image. as you can see, it returns correct and incorrect values for the same ISP/IP address, but it returns correct values for a google bot. In the past I was using: date("H:i:s"); ....and I was seeing the same results. e.g. - some IP addresses were producing both correct returns and incorrect returns. this correct/incorrect mix was also happening with various google bot /yandex / msn domains as well. what is up with this guys?
-
strategies to prevent spamming out of PHP emails
ajetrumpet replied to ajetrumpet's topic in PHP Coding Help
thanks kicken. i'll get back to you about the spf addition. for the record, when i get the message from the mail() function, it comes from no-reply@mydomain.com via p3plcpnl0398.prod.phx3.secureserver.net. so I would assume that the DNS entry u recommend would prolly work, given that secureserver.net is in the include string. -
well this person's site doesn't get a lot of traffic kicken, as it only has like 12 pages on it I think, and most of the traffic he gets is from spiders and crawlers. so it might not be a big performance issue with that small of a site. i'll call godaddy and see what they say just for sh*ts and giggles. i'd like to test the variable and see what it does return, as I don't know cuz i've never used it.
-
strategies to prevent spamming out of PHP emails
ajetrumpet replied to ajetrumpet's topic in PHP Coding Help
sometimes i get notifications from this place, and sometimes I don't. and I have gmail. but gmail is VERY good about treating messages that you deem "legitimate", and drag and drop to the "primary inbox" if the message is found in the inbox's "social" or "promotions" folder. but specifying a message and pushing the "not spam" button for a message that was spammed out does nothing a lot of times, as with me sending the messages with the mail() function. -
strategies to prevent spamming out of PHP emails
ajetrumpet replied to ajetrumpet's topic in PHP Coding Help
have you ever used PHPMailer, Barand? If you have, has a message from it ever been spammed out? -
Barand, That's the same page I included in my post. It says under REMOTE_USER that it returns the authenticated user. what does that mean? a remote user that has login credentials for the server they are requesting pages from? also, under REMOTE_HOST, it says: The Host name from which the user is viewing the current page. The reverse dns lookup is based on the REMOTE_ADDR of the user. Note: Your web server must be configured to create this variable. For example in Apache you'll need HostnameLookups On inside httpd.conf for it to exist. See also gethostbyaddr(). I don't think I follow the first line of that. what will a reverse DNS lookup do for me? as u can see in my previous post, I am already using gethostbyaddr(). if I'm already using that, what will turning on HostnameLookups do for me as well?
-
I have done lots of research on this, and I am trying out numerous method to counter this, which includes using mail() function with various arguments for the header, the PHPMailer class libraries and including a TXT file in my DNS settings with Godaddy. as far as mail() is concerned, I have this code: if( empty($errors)) { $to = '$myemail'; $email_subject = "Customer Contact Request Submitted"; $email_body = "A potential customer has sent you their contact information:\r\n\r\n" . "Name: " . $firstname . " " . $lastname . "\r\n" . "Email: ". $email . "\r\n" . "Phone: " . $phone . "\r\n" . "Products Interested In: " . $products_interested_in . "\r\n" . "Message: " . $message; $headers = "From: no-reply@domain.com\r\nReply-To: $email\r\nReturn-Path: $email\r\n"; mail($myemail, $email_subject, $email_body, $headers); echo "Your contact information has been sent. A respresentative will contact you shortly."; } else { echo $errors; } and the message is sent fine, but gmail spams it out every time it's sent regardless of whether it is marked as "not spam" and moved to the inbox. I have not read anything on what can be put in the header argument to try and prevent the spamming out. thoughts anyone? Secondly, I have not yet written the code to call PHPMailer class libraries, but all the experts say it is the most reliable way to send mail. Is PHPMailer messages known to be spammed out too? Thirdly, the TXT file I put in my DNS reads the following, per response #2 on this page: https://stackoverflow.com/questions/43241773/prevent-php-mail-sent-going-to-spam-gmail Type: TXT Host: mydomain.com Value: v=spf1 ip4:myIPaddressHere ~all TTL: Automatic (Godaddy's option for Automatic is "1 hour") I have to wait another 24 hours to see if that will fix the spamming issue. Godaddy requires 48 hours for their server to adopt the new settings. Does this look right to you guys as well? thanks.
-
I think I might have already asked something similar, but... my code has: $ip = gethostbyaddr($_SERVER['REMOTE_ADDR']); $host = $_SERVER['HTTP_HOST']; my field header for "$host" is "VISITOR DOMAIN ADDRESS". I'm not sure what I was thinking. That's not possible to capture is it? Last I read, and I think someone here told me, it is only possible to capture the IP and server name of the requesting computer? the var $ip in my report, for instance, returns: 173-28-199-198.client.mchsi.com if I visit the page, and that is the name of the server assigned to my ISP. on PHP's doc page, there are the vars REMOTE_HOST and REMOTE_USER and I haven't tried those. Their example does not list any return value for those vars. what do they return?
-
setting SMTP in php.ini to make mail() function work
ajetrumpet replied to ajetrumpet's topic in PHP Coding Help
sorry, stupid question. scratch that. -
setting SMTP in php.ini to make mail() function work
ajetrumpet replied to ajetrumpet's topic in PHP Coding Help
maxx, PHPmailer is here: https://github.com/PHPMailer/PHPMailer. but i'm not sure what i'm to do with that. am i spose to download all the files in those directories that are there and then run the PHP composer installer here? https://getcomposer.org/download/. I'm not good enuf to understand complex installations like PHP, Python and stuff altho I manage to use Eclipse and Pythons IDEs fairly well. -
ok guys, another issue for me i cannot find an answer for. according to this thread: https://stackoverflow.com/questions/8803994/php-mail-not-working-for-some-reason, mail() doesn't work when smtp is not configured properly. I checked my server files and I do not have a .ini file. am I spose to have one by default? and, according to this question in the godaddy community: https://www.godaddy.com/community/Using-WordPress/PHP-ini-how-to-make-changes-using-cPanel/td-p/119704, configuration of PHP in general should be done in the .user.ini file instead of in php.ini. the following code, which is what I have now, results in no mail being sent to my address so either my code is wrong or my configs are not set properly I'm guessing: if( empty($errors)) { $to = '$myemail'; $email_subject = "Demo Request Submitted"; $email_body = "A demo request was submitted through your website with the following information:" . "Contact Name: " . $contact . " </br>" . "Company: " . $company . " </br>" . "Email: ". $email . " </br>" . "Phone: " . $phone . " </br>" . "Best Time to Contact: " . $best_time_to_contact . " </br>" . "Message: " . $message; $headers = "From: " . $myemail . "\n"; $headers = "From: $email\r\nReply-To: $email\r\nReturn-Path: $email\r\n"; mail($to, $email_subject, $email_body, $headers); echo "Your demo request has been sent."; } else { echo $errors; } also, in the stackoverflow article I mentioned above, one of the responders suggests using PHPMailer as a better way to send mail using PHP. Is that true? I've always used mail() in the past and I've never been let down in terms of a message *not* being sent. PHP.net says the same thing as the response from stackoverflow as well. thanks!
-
capturing multiple checkboxes' names when submitting form
ajetrumpet replied to ajetrumpet's topic in PHP Coding Help
stupid me. thanks Req. small issue i know.