Código HTML :
<?php if(isset($_POST['acao']) && $_POST['acao'] == 'enviar' ){ require('agende.php'); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Tabela agende</title> <link href="css/pluspixel.css" rel="stylesheet" type="text/css" /> <style type="text/css"> body { background:#FFFFE8; } </style> </head> <body> <form name="form1" action="" method=post> <table width="227" border="0" cellspacing="4" cellpadding="0"> <tr> <td colspan="4" class="data"><input name=nome onFocus=clear_nome() value="Nome:" size="30" maxlength="50"></td> </tr> <tr> <td colspan="4"><input name=empresa onFocus=clear_empresa() value="Empresa:" size="30" maxlength="50"></td> </tr> <tr> <td width="25"><span class="data">Data:</span></td> <td width="55"><input type="text" name="data_2" id="data_2" size="10" maxlength="10" class="rosa"/></td> <td width="26"><span class="data">Hora:</span></td> <td width="101"><select name="hora" size="1"> <option value="08">08</option> <option value="09">09</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> </select>:<select name="minutos"> <option value="00">00</option> <option value="10">10</option> <option value="20">20</option> <option value="30">30</option> <option value="40">40</option> <option value="50">50</option> </select></td> </tr> <tr> <td colspan="4"> <input type="hidden" name="acao" value="enviar" /> <input type=submit value=enviar><?php if (isset($msg)) echo "<p id=\"msg\" $msg >" ?> </td> </tr> </table> </form> <!-- text input desaparece --> <script language=JavaScript> function clear_nome() { if (document.form1.nome.value == "Nome:") document.form1.nome.value = ""; } function clear_empresa() { if (document.form1.empresa.value == "Empresa:") document.form1.empresa.value = ""; } </script> <!-- fim text input desaparece --> <!-- calendário --> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="js/jquery.click-calendario-1.0-min.js"></script> <script type="text/javascript" src="js/exemplo-calendario.js"></script> </body> </html>
Código PHP :
<?php $nome = strip_tags(trim($_POST['nome'])); $empresa = strip_tags(trim($_POST['empresa'])); $data = strip_tags(trim($_POST['data_2'])); $hora = $_POST['hora']; $minutos = $_POST['minutos']; if(empty($nome) || $nome == "Nome:") { $msg = 'Preencha Nome'; }elseif(empty($empresa) || $empresa == "Empresa:"){ $msg = 'Preencha Empresa'; }elseif(empty($data)){ $msg = 'Selecione uma Data'; }else{ require("phpmailer/class.phpmailer.php"); $mail = new PHPMailer(); $mail->SetLanguage("br"); $mail->IsMail(); $mail->IsHTML(true); $mail->FromName = $nome; $mail->AddAddress("[email protected]"); $mail->Subject = "Agendamento de chamada"; $mail->Body .= "<B>Agendamento de chamada<BR><BR></B>"; $mail->Body .= "Nome: $nome<BR>"; $mail->Body .= "Empresa: $empresa<BR>"; $mail->Body .= "Data: $data<BR>"; $mail->Body .= "Hora: $hora:$minutos<BR>"; $mail->MsgHTML($body); if($mail->Send()) $msg = 'Sucesso'; else $msg = 'Tente novamente'; } ?>
y la página "funcionando":
http://pluspixel.com.br/target-bones/tabela-agende.php
Desde ya muchas gracias.