Hello i need some help with a php script that sends email and then it reloades and includes the same site the email form is on.
Now i can only display the echo message "email successfully sent" on the bottom or the right of the page after it reloades, but id like it to be displayed under submit button.
Any ideas?
thanks in advance!
Here the send.php:
<? include 'kontakt.html'; ?>
<div id="form1" ><?
$header = 'MIME-Version: 1.0' . "\r\n";
$header .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$header .= 'From: '.$_POST['firstname'].' '.$_POST['lastname'].' <'.$_POST['email'].'>' . "\r\n";
$html = '<html><body';
echo 'Message successfully sent.';
$html .= 'Name: '.$_POST['firstname'].' '.$_POST['lastname'].'<br>';
$html .= 'Email: '.$_POST['email'].'<br>';
$html .= 'Phone: '.$_POST['phone'].'<br><br>';
$html .= 'Message:'.$_POST['message'];
$html .= '</body></html>';
$studio = $_POST['studio'];
if ($studio == 1) $adress = 'bloodmonic@gmail.com';
if ($studio == 2) $adress = 'bloodmonic@gmail.com';
if ($studio == 3) $adress = 'bloodmonic@gmail.com';
if ($studio == 4) $adress = 'bloodmonic@gmail.com';
if ($studio == 5) $adress = 'bloodmonic@gmail.com';
mail($adress,'Message from styluxhair.de',$html,$header);
?></div>
Here the html file:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta name="description" content="Stylux ist Spezialist für die kosmetische Behandlung von Haarausfall und hat seit 2005 tausende Menschen erfolgreich behandelt.">
<meta name="keywords" content="haarausfall, haare, haarausfall stoppen, Alopezie, alopecia, areata, haarverlust, Haarbehandlungen, Behandlung, glatze, kopfhaut,Kahlköpfigkeit, Geheimratsecken, Schuppen, gegen haarausfall, Haarausfall Frauen Männer, Haarwuchsmittel, Haarwuchs, Ursachen Haarausfall, Stress, hormoneller Haarausfall, erblicher Haarausfall, kreisrunder Haarausfall, diffuser Haarausfall, altersbedingter Haarausfall, Haartransplantation, Transplantation, Propecia, Proscar, Finasterid, Minoxidil, Regaine, anlagebedingt, Hormone, shampoo, Perücke, Zweithaar, Laser">
<title>Stylux | HAIR AND LASER TREATMENT</title>
<meta name="robots" content="index,follow" >
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
<link rel="stylesheet" type="text/css" href="files/style.css">
<link rel="shortcut icon" href="files/images/favicon.ico">
<script language="javascript"> AC_FL_RunContent = 0; </script>
<script type="text/javascript" src="referenzen.php-Dateien/jquery-1.js"></script>
<script type="text/javascript" src="referenzen.php-Dateien/slimbox2.js"></script>
<script language="javascript"> DetectFlashVer = 0; </script>
<script src="referenzen.php-Dateien/AC_RunActiveContent.js" language="javascript"></script>
<script language="JavaScript" type="text/javascript">
<!--
var requiredMajorVersion = 8;
var requiredMinorVersion = 0;
var requiredRevision = 24;
// -->
</script>
</head>
<body>
<div id="center"><div id="wrapper">
<div id="logo"><a href="index.html"><img src="files/images/logo.png" style="border-style: none"></a></div>
<div class="menu">
<table align="right" border="0" cellpadding="0" cellspacing="0" height="29">
<tbody><tr>
<td class="menuitem"><a href="index.html" class="menuitem">Über Stylux</a></td>
<td><img src="files/images/menudivider.png"></td>
<td class="menuitem"><a href="haarausfall.html" class="menuitem">Haarausfall</a></td>
<td><img src="files/images/menudivider.png"></td>
<td class="menuitem"><a href="behandlungsmethoden.html" class="menuitem">Behandlungsmethoden</a></td>
<td><img src="files/images/menudivider.png"></td>
<td class="menuitem"><a href="fragenundantworten.html" class="menuitem">Fragen und antworten</a></td>
<td><img src="files/images/menudivider.png"></td>
<td class="menuitem"><a href="referenzen.html" class="menuitem">Referenzen</a></td>
<td><img src="files/images/menudivider.png"></td>
<td class="menuitem"><a href="links.html" class="menuitem">Links</a></td>
<td><img src="files/images/menudivider.png"></td>
<td class="menuitem"><a href="kontakt.html" class="menuitemsel">Kontakt</a></td>
<td> </td>
</tr>
</tbody></table>
</div>
<div id=Header>
</script><embed src="files/topflash.swf" quality="best" pluginspage="http://www.macromedia.com/go/getflashplayer" play="true" loop="true" scale="noscale" wmode="window" devicefont="false" bgcolor="#ffffff" name="topflash" menu="true" allowscriptaccess="sameDomain" allowfullscreen="false" salign="lt" type="application/x-shockwave-flash" align="left" height="320" width="982"> <noscript>
<a href="http://www.macromedia.com/go/getflash/">Get Flash</a>
</noscript>
</div>
<div id="main">
<div id="links">
<div id="form1">
<div style="float: left; width: 680px;">
<h1>Kontaktieren Sie uns</h1>
<div id=text style="margin-left:15px; margin-right:15px; margin-bottom:15px;">
Um uns eine Email zu schreiben, nutzen Sie bitte dieses Kontaktformular.<br>
Gerne werden wir Ihre Fragen umgehend beantworten.
<br>
<br>
(*) Die mit einem Stern gekennzeichneten Felder sind Pflichtfelder.
</div>
<form name="mailform" method="post" action="send.php" style="margin:15px;">
<table border="0" cellpadding="2" cellspacing="2">
<tbody><tr>
<td align="right">Vorname* </td>
<td><input name="firstname" style="width: 150px;" type="text"> </td>
<td align="right">Nachname* </td>
<td><input name="lastname" style="width: 150px;" type="text"></td>
</tr>
<tr>
<td align="right">Telefon* </td>
<td><input name="phone" style="width: 150px;" type="text"></td>
<td align="right">Email* </td>
<td><input name="email" style="width: 150px;" type="text"> </td>
</tr>
<tr>
<td align="right">Stylux Harstuudio <br>in Ihrer Nähe* </td>
<td><select name="studio" style="width: 150px;">
<option selected="selected" value="1">Hamburg</option>
<option value="2">Stockholm</option>
<option value="3">Göteborg</option>
<option value="4">Borås</option>
<option value="5">Oslo</option>
</select></td>
</tr>
<tr>
<td colspan="4"><br>Ihre Nachricht*<br><textarea name="message" style="width: 100%; height: 150px;"></textarea></td>
</tr>
</tbody></table>
<input value="Senden" type="submit"></form>
</div>
</div>
<div id="form2" style="align:left;">
<div id="hhlux"><img src="files/images/hhlux.png" style="float:right; margin:15px;"></div>
<div id=text style="margin-left:15px; margin-right:15px; margin-bottom:40px; padding-top:35px;">
<h1>Stylux Hamburg</h1>
Neuer Wall 36
<br>
20354 Hamburg
<br>
Tel: +49 (0)40 / 38 64 99 90
<br>
Email:
<a class="blue" href="mailto:hamburg@styluxhair.de">hamburg@styluxhair.de</a>
</div>
</div>
<div id="form2" style="align:left;"">
<div id="hhlux"><img src="files/images/stylux.png" style="float:right; margin:15px;"></div>
<div id=text style="margin-left:15px; margin-right:15px; margin-bottom:40px; padding-top:35px;">
<h1>Stylux Oslo</h1>
Gabelsgt.19
<br>
0272 Oslo
<br>
Tel: +47 22 / 44 55 94
<br>
Email:
<a class="blue" href="mailto:oslo@stylux.no">oslo@stylux.no</a>
</div>
</div>
<div id="form2" style="align:left;"">
<div id="hhlux"><img src="files/images/stylux.png" style="float:right; margin:15px;"></div>
<div id=text style="margin-left:15px; margin-right:15px; margin-bottom:25px; padding-top:35px;">
<h1>Stylux Stockholm</h1>
Strindbergsgatan 52
<br>
115 31 Stockholm
<br>
+46 (0)8 / 41 05 15 00
<br>
T-Karlaplan, uppgång: Valhallavägen, Tessinparken
<br>
Email:
<a class="blue" href="mailto:stockholm@stylux.se">stockholm@stylux.se</a>
</div>
</div>
<div id="form2" style="align:left;"">
<div id="hhlux"><img src="files/images/stylux.png" style="float:right; margin:15px;"></div>
<div id=text style="margin-left:15px; margin-right:15px; margin-bottom:40px; padding-top:35px;">
<h1>Stylux Göteborg</h1>
Vasagatan 21
<br>
411 24 Göteborg
<br>
Tel: +46 (0)31 / 711 19 04
<br>
Email:
<a class="blue" href="mailto:goteborg@stylux.se">goteborg@stylux.se</a>
</div>
</div>
<div id="form2" style="align:left;"">
<div id="hhlux"><img src="files/images/stylux.png" style="float:right; margin:15px;"></div>
<div id=text style="margin-left:15px; margin-right:15px; margin-bottom:15px; padding-top:35px;">
<h1>Stylux Borås</h1>
Västerlånggatan 30-32
<br>
503 30 Borås
<br>
Tel: +46 (0)33 / 430 60 60
<br>
Email:
<a class="blue" href="mailto:boras@stylux.se">boras@stylux.se</a>
</div>
</div>
</div>
<div id="rechts">
<div class="sidebar2"><h1 style="text-align: center;">Kostenlose Beratung</h1>
<p>Nehmen Sie mit uns Kontakt auf, um einen Termin für eine kostenlose Haaruntersuchung und ein Beratungsgespräch zu vereinbaren.</p>
<p>Rufen Sie uns direkt an oder vereinbaren Sie einen Termin online über unser <b><a href="kontakt.html">Kontaktformular.</a></b></p>
<h1 style="text-align: center;">+49 (0)40 / 38 64 99 90</h1>
<center><form name="mailform" method="post" action="send.php">
<br>
<br>
<center><div id="bartxt" style="color: #515356;"><h4>Vorname</h4</div><input name="firstname" style="width: 150px; clear:right; float:right;" type="text">
<br>
<br>
<center><div id="bartxt" style="color: #515356;"><h4>Nachname</h4</div><input name="lastname" style="width: 150px; clear:right; float:right;" type="text">
<br>
<br>
<center><div id="bartxt" style="color: #515356;"><h4>Telefon</h4</div><input name="phone" style="width: 150px; clear:right; float:right;" type="text">
<br>
<br>
<center><div id="bartxt" style="color: #515356;"><h4>Email</h4</div><input name="email" style="width: 150px; clear:right; float:right;" type="text">
<br>
<p><h4>Wo haben Sie uns gefunden?</h4></p>
<br>
<br>
<td><select name="studio" style="width: 150px; float:right;">
<option selected="selected" value="1">Google</option>
<option value="2">U- und S-Bahn</option>
<option value="3">Tageszeitung</option>
<option value="4">Wochenblatt</option>
<option value="5">Magazin</option>
<option value="6">Sonstiges</option>
</select></td>
<br>
<br>
<input value="Senden" type="submit" style="float:right;">
<br>
<br>
</div>
<br>
<div class="sidebar2"><h1 style="text-align: center;">Öffnungszeiten</h1>
<p style="text-align: center;">Montag bis Freitag: 10:00 bis 20:00 Uhr</p>
</div>
<br>
<div class="sidebar2"><h1 style="text-align: center;">Finanzierung</h1>
<p style="text-align: center;"><img src="files/images/medipaylogo.gif"></p>
<p>Durch unseren Partner medipay bieten wir Ihnen eine flexible Lösung für <b><a href="finanzierungsmoglichkeiten.html">Finanzierungsmöglichkeiten</a></b>.</p>
</div><br>
</div>
</div>
<div id=footer><div style="float:left;">copyright stylux 2009 contact <a href="mailto:info@styluxhair.de">info@styluxhair.de</a></div><div style="float: right; padding-right: 19px;"><a href="impressum.html">Impressum</a></div></div>
</div>
</div></div>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-6191579-2");
pageTracker._trackPageview();
} catch(err) {}</script>
</body>
</html>