Dani AI

Generated

This thread shows two different approaches: suggested keeping the address out of the client-side HTML, and reports the obfuscation attempt failed. Leaving the recipient only on the server is the safest, most robust fix — do not place the final email address in any HTML or predictable JavaScript string.

A practical workflow: have a small HTML form that posts to a server script; keep the real recipient in a server-side config file; validate and sanitize every field; and send mail from the server (or via a library like PHPMailer) so bots never see the address. A minimal PHP receiver might look like this:

<?php
require 'config.php'; // defines RECIPIENT
$name    = trim(filter_input(INPUT_POST, 'name', FILTER_SANITIZE_STRING));
$email   = trim(filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL));
$message = trim(filter_input(INPUT_POST, 'message', FILTER_SANITIZE_STRING));

if (!$email || !$message) {
  http_response_code(400);
  exit('Bad input');
}

// prevent header injection
$email = preg_replace("/[\r\n]/", '', $email);
$headers = "From: {$email}\r\nReply-To: {$email}\r\n";

mail(RECIPIENT, 'Contact form', $message, $headers);

If an image-based solution was used, common failure points are: GD not enabled on the server, wrong Content-Type header or extra whitespace before output (which corrupts images), incorrect image URL/path, or file-permission errors. Quick checks: open the image URL directly (see response headers), inspect the network tab for 404/500 or wrong Content-Type, and confirm phpinfo() shows GD. PHP GD docs and the mail() reference are useful: GD extension and PHP mail().

Finally, add spam defenses: a honeypot field, rate limiting, simple server-side throttling, and consider a CAPTCHA or third-party mailer to improve deliverability and stop automated abuse.

There's no need to hide email addresse in a <form>
no robots can read this !

hide the email in your html with a php script and gd or fixed image.

I have tried that way, it didn't works at all. any other idea!

AM

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.