Nieuw lid |
|
Hallo,
ik ben bezig een formulier te maken en die te laten versturen naar mijn mail. ik heb met IE geprobeerd en doet het gewoon. maar als ik met mozilla probeer doet die het weer niet...kun je dit instellen in het php script zodat hij het ook doet met mozilla?
dit is het script
<?php
session_start();
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="layout.css"
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="">
<meta name="ProgId" content="">
<title>Dgraphs</title>
</head>
<body>
<h1>Action</h1><br>
<?php
if ($_SERVER['REQUEST_METHOD'] != 'POST'){
$me = $_SERVER['PHP_SELF'];
?>
<?php
session_register("SESSION");
?>
<FORM enctype="multipart/form-data" name="actionform" action="verstuur.php" method="POST">
<INPUT type="hidden" name="recipient"
value="silverprova@gmail.com">
<INPUT type="hidden" name="subject" value="HTML">
<INPUT type="hidden" name="required" value="_bedrijfsnaam,_naam,_adres,_plaats,_postcode,_email,_site,_land,">
<p align="left">
Bedrijfsnaam: *
<br>
<input type="text" name="_bedrijfsnaam" size="30">
<br>
<br>
Naam:*
<br>
<input type="text" name="_naam" size="30">
<br>
<br>
Adres: *
<br>
<input type="text" name="_adres" size="30">
<br><br>
Postcode: *
<br>
<input type="text" name="_postcode" size="30">
<br><br>
Plaats: *
<br>
<input type="text" name="_plaats" size="30"><br><br>
Land: *
<br>
<input type="text" name="_land" size="30"><br><br>
E-mail: *
<br>
<input type="text" name="_email" size="30"><br><br>
Site: *
<br>
<input type="text" name="_site" size="30">
<br>
<br>
<textarea name="overig" rows="6" cols="40"> </textarea>
<br>
<br>
</h2>
<input type="reset" value="Annuleren" style="color: #FF0000"><a href="verstuurd.html" target="_blank"><input type="submit" value="Verstuur" name="verstuur" style="color: #FF0000"></a>
</form>
<?php
if {
error_reporting(0);
// initialize a variable to
// put any errors we encounter into an array
$errors = array();
// test to see if the form was actually
// posted from our form
$page = $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
if (!ereg($page, $_SERVER['HTTP_REFERER']))
$errors[] = "Invalid referer\n";
// check to see if a name was entered
if (!$_POST['_bedrijfsnaam'])
$errors[] = "Bedrijfsnaam verplicht";
if (!$_POST['_naam'])
$errors[] = "Naam is verplicht";
if (!$_POST['_adres'])
$errors[] = "Adres is verplicht";
if (!$_POST['_plaats'])
$errors[] = "Plaats is verplicht";
if (!$_POST['_postcode'])
$errors[] = "postcode is verplicht";
if (!$_POST['Land'])
$errors[] = "land is verplicht"
if (!$_POST['_site'])
$errors[] = "Site is verplicht";
if (!$_POST['_email'])
$errors[] = "e-mail is verplicht";
// if there are any errors, display them
if (count($errors) + array(){
echo "<strong>ERROR:<br>\n";
foreach($errors as $err)
echo "$err<br>\n";
}
else {
// no errors, so we build our message
if (!session_is_registered("SESSION")){
$errors[] = "Invalid form submission";
}
if ($_SERVER['REQUEST_METHOD']=="POST"){
// In testing, if you get an Bad referer error
// comment out or remove the next three lines
if (strpos($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST'])
!strpos($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST']))
die("Bad referer");
$msg="Values submitted by the user:\n";
foreach($_POST as $key = $val){
if (is_array($val)){
$msg.="Item: $key\n";
foreach($val as $v){
$v = stripslashes($v);
$msg.=" $v\n";
}
} else {
$val = stripslashes($val);
$msg.="$key: $val\n";
}
}
$var=get_magic_quotes_gpc()?stripslashes($_POST['var']):$_POST['var'];
if(get_magic_quotes_gpc()){
$var1=stripslashes($_POST['var1']);
$var2=stripslashes($_POST['var2']);
}else{
$var1=$_POST['var1'];
$var2=$_POST['var2'];
}
$to="Dgraphs.com <silverprova@gmail.com>";
$from="_bedrijfsnaam";
$subject="My first HTML E-mail";
$mime_boundary="==Multipart_Boundary_x".md5(mt_rand())."x";
$headers = "From: $from\r\n" .
"MIME-Version: 1.0\r\n" .
"Content-Type: multipart/alternative;\n"
" boundary=\"{$mime_boundary}\"\r\n";
$headers.= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers.= "From: $from\r\n";
$message="Content-Type: text/plain; charset=\"iso-8859-1\"\n"
"Content-Transfer-Encoding: 7bit\n\n"
"--{$mime_boundary}\n"
"Content-Type: text/html; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n"
"_bedrijfsnaam , _naam , _plaats , _adres , _land , _site , _email , overig";
error_reporting(0);
if (mail($to, $subject, $message, $headers))
{
echo "http://www.f2a-clan.com/verstuurd.html" target="_blank";
echo nl2br($input);
} else
echo "An error occurred and the message could not be sent, try again or a other way";
} else
echo "Bad request method";
?>
</body>
</html>
<?php ?> <html> <head> <link rel="stylesheet" type="text/css" href="layout.css" <meta http-equiv="Content-Language" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <meta name="GENERATOR" content=""> <meta name="ProgId" content=""> <title>Dgraphs</title> </head> <body> <h1>Action</h1><br> <?php if ($_SERVER['REQUEST_METHOD'] != 'POST'){ $me = $_SERVER['PHP_SELF']; ?> <?php ?> <FORM enctype="multipart/form-data" name="actionform" action="verstuur.php" method="POST"> <INPUT type="hidden" name="recipient" value="silverprova@gmail.com"> <INPUT type="hidden" name="subject" value="HTML"> <INPUT type="hidden" name="required" value="_bedrijfsnaam,_naam,_adres,_plaats,_postcode,_email,_site,_land,"> <p align="left"> Bedrijfsnaam: * <br> <input type="text" name="_bedrijfsnaam" size="30"> <br> <br> Naam:* <br> <input type="text" name="_naam" size="30"> <br> <br> Adres: * <br> <input type="text" name="_adres" size="30"> <br><br> Postcode: * <br> <input type="text" name="_postcode" size="30"> <br><br> Plaats: * <br> <input type="text" name="_plaats" size="30"><br><br> Land: * <br> <input type="text" name="_land" size="30"><br><br> E-mail: * <br> <input type="text" name="_email" size="30"><br><br> Site: * <br> <input type="text" name="_site" size="30"> <br> <br> <textarea name="overig" rows="6" cols="40"> </textarea> <br> <br> </h2> <input type="reset" value="Annuleren" style="color: #FF0000"><a href="verstuurd.html" target="_blank"><input type="submit" value="Verstuur" name="verstuur" style="color: #FF0000"></a> </form> <?php if { // initialize a variable to // put any errors we encounter into an array // test to see if the form was actually // posted from our form $page = $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']; if (!ereg($page, $_SERVER['HTTP_REFERER'])) $errors[] = "Invalid referer\n"; // check to see if a name was entered if (!$_POST['_bedrijfsnaam']) $errors[] = "Bedrijfsnaam verplicht"; if (!$_POST['_naam']) $errors[] = "Naam is verplicht"; if (!$_POST['_adres']) $errors[] = "Adres is verplicht"; if (!$_POST['_plaats']) $errors[] = "Plaats is verplicht"; if (!$_POST['_postcode']) $errors[] = "postcode is verplicht"; if (!$_POST['Land']) $errors[] = "land is verplicht" if (!$_POST['_site']) $errors[] = "Site is verplicht"; if (!$_POST['_email']) $errors[] = "e-mail is verplicht"; // if there are any errors, display them echo "<strong>ERROR:<br>\n"; foreach($errors as $err) } else { // no errors, so we build our message $errors[] = "Invalid form submission"; } if ($_SERVER['REQUEST_METHOD']=="POST"){ // In testing, if you get an Bad referer error // comment out or remove the next three lines if (strpos($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST']) !strpos($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST'])) $msg="Values submitted by the user:\n"; foreach($_POST as $key = $val){ $msg.="Item: $key\n"; foreach($val as $v){ $msg.=" $v\n"; } } else { $msg.="$key: $val\n"; } } }else{ $var1=$_POST['var1']; $var2=$_POST['var2']; } $to="Dgraphs.com <silverprova@gmail.com>"; $from="_bedrijfsnaam"; $subject="My first HTML E-mail"; $mime_boundary="==Multipart_Boundary_x".md5(mt_rand())."x"; $headers = "From: $from\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: multipart/alternative;\n" " boundary=\"{$mime_boundary}\"\r\n"; $headers.= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers.= "From: $from\r\n"; $message="Content-Type: text/plain; charset=\"iso-8859-1\"\n" "Content-Transfer-Encoding: 7bit\n\n" "--{$mime_boundary}\n" "Content-Type: text/html; charset=\"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" "_bedrijfsnaam , _naam , _plaats , _adres , _land , _site , _email , overig"; if (mail($to, $subject, $message, $headers)) { echo "http://www.f2a-clan.com/verstuurd.html" target ="_blank"; } else echo "An error occurred and the message could not be sent, try again or a other way"; } else echo "Bad request method"; ?> </body> </html>
|