Jump to content

Recommended Posts

Cant figure out some errors im getting. Im real new to php so small words and lots of pictures are best

Here is my code:
[code]<?php
/******************************************************************************\

*******************************************************************************/
/*******************************************************************************/
// Necessary Variables:

$TO = "[email protected]";
// En: E-Mail of mail recipient.
// Fr: E-Mail pour l'envoie.

$DEFAULT_EXIT_PAGE = "confirm.html";
// En: exit page.
// Fr: page de sortie.

// End  Necessary Variables section
/******************************************************************************/

$headers  = "From: CONTACT FORM $SERVER_NAME <$mail>\n";
$headers .= "FORM MADE BY billy nugz/\n";

$message = "";

while (list($key, $val) = each($HTTP_POST_VARS)) {
$message .= "$key : $val\n";
}

$message .= "\nSent by ".gethostbyaddr($REMOTE_ADDR). " ($REMOTE_ADDR)\n";

mail($TO, $subject, $message, $headers);
// En : Send mail
// Fr : Envoi du mail

if(! $exit_page)
$exit_page = $DEFAULT_EXIT_PAGE;

Header("Location: ".$exit_page);
// Exit -> $exit_page

?>[/code]


Here is the error:

[code]Warning: gethostbyaddr(): Address is not a valid IPv4 or IPv6 address in /var/www/www.chartright.com/test/form/form2mail.php on line 28

Warning: Cannot modify header information - headers already sent by (output started at /var/www/www.chartright.com/test/form/form2mail.php:28) in /var/www/www.chartright.com/test/form/form2mail.php on line 37
; Header("Location: ".$exit_page); // Exit -> $exit_page ?> [/code]

I spoke with a tec and he said it was my code, but this is a bit beond my skill set. Any help would be great
Link to comment
https://forums.phpfreaks.com/topic/28781-php-mailer/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.