form html e php nella stessa pagina

reeko

Nuovo Utente
21 Apr 2015
9
0
0
ciao a tutti
ho "di nuovo" un problema con il form e l'invio mail, ho ripreso l'ultimo form che con vs aiuto avevo sistemato, ma non mi funziona....
questo il codice html e php in fondo alla pagina:
tra l'altro se pubblico la pagina m,i compare il testo :

window.location.href = "grazie_altura.html"


<!DOCTYPE HTML>
<html>
<head>
<title>:: ALTURA VELA | CORSI PATENTE NAUTICA 2015 - HOME ::</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!--[if lte IE 8]><script src="assets/js/ie/html5shiv.js"></script><![endif]-->
<link rel="stylesheet" href="assets/css/main.css" />
<!--[if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->
<!--[if lte IE 9]><link rel="stylesheet" href="assets/css/ie9.css" /><![endif]-->
</head>
<body class="index">
<div id="page-wrapper">

<!-- Header -->
<header id="header" class="alt">
<h1 id="logo"><a href="index.html">ALTURA VELA <span>PATENTI 2015</span></a></h1>
<nav id="nav">
<ul>
<li class="current"><a href="#main" class="button fit scrolly" >ALTURA</a></li>
<li><a href="#info" class="button fit scrolly" >INFO</a></li>
<li><a href="#contatti" class="button fit scrolly">CONTATTI</a></li>
</ul>
</nav>
</header>

<!-- Banner -->
<section id="banner">

<!--
".inner" is set up as an inline-block so it automatically expands
in both directions to fit whatever's inside it. This means it won't
automatically wrap lines, so be sure to use line breaks where
appropriate (<br />).
-->
<div class="inner">

<header>
<h2>CORSI PATENTE NAUTICA</h2>
<h2>2 0 1 5</h2>
</header>
<p>ENTRO 12 MIGLIA<strong>€ 390,00</strong>
<br />

<br />


<p>SENZA LIMITI DALLA COSTA<strong>€ 490,00</strong></p>
<br />

<br />

<p><a href="http://www.alturavela.it/corsi_patente_nautica_roma/contatti.html" class="button2 fit scrolly" ><strong>COMPILA IL MODULO E ADERISCI ALL'OFFERTA</strong></a>.</p>


<footer>
<ul class="buttons vertical">
<li><a href="#info" class="button fit scrolly">chiedi piu info</a></li>
</ul>
</footer>

</div>

</section>

<!-- Main -->
<article id="main">

<header class="special container">
<a href="index.html"><img src="images/banner-text_2.png" alt=""></a>
<br />
<br />

<!-- <span class="icon fa-bar-chart-o"></span> -->
<h2><STRONG>AVVICINATI AL MARE E NAVIGA CON CONSAPEVOLEZZA E SICUREZZA</STRONG></h2>
<H3>ADERISCI ALL'OFFERTA STRAORDINARIA PER IL</H3>
<H2><strong> IL CORSO PATENTE NAUTICA CON ALTURA</strong></h2>

<H4>IL <STRONG>MODO MIGLIORE</STRONG> PER IMPARARE A NAVIGARE E FARE AMICIZIE <STRONG>NELL’AMBIENTE DEL MARE E DELLA VELA.</STRONG></H4>
<br />
<H3>L’EQUIPAGGIO DI <STRONG>ALTURA </STRONG></H3>
<H2><STRONG>TI ASPETTA A VELE SPIEGATE</STRONG> </H2>

<br /><br />
<H3>Per il conseguimento della patente nautica<strong> ECCO LE DIVERSE SOLUZIONI:</strong> </H3>
<H2>Corso per Patente Nautica <STRONG>ENTRO LE 12 MIGLIA:</STRONG> <strong>€ 390,00</strong></H2>
<H2>Corso per Patente Nautica <STRONG>SENZA LIMITI DALLA COSTA:</STRONG> <strong>€ 490,00</strong></H2>
<br />

<p><a href="http://www.alturavela.it/corsi_patente_nautica_roma/contatti.html" class="button2 fit scrolly" ><strong>COMPILA IL MODULO E ADERISCI ALL'OFFERTA</strong></a>.</p>



</header>

<!-- One -->
<article id="info">
<section class="wrapper style2 container special-alt">

<div class="row 50%">
<!-- <div class="8u 12u(narrower)"> -->

<header>
<h2>Patente Nautica <strong>ENTRO 12 MIGLIA</strong></H2>
<H3>Durata del corso: </H3>
<H3>2 mesi con una lezione (teorica) settimanale di 2 ore. Numero max allievi: <STRONG>11</STRONG></H3>
<P>il numero chiuso permette all'istruttore di effettuare interventi personalizzati)</P>
<br /><br />
<h2>Patente Nautica <strong>SENZA LIMITI</strong> <BR></h2>
<H3>Durata del corso: </H3>
<H3>4 mesi con una lezione (teorica) settimanale di 2 ore. Numero max allievi: <STRONG>11</STRONG></H3>
<P>il numero chiuso permette all'istruttore di effettuare interventi personalizzati)</P>
<br /><br />

<H2><STRONG>SEDI E ORARI</STRONG></H2>

<H5><STRONG>Lezioni Teoriche: </STRONG> </H5><h5>nella sede di Altura a Trastevere. Dal Lunedì al Giovedì nei seguenti orari: 19-21 e 21-23.</H5>
<H5><STRONG>Lezioni Pratiche: </STRONG> </H5><h5>si tengono a Fiumicino e hanno la durata di mezza giornata: 9-13 e 13-17</H5>
<br />
<H4><STRONG>MATERIALI E ASSISTENZA</STRONG></H4>
<p>Materiale didattico e assistenza degli istruttori agli esami teorico-pratici sono <STRONG>SEMPRE INCLUSI</STRONG> nella quota di partecipazione a tutti i corsi per patente nautica. </p>
<br />
<H4><STRONG>ESAMI FINALI</STRONG></H4>

<h5><strong>Al termine dei corsi, la scuola vela Altura presenta i suoi allievi presso le sedi provinciali della Motorizzazione Civile per le abilitazioni entro 12 miglia e presso la Capitaneria di Porto di Fiumicino per le abilitazioni senza limiti.</strong></h5> <h5><strong>In caso di mancata promozione, Altura si impegna a continuare il corso gratuitamente sino alla promozione.</strong></h5>



</header>
<!-- <footer>
<ul class="buttons">
<li><a href="#" class="button">Find Out More</a></li>
</ul>
</footer>

-->


</div>


<!--
<div class="4u 12u(narrower) important(narrower)">

<ul class="featured-icons">
<li><span class="icon fa-clock-o"><span class="label">Feature 1</span></span></li>
<li><span class="icon fa-volume-up"><span class="label">Feature 2</span></span></li>
<li><span class="icon fa-laptop"><span class="label">Feature 3</span></span></li>
<li><span class="icon fa-inbox"><span class="label">Feature 4</span></span></li>
<li><span class="icon fa-lock"><span class="label">Feature 5</span></span></li>
<li><span class="icon fa-cog"><span class="label">Feature 6</span></span></li>
</ul>

</div>

-->

</section>
</div>



<!-- Two -->
<!-- <section class="wrapper style1 container special">
<div class="row">
<div class="4u 12u(narrower)">

<section>
<span class="icon featured fa-check"></span>
<header>
<h3>This is Something</h3>
</header>
<p>Sed tristique purus vitae volutpat ultrices. Aliquam eu elit eget arcu commodo suscipit dolor nec nibh. Proin a ullamcorper elit, et sagittis turpis. Integer ut fermentum.</p>
</section>

</div>
<div class="4u 12u(narrower)">

<section>
<span class="icon featured fa-check"></span>
<header>
<h3>Also Something</h3>
</header>
<p>Sed tristique purus vitae volutpat ultrices. Aliquam eu elit eget arcu commodo suscipit dolor nec nibh. Proin a ullamcorper elit, et sagittis turpis. Integer ut fermentum.</p>
</section>

</div>
<div class="4u 12u(narrower)">

<section>
<span class="icon featured fa-check"></span>
<header>
<h3>Probably Something</h3>
</header>
<p>Sed tristique purus vitae volutpat ultrices. Aliquam eu elit eget arcu commodo suscipit dolor nec nibh. Proin a ullamcorper elit, et sagittis turpis. Integer ut fermentum.</p>
</section>

</div>
</div>
</section>

<!-- Three -->
<!-- <section class="wrapper style3 container special">

<header class="major">
<h2>Next look at this <strong>cool stuff</strong></h2>
</header>

<div class="row">
<div class="6u 12u(narrower)">

<section>
<a href="#" class="image featured"><img src="images/pic01.jpg" alt="" /></a>
<header>
<h3>A Really Fast Train</h3>
</header>
<p>Sed tristique purus vitae volutpat commodo suscipit amet sed nibh. Proin a ullamcorper sed blandit. Sed tristique purus vitae volutpat commodo suscipit ullamcorper sed blandit lorem ipsum dolore.</p>
</section>

</div>
<div class="6u 12u(narrower)">

<section>
<a href="#" class="image featured"><img src="images/pic02.jpg" alt="" /></a>
<header>
<h3>An Airport Terminal</h3>
</header>
<p>Sed tristique purus vitae volutpat commodo suscipit amet sed nibh. Proin a ullamcorper sed blandit. Sed tristique purus vitae volutpat commodo suscipit ullamcorper sed blandit lorem ipsum dolore.</p>
</section>

</div>
</div>
<div class="row">
<div class="6u 12u(narrower)">

<section>
<a href="#" class="image featured"><img src="images/pic03.jpg" alt="" /></a>
<header>
<h3>Hyperspace Travel</h3>
</header>
<p>Sed tristique purus vitae volutpat commodo suscipit amet sed nibh. Proin a ullamcorper sed blandit. Sed tristique purus vitae volutpat commodo suscipit ullamcorper sed blandit lorem ipsum dolore.</p>
</section>

</div>
<div class="6u 12u(narrower)">

<section>
<a href="#" class="image featured"><img src="images/pic04.jpg" alt="" /></a>
<header>
<h3>And Another Train</h3>
</header>
<p>Sed tristique purus vitae volutpat commodo suscipit amet sed nibh. Proin a ullamcorper sed blandit. Sed tristique purus vitae volutpat commodo suscipit ullamcorper sed blandit lorem ipsum dolore.</p>
</section>

</div>
</div>

<footer class="major">
<ul class="buttons">
<li><a href="#" class="button">See More</a></li>
</ul>
</footer>

</section>

</article>

<!-- CTA -->
<!-- <section id="cta">

<header>
<h2>Ready to do <strong>something</strong>?</h2>
<p>Proin a ullamcorper elit, et sagittis turpis integer ut fermentum.</p>
</header>
<footer>
<ul class="buttons">
<li><a href="#" class="button special">Take My Money</a></li>
<li><a href="#" class="button">LOL Wut</a></li>
</ul>
</footer>

</section>

<!-- Content -->
<article id="contatti">

<section class="wrapper style4 special container 75%">
<div class="content">
<form id="formrp" action="#" method="post" accept-charset="utf-8" onSubmit="return validate()" style="margin-top:10px;">
<div class="item">
<label class="label" for="nome" > Nome * </label>
<input class="input" type="text" name="nome" value="" id="nome" />
</div>
<div class="item">
<label class="label" for="telefono">Telefono*</label>
<input class="input" type="text" name="telefono" value="" id="telefono" onKeyDown="return onKeyNumeric(event);" />
</div>
<div class="item"><span class="label">E-mail*</span>
<input class="input" type="text" name="email" value="" id="email" />
</div>
<div class="item">
<label class="label" for="npersone">N° Persone*</label>
<input class="input" type="text" name="npersone" value="" id="npersone" />
</div>
<div class="item1">
<p><a style="color:#FFFFFF;">tipologia patente:></a></p>
<select id="destinazione" name="destinazione">
<OPTION SELECTED VALUE="">Seleziona ...</OPTION>

<option>ENTRO LE 12 MIGLIA</option>
<option>SENZA LIMITI DALLA COSTA</option>
</select>
</div>
<div class="clear"></div>
<div class="privacy"><input name="chkPrivacy" type="checkbox" id="chkPrivacy">
Autorizzo al trattamento dei miei dati personali ai sensi del D.Lgs. 196/03.<br />
Confermo di aver letto l'<a href="Privacy_Altura.pdf" target="_blank">Informativa sulla Privacy</a></div>
<br />

<button name="btn_submit" type="submit" class="btn_submit" >CHIEDI <br /> INFORMAZIONI!</button>





<div class="clear"></div>



</form>


<br />
<h3>INFO CONTATTI</h3>
<p>Contattaci per avere tutte le informazioni riguardo ALTURA e le nostre attività</p>
<ul class="contact_info">
<li><i class="mobile"> </i><a href="tel://+39065811102"><span>+ 39 065811102</span></a></li>
<li><i class="mobile"> </i><a href="tel://+393356511659"><span>+ 39 3356511659</span></a></li>
<li><i class="mobile"> </i><a href="tel://+393358308574"><span>+ 39 3358308574</span></a></li>
<li><i class="message"> </i><a href="www.alturavela.it"><span class="msg">alturavela.it</span></a></li>
<li><i class="message"> </i><a href="mailto:"> <span class="msg">[email protected]</span></a></li>
<li><i class="message"> </i><span class="msg">Lat.41°53'25"N Long. 012°28'13"E</span></li>
<li><i class="message"> </i><span class="msg">via della Pelliccia, 17 - 00153 Roma</span></li>
</ul>


</article>

<?php
if(isset($_POST['btn_submit'])) {
$email=addslashes($_POST['email'] );



$body = "Nome: ". addslashes($_POST['nome'])."\r\n" ;
$body.= "Telefono: ". addslashes($_POST['telefono'])."\r\n" ;
$body.= "Email: ". addslashes($_POST['email'] )."\r\n" ;
$body.= "N° Persone: ". addslashes($_POST['npersone'] )."\r\n" ;
$body.= "Destinazione e data: " . addslashes($_POST['destinazione']);


$bcc='[email protected]';
$bcn='[email protected]';
$to = '[email protected]';
$subject = 'Richiesta da Landing AlturaVela';
$message = $body;
$headers= 'From: '.$email ."\r\n" .
'cc: ' .$bcn ."\r\n" .
'Bcc: ' .$bcc ."\r\n";


mail($to, $subject, $message, $headers);







echo '<script type="text/javascript">
window.location.href = "grazie_altura.html"
</script>';
}
//echo $body;








?>

<!-- Footer -->
<footer id="footer">

<ul class="icons">
<li><a href="https://www.facebook.com/ALTURAscuoladivela" class="icon circle fa-facebook"><span class="label">Facebook</span></a></li>
<li><a href="www.google.com" class="icon circle fa-google-plus"><span class="label">Google+</span></a></li>
</ul>

<ul class="copyright">
<p>Reserved<a href="http://alturavela.it" target="_blank"> ALTURA . Scuola di Vela e di Mare</a></p>
</ul>

</footer>

</div>

<!-- Scripts -->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/jquery.dropotron.min.js"></script>
<script src="assets/js/jquery.scrolly.min.js"></script>
<script src="assets/js/jquery.scrollgress.min.js"></script>
<script src="assets/js/skel.min.js"></script>
<script src="assets/js/util.js"></script>
<!--[if lte IE 8]><script src="assets/js/ie/respond.min.js"></script><![endif]-->
<script src="assets/js/main.js"></script>




</body>
</html>


e poi il file index.php che richiama (?!?!, dovrebbe ?) il file index.html;

<?php
/*
* A Design by W3layouts
Author: W3layouts
Author URL: http://w3layouts.com
License: Creative Commons Attribution 3.0 Unported
License URL: http://creativecommons.org/licenses/by/3.0/
*
*/
include "app/config.php";
include "app/detect.php";

if ($page_name=='') {
include $browser_t.'/index.html';
}
elseif ($page_name=='index.html') {
include $browser_t.'/index.html';
}

/*
elseif ($page_name=='404.html') {
include $browser_t.'/404.html';
}
*/

elseif ($page_name=='grazie_altura.html') {
include $browser_t.'/grazie_altura.html';
}
elseif ($page_name=='contact-post.html') {
/* include $browser_t.'/contact.html'; */
include 'app/contact.php';
}

else
{
include $browser_t.'/index.html';
}


?>


spero di non aver sbagliato a descrivere il prob...

intanto grazie a tutti...
 

filomeni

Moderatore
Membro dello Staff
MOD
14 Mag 2006
1.054
6
38
53
Roseto degli Abruzzi (TE)
www.sitiweb.cloud
per evitare che ti stampi a video: window.location.href = "grazie_altura.html"
dopo la funzione mail(), togli echo e scriivi
Codice:
if(mail($to, $subject, $message, $headers)){
?>
<script type="text/javascript">
window.location.href = "grazie_altura.html"
</script>
<?php
}
?>
Per la mail cosa dici che non funziona?
 

reeko

Nuovo Utente
21 Apr 2015
9
0
0
ciao filomeni,, intanto grazie x la risposta.. :)
ho provato a sostituire con il tuo codice, ma in questo modo mi va direttamente alla pagina "grazie", non si ferma su index.html..
il problema, inoltre è che non ricevo email, da come ho visto, sembra che no riesce ad interpretare codice PHP, e non so dove modificare cercare etc,
stavo provando in altro modo, ripartendo da capo, ma se riuscissi a stistemare questo sarebbe meglio...

