Page 1 of 1

Formmailer

Posted: Tue Nov 14, 2006 5:38 pm
by ebichu
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hi Guys

I want to create a Formmailer for my HP, where you have some fields to fill out, and by clicking on submit these information will be sent to my emailadress.
So, the problem is, that I have no Idea of PHP, only HTML. I looked in the Net for a solution, but they didn't run. 
They wrote, that I need 2 Files, one html with the formular, and one PHP which send this formular to me. I used this:

Html file:

Code: Select all

<HTML>  
<HEAD>
<TITLE>Formular</TITLE>
</HEAD>
<BODY>
<form action="  <?
        $message = "";
	if (!empty($HTTP_GET_VARS)) 
	{
		while(list($name, $value) = each($HTTP_GET_VARS))
		$message.="$name = $value\n";
	}
	if (!empty($HTTP_POST_VARS)) 
	{
		while(list($name, $value) = each($HTTP_POST_VARS))
		$message.="$name = $value\n";
	}
		
 	$message=rawurldecode($message);
	$message=str_replace("+", " ", $message);		

    mail("s.waechter@tiscali.ch", "$betreff", $message, "From: $email\nReply-To: $email\nX-Mailer: PHP/" . phpversion(). "\nCC: s.waechter@tiscali.ch");
  
  
  ?>
  <font face="Verdana, Arial, Helvetica">
  <center><b><p/>
  <? 
  echo $thankyou;
  ?>
  <p/>
  <a href="backfromform.html">Zurück</a> zur Indexseite
  </font>
  </b>
  </center>" method="post">
  <input type="hidden" name="thankyou" value="Vielen Dank für Ihre Mail.">
  <input type="hidden" name="betreff" value="Mail vom Form-Mailer.">
  Ihre eMail-Adresse:<input name="eMail"><br>
  Straße: <input name="beliebige"><br>
  Ort: <input name="elemente"><br>
  Nachricht: <textarea name="werdenuebermittelt"></textarea><br>
  <input type="submit"><input type="reset"><br>
</form>


</BODY>
</HTML>
PHP file:

Code: Select all

<HTML>  
<!-- Mailbearbeitung: Angabe absender in email, betreff in betreff, nachricht dass Feedback/bestellung abgeschickt wurde in thankyou 
WICHTIG: Formular leitet zurück auf Seite backfromform.html, diese muss existieren und sollte die Ebene über dem Mailformular sein.
Alternativ ändern Sie bitte den Eintrag in javascript:history.back(); o.Ä.

Bitte Empfänger (vetterheinz@provinz.de) und CC-Empfänger (sie@provider.de) nach Bedarf ändern. 
-->
<HEAD>
<TITLE>eMail versandt</TITLE>
</HEAD>
<BODY>

  <?
        $message = "";
	if (!empty($HTTP_GET_VARS)) 
	{
		while(list($name, $value) = each($HTTP_GET_VARS))
		$message.="$name = $value\n";
	}
	if (!empty($HTTP_POST_VARS)) 
	{
		while(list($name, $value) = each($HTTP_POST_VARS))
		$message.="$name = $value\n";
	}
		
 	$message=rawurldecode($message);
	$message=str_replace("+", " ", $message);		

    mail("myemail", "$betreff", $message, "From: $email\nReply-To: $email\nX-Mailer: PHP/" . phpversion(). "\nCC: myemail");
  
  
  ?>
  <font face="Verdana, Arial, Helvetica">
  <center><b><p/>
  <? 
  echo $thankyou;
  ?>
  <p/>
  <a href="backfromform.html">Zurück</a> zur Indexseite
  </font>
  </b>
  </center>
</BODY>
</HTML>
"myemail" is replaced by my real email adress in my file.

The problem is, I don'd receive anything on my account...

can anybody help? would be great
PS: Sorry for my bad english

pz
ebichu


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Tue Nov 14, 2006 5:44 pm
by feyd
Run the following in a new file and tell us the results please.

Code: Select all

<?php

$neg = array('off', 0, false, '', null);
$flags = array(
	'Register Globals' => 'register_globals',
	'Short Tags' => 'short_open_tag',
	'Display Errors' => 'display_errors',
	'Magic Quotes GPC' => 'magic_quotes_gpc',
	'Magic Quotes Runtime' => 'magic_quotes_runtime',
	'Magic Quotes Sybase' => 'magic_quotes_sybase',
);
$ve = phpversion();
$os = PHP_OS;
$er = intval(error_reporting());
foreach ($flags as $n => $v)
{
	$flags[$n] = (in_array(strtolower(ini_get($v)), $neg) ? 'Off' : 'On');
}
$cli = (php_sapi_name() == 'cli');
$eol = "\n";

$gle = get_loaded_extensions();
$rows = array();
$le = '';
$wide = 4;
$j = count($gle);
$pad = $wide - $j % $wide;
$len = max(array_map('strlen', $gle));
$func = create_function('$a', 'return str_pad($a, ' . intval($len) . ');');
$gle = array_map($func, $gle);
for($i = 0; $i < $j; $i += $wide)
{
	$le .= '   ' . implode('   ', array_slice($gle, $i, $wide)) . $eol;
}

$ec = array(
	'E_STRICT' => 2048, 'E_ALL' => 2047, 'E_USER_NOTICE' => 1024,
	'E_USER_WARNING' => 512, 'E_USER_ERROR' => 256, 'E_COMPILE_WARNING' => 128,
	'E_COMPILE_ERROR' => 64, 'E_CORE_WARNING' => 32, 'E_CORE_ERROR' => 16,
	'E_NOTICE' => 8, 'E_PARSE' => 4, 'E_WARNING' => 2, 'E_ERROR' => 1,
);

$e = array();
$t = $er;
foreach ($ec as $n => $v)
{
	if (($t & $v) == $v)
	{
		$e[] = $n;
		$t ^= $v;
	}
}
if (ceil(count($ec) / 2) + 1 < count($e))
{
	$e2 = array();
	foreach ($ec as $n => $v)
	{
		if (!in_array($n, $e) and $n != 'E_ALL')
		{
			$e2[] = $n;
		}
	}
	$er = $er . ' ((E_ALL | E_STRICT) ^ ' . implode(' ^ ', $e2) . '))';
}
else
{
	$er = $er . ' (' . implode(' | ', $e) . ')';
}

if (!$cli)
{
	echo '<html><head><title>quick info</title></head><body><pre>', $eol;
}

echo 'PHP Version: ', $ve, $eol;
echo 'PHP OS: ', $os, $eol;
echo 'Error Reporting: ', $er, $eol;
foreach ($flags as $n => $v)
{
	echo $n, ': ', $v, $eol;
}
echo 'Loaded Extensions:', $eol, $le, $eol;

if (!$cli)
{
	echo '</pre></body></html>', $eol;
}

?>