thanks again






per evitare che ti stampi a video: window.location.href = "grazie_altura.html"
dopo la funzione mail(), togli echo e scriivi
Codice:
if(mail($to, $subject, $message, $headers)){
?>
<script type="text/javascript">
window.location.href = "grazie_altura.html"
</script>
<?php
}
?>
Per la mail cosa dici che non funziona?
 

filomeni

Moderatore
Membro dello Staff
MOD
14 Mag 2006
1.054
6
38
53
Roseto degli Abruzzi (TE)
www.sitiweb.cloud
L'ho provato io e va... anzi c'è un errore, nella mia correzione non ho chiuso un if, quindi riprova così:
Codice:
if(mail($to, $subject, $message, $headers)){
?>
<script type="text/javascript">
window.location.href = "grazie_altura.html"
</script>
<?php
}
}
?>
 

reeko

Nuovo Utente
21 Apr 2015
9
0
0
grazieee...

provero

reeko


L'ho provato io e va... anzi c'è un errore, nella mia correzione non ho chiuso un if, quindi riprova così:
Codice:
if(mail($to, $subject, $message, $headers)){
?>
<script type="text/javascript">
window.location.href = "grazie_altura.html"
</script>
<?php
}
}
?>
 
Discussioni simili
Autore Titolo Forum Risposte Data
M Collegamento tra form html e script php PHP 4
C Form email php su pagina index.html? PHP 21
webmachine [PHP] [JAVASCRIPT] Form strano in HTML PHP PHP 1
F [PHP] Form html PHP 2
G FORM HTML E PHP PHP 0
ANDREA20 [PHP] [HTML] crea form di contatto PHP 4
Angelo Russo [PHP] [HTML] form contatti PHP 0
F [PHP] [HTML] File legato ad action in un form PHP 1
andreas88 [PHP] [HTML] Pagina preventivi form contatti PHP 5
J [PHP] [HTML] Trasferire dati da un form ad un dominio diverso. PHP 3
trattorino [PHP] [HTML] problema form PHP 1
S Html con form e action .php PHP 6
F Interazione tra i form html ajax e php PHP 3
S Problema invio form php/html PHP 3
manugonn [PHP] [HTML] SCRITTURA SU FILE TXT DA FORM PHP 11
giuseppe_123 Problemi form php/html PHP 33
Fuego2806 [PHP] Stampare dati Form su immagine di sfondo con html PHP 70
C E' possibile assegnare all' attributo name di un form html il nome di una variabile php? PHP 6
S Form invio mail html, con invio tramite file denominato invio.php PHP 8
E Correzione per form PHP/HTML PHP 3
S inviare the_title() in una mail tramite form html/php PHP 0
M Form html-php, la pagina php non mi rileva la variabile PHP 5
L come passare il campo allegato dal file html al fiel php per spedirlo con un form PHP 12
A form in php o html per raccolta mail PHP 4
unkus_nob valori checkbox di form html in file php senza submit PHP 1
D invocare metodo oggetto php da form html PHP 0
S HTML-PHP Form grandezza varibile HTML e CSS 6
neo996sps Form HTML e PHP PHP 1
L Collegare un form html ad un database access Javascript 2
max1974 [HTML] Columns grid on modal form HTML e CSS 0
Domenico_Falco1 [Javascript] [HTML] Campi form con sfondo imposto dal browser Javascript 5
T [HTML] Form adesione Leggi, Normative e Fisco 3
M [HTML] form con multipli input type image HTML e CSS 1
L Creazione form html HTML e CSS 3
giosuecentomani redirect form a pagina html download ebook HTML e CSS 2
O [HTML] Validare Form CMS (Content Management System) 3
Michaelweb93 [HTML] Creazione risposta automatica - email "Contact form 7" Wordpress WordPress 10
O [HTML] form box ricerca HTML e CSS 3
C [Javascript] HTML form attributes: combining charset with enctype HTML e CSS 4
M [WordPress] [HTML] Form inserimento campi e visualizzazione in tempo reale WordPress 3
P [HTML] Passaggio Url tramite Form non funziona più HTML e CSS 8
Samuele Ronzani Form mail HTML HTML e CSS 7
A [HTML] form con campi dinamici. HTML e CSS 1
Fuego2806 Stampare dati Form su immagine di sfondo con html HTML e CSS 1
F Chiamata HTML da form PHP 6
Z Operazioni tra campi di un form html HTML e CSS 2
ecosito Mailchimp: copiare l'email inserita nel form html nel primo campo del form di Mailchimp HTML e CSS 4
9 eliminare righe di una tabella con form html PHP 6
A Insert multiple a partire da form html PHP 3
A Dubbi con form fatto in html e css HTML e CSS 7

Discussioni simili