<?php $bd=mysql_connect("localhost","jerbix_base","aon") or die ("No puedo connectarme a base de datos"); mysql_select_db("jerbix_base"); $opt=$HTTP_GET_VARS["OPT"]; if ($opt==1) { $nombre=$HTTP_GET_VARS["nombre"]; $email=$HTTP_GET_VARS["email"]; $sql="insert into id_jerbix_base (nombre, email) values ('".$nombre."','".$email."'); $res=mysql_query($sql,$bd) or die (mysql_error()); ?> <html> <title>formulario</title> <script language="javascript"> function verifica() { if (f.email.value=="") { alert ("por favor ingrese su email"); return; } f.opt.value=1 f.submit(); } </script> <body> <form name="f"> <input type="hidden" name="opt"> <table width="200" border="0"> <tr> <td width="63">Nombre</td> <td width="121"><form name="nombre" method="post" action=""> <label> <input type="text" name="nombre" id="nombre" /> </label> </form></td> </tr> <tr> <td>Email</td> <td><form name="email" method="post" action=""> <label> <input type="text" name="email" id="email" /> </label> </form></td> </tr> </table> <table width="200" border="0"> <tr> <td><form name="form3" method="post" action=""> <label> <input type="submit" name="submit" value="Submit" onclick=verifica() /> /> </label> </form></td> </tr> </table> </form> </body> </html> |
<?php
$bd=mysql_connect("localhost","jerbix_base","aon") or die ("No puedo connectarme a base de datos");
mysql_select_db("jerbix_base");
$opt=$HTTP_GET_VARS["OPT"];
if ($opt==1)
{
$nombre=$HTTP_GET_VARS["nombre"];
$email=$HTTP_GET_VARS["email"];
$sql="insert into id_jerbix_base (nombre, email) values ('".$nombre."','".$email."')"; // FALTABAN estas comillas
$res=mysql_query($sql) or die (mysql_error());
?>
<html>
<title>formulario</title>
<script language="javascript">
function verifica()
{
if (f.email.value=="")
{
alert ("por favor ingrese su email");
return;
}
f.opt.value=1
f.submit();
}
</script>
<body>
<form name="f">
<input type="hidden" name="opt">
<table width="200" border="0">
<tr>
<td width="63">Nombre</td>
<td width="121"><form name="nombre" method="post" action="">
<label>
<input type="text" name="nombre" id="nombre" />
</label>
</form></td>
</tr>
<tr>
<td>Email</td>
<td><form name="email" method="post" action="">
<label>
<input type="text" name="email" id="email" />
</label>
</form></td>
</tr>
</table>
<table width="200" border="0">
<tr>
<td><form name="form3" method="post" action="">
<label>
<input type="submit" name="submit" value="Submit" onclick=verifica() /> />
</label>
</form></td>
</tr>
</table>
</form>
</body>
</html>
<?php
$bd=mysql_connect("localhost","usuario","password") or die ("No puedo connectarme a base de datos");
mysql_select_db("jerbix_base");
if (isset($_POST['opt']))
{
$nombre=mysql_real_escape_string($_POST['nombre']);
$email=mysql_real_escape_string($_POST['email']);
mysql_query("INSERT INTO id_jerbix_base (nombre, email) VALUES ('".$nombre."', '".$email."')") or die (mysql_error());
}
?>
<html>
<title>Forumario</title>
<script language="javascript">
function verifica()
{
if (f.email.value=="")
{
alert ("por favor ingrese su email");
return;
}
f.opt.value=1
f.submit();
}
</script>
<body>
<form name="f" action="" method="post">
<table width="200" border="0">
<tr><td width="63">Nombre: <br><input type="text" name="nombre"><input type="hidden" name="opt" /></td></tr>
<tr><td width="63">E-mail: <br><input type="text" name="email" /></td></tr>
<tr><td width="63"><input type="button" value="Enviar" onclick="verifica()" /></td></tr>
</table>
</form>
</body>
</html>
CitarCan't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/content/j/e/r/jerbix/html/index3.php on line 3
<?php
$bd=mysql_connect("host","jmyname","my pass") or die ("No puedo connectarme a base de datos");
mysql_select_db("database");
if (isset($_POST['opt']))
{
$nombre=mysql_real_escape_string($_POST['nombre']);
$email=mysql_real_escape_string($_POST['email']);
$email=mysql_real_escape_string($_POST['telefono']);
$email=mysql_real_escape_string($_POST['direccion']);
$email=mysql_real_escape_string($_POST['asunto']);
mysql_query("INSERT INTO jerbix_lead (nombre, email, telefono, direccion, asunto) VALUES ('".$nombre."', '".$email."', '".$telefono."','".$direccion."','".$asunto."')") or die (mysql_error());
}
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body {
font: 100% Verdana, Arial, Helvetica, sans-serif;
background: #666666;
margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
padding: 0;
text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
color: #000000;
}
.twoColFixLtHdr #container {
width: 780px; /* using 20px less than a full 800px width allows for browser chrome and avoids a horizontal scroll bar */
background: #FFFFFF;
margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
border: 1px solid #000000;
text-align: left; /* this overrides the text-align: center on the body element. */
}
.twoColFixLtHdr #header {
background: #DDDDDD;
padding: 0 10px 0 20px; /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */
}
.twoColFixLtHdr #header h1 {
margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
}
.twoColFixLtHdr #sidebar1 {
float: left; /* since this element is floated, a width must be given */
width: 200px; /* the actual width of this div, in standards-compliant browsers, or standards mode in Internet Explorer will include the padding and border in addition to the width */
background: #EBEBEB; /* the background color will be displayed for the length of the content in the column, but no further */
padding: 15px 10px 15px 20px;
}
.twoColFixLtHdr #mainContent {
margin: 0 0 0 250px; /* the left margin on this div element creates the column down the left side of the page - no matter how much content the sidebar1 div contains, the column space will remain. You can remove this margin if you want the #mainContent div's text to fill the #sidebar1 space when the content in #sidebar1 ends. */
padding: 0 20px; /* remember that padding is the space inside the div box and margin is the space outside the div box */
text-align: left;
}
.twoColFixLtHdr #footer {
padding: 0 10px 0 20px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
background:#DDDDDD;
}
.twoColFixLtHdr #footer p {
margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
}
.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
float: right;
margin-left: 8px;
}
.fltlft { /* this class can be used to float an element left in your page */
float: left;
margin-right: 8px;
}
.clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
}
-->
</style><!--[if IE 5]>
<style type="text/css">
/* place css box model fixes for IE 5* in this conditional comment */
.twoColFixLtHdr #sidebar1 { width: 230px; }
</style>
<![endif]--><!--[if IE]>
<style type="text/css">
/* place css fixes for all versions of IE in this conditional comment */
.twoColFixLtHdr #sidebar1 { padding-top: 30px; }
.twoColFixLtHdr #mainContent { zoom: 1; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>
<![endif]--></head>
<body class="twoColFixLtHdr">
<div id="container">
<div id="header">
<h1>Reparamos Desktops y Laptops</h1>
<!-- end #header --></div>
<div id="sidebar1">
<!-- end #sidebar1 -->
</div>
<div id="mainContent">
<h1>Solicitud de Servicios</h1>
<script language="javascript">
function verifica()
{
if (f.email.value=="")
{
alert ("por favor ingrese su email");
return;
}
f.opt.value=1
f.submit();
}
</script>
<form name="f" action="" method="post">
<table width="200" border="0">
<caption>
Formulario
</caption>
<tr>
<tr><td width="63">Nombre: <br><input type="text" name="nombre"><input type="hidden" name="opt" /></td></tr>
<tr><td width="63">Phone Number: <br><input type="text" name="telefono"><input type="hidden" name="opt"/></td></tr>
<tr><td width="63">Direccion: <br><input type="text" name="dirrecion"><input type="hidden" name="opt" /></td></tr>
<tr><td width="63">E-mail: <br><input type="text" name="email"><input type="hidden" name="opt"/></td></tr>
<tr><td width="63">Asunto <br><textarea name="asunto" rows="4"></textarea> <input type="hidden" name="opt" /></td></tr><tr><td width="63"><input type="button" value="Enviar" onClick="verifica()" /></td></tr></tr>
</table>
</form>
<!-- end #mainContent --></div>
<!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --><br class="clearfloat" />
<div id="footer">
<p>Footer</p>
<!-- end #footer --></div>
<!-- end #container --></div>
</body>
</html>
$nombre=mysql_real_escape_string($_POST['nombre']);
$email=mysql_real_escape_string($_POST['email']);
$email=mysql_real_escape_string($_POST['telefono']);
$email=mysql_real_escape_string($_POST['direccion']);
$email=mysql_real_escape_string($_POST['asunto']);
$email=mysql_real_escape_string($_POST['direccion']);
<input type="text" name="dirrecion">
<?php
$bd=mysql_connect("host","jmyname","my pass") or die ("No puedo connectarme a base de datos");
mysql_select_db("database");
if (isset($_POST['opt']))
{
$nombre=mysql_real_escape_string($_POST['nombre']);
$email=mysql_real_escape_string($_POST['email']);
$telefono=mysql_real_escape_string($_POST['telefono']);
$direccion=mysql_real_escape_string($_POST['direccion']);
$asunto=mysql_real_escape_string($_POST['asunto']);
mysql_query("INSERT INTO jerbix_lead (nombre, email, telefono, direccion, asunto) VALUES ('".$nombre."', '".$email."', '".$telefono."','".$direccion."','".$asunto."')") or die (mysql_error());
}
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body {
font: 100% Verdana, Arial, Helvetica, sans-serif;
background: #666666;
margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
padding: 0;
text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
color: #000000;
}
.twoColFixLtHdr #container {
width: 780px; /* using 20px less than a full 800px width allows for browser chrome and avoids a horizontal scroll bar */
background: #FFFFFF;
margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
border: 1px solid #000000;
text-align: left; /* this overrides the text-align: center on the body element. */
}
.twoColFixLtHdr #header {
background: #DDDDDD;
padding: 0 10px 0 20px; /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */
}
.twoColFixLtHdr #header h1 {
margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
}
.twoColFixLtHdr #sidebar1 {
float: left; /* since this element is floated, a width must be given */
width: 200px; /* the actual width of this div, in standards-compliant browsers, or standards mode in Internet Explorer will include the padding and border in addition to the width */
background: #EBEBEB; /* the background color will be displayed for the length of the content in the column, but no further */
padding: 15px 10px 15px 20px;
}
.twoColFixLtHdr #mainContent {
margin: 0 0 0 250px; /* the left margin on this div element creates the column down the left side of the page - no matter how much content the sidebar1 div contains, the column space will remain. You can remove this margin if you want the #mainContent div's text to fill the #sidebar1 space when the content in #sidebar1 ends. */
padding: 0 20px; /* remember that padding is the space inside the div box and margin is the space outside the div box */
text-align: left;
}
.twoColFixLtHdr #footer {
padding: 0 10px 0 20px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
background:#DDDDDD;
}
.twoColFixLtHdr #footer p {
margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
}
.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
float: right;
margin-left: 8px;
}
.fltlft { /* this class can be used to float an element left in your page */
float: left;
margin-right: 8px;
}
.clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
}
-->
</style><!--[if IE 5]>
<style type="text/css">
/* place css box model fixes for IE 5* in this conditional comment */
.twoColFixLtHdr #sidebar1 { width: 230px; }
</style>
<![endif]--><!--[if IE]>
<style type="text/css">
/* place css fixes for all versions of IE in this conditional comment */
.twoColFixLtHdr #sidebar1 { padding-top: 30px; }
.twoColFixLtHdr #mainContent { zoom: 1; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>
<![endif]--></head>
<body class="twoColFixLtHdr">
<div id="container">
<div id="header">
<h1>Reparamos Desktops y Laptops</h1>
<!-- end #header --></div>
<div id="sidebar1">
<!-- end #sidebar1 -->
</div>
<div id="mainContent">
<h1>Solicitud de Servicios</h1>
<script language="javascript">
function verifica()
{
if (f.email.value=="")
{
alert ("por favor ingrese su email");
return;
}
f.opt.value=1
f.submit();
}
</script>
<form name="f" action="" method="post">
<table width="200" border="0">
<caption>
Formulario
</caption>
<tr>
<tr><td width="63">Nombre: <br><input type="text" name="nombre"><input type="hidden" name="opt" /></td></tr>
<tr><td width="63">Phone Number: <br><input type="text" name="telefono"></td></tr>
<tr><td width="63">Direccion: <br><input type="text" name="direccion"></td></tr>
<tr><td width="63">E-mail: <br><input type="text" name="email"></td></tr>
<tr><td width="63">Asunto <br><textarea name="asunto" rows="4"></textarea>
</td></tr><tr><td width="63"><input type="button" value="Enviar" onClick="verifica()" /></td></tr></tr>
</table>
</form>
<!-- end #mainContent --></div>
<!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --><br class="clearfloat" />
<div id="footer">
<p>Footer</p>
<!-- end #footer --></div>
<!-- end #container --></div>
</body>
</html>
if (mail(.....)){
header ("Location: mensajes.php?msg=exito");
exit;
} else {
header ("Location: mensajes.php?msg=error");
exit;
}
<?php
if(isset($_POST['opt'])) {
// Conexion Base de datos
$bd = mysql_connect("sql112.byethost5.com","b5_3150600","s7m6o6k5") or die(mysql_error());
mysql_select_db("b5_3150600_database",$bd) or die (mysql_error());
// Obtener datos
$nombre=mysql_real_escape_string($_POST['nombre']);
$email=mysql_real_escape_string($_POST['email']);
$telefono=mysql_real_escape_string($_POST['telefono']);
$direccion=mysql_real_escape_string($_POST['direccion']);
$asunto=mysql_real_escape_string($_POST['asunto']);
// Crear Registro
mysql_query("INSERT INTO contact (nombre, email, telefono, direccion, asunto)
VALUES ('".$nombre."', '".$email."', '".$telefono."','".$direccion."','".$asunto."')") or die (mysql_error());
// Terminar conexion a base de datos
mysql_close($bd);
// Comprobar si el servidor soporta funcion mail
if (function_exists('mail')) {
// Enviar email
$hacia = "bad.stupid.monkey@gmail.com";
$asunto = "Nuevo Registro";
$mensaje = "Un nuevo registro fue añadido: <br> Nombre: $nombre <br> Email: $email <br> Telefono: $telefono
<br> Direccion: $direccion <br> Asunto: $asunto";
if(mail($to, $subject, $message)) { echo "Su mensaje fue enviado. Gracias 1"; } else {echo "Error en el envio";}
} else { echo "Su mensaje fue enviado. Gracias 2";}
}
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body {
font: 100% Verdana, Arial, Helvetica, sans-serif;
background: #666666;
margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
padding: 0;
text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
color: #000000;
}
.twoColFixLtHdr #container {
width: 780px; /* using 20px less than a full 800px width allows for browser chrome and avoids a horizontal scroll bar */
background: #FFFFFF;
margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
border: 1px solid #000000;
text-align: left; /* this overrides the text-align: center on the body element. */
}
.twoColFixLtHdr #header {
background: #DDDDDD;
padding: 0 10px 0 20px; /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */
}
.twoColFixLtHdr #header h1 {
margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
}
.twoColFixLtHdr #sidebar1 {
float: left; /* since this element is floated, a width must be given */
width: 200px; /* the actual width of this div, in standards-compliant browsers, or standards mode in Internet Explorer will include the padding and border in addition to the width */
background: #EBEBEB; /* the background color will be displayed for the length of the content in the column, but no further */
padding: 15px 10px 15px 20px;
}
.twoColFixLtHdr #mainContent {
margin: 0 0 0 250px; /* the left margin on this div element creates the column down the left side of the page - no matter how much content the sidebar1 div contains, the column space will remain. You can remove this margin if you want the #mainContent div's text to fill the #sidebar1 space when the content in #sidebar1 ends. */
padding: 0 20px; /* remember that padding is the space inside the div box and margin is the space outside the div box */
text-align: left;
}
.twoColFixLtHdr #footer {
padding: 0 10px 0 20px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
background:#DDDDDD;
}
.twoColFixLtHdr #footer p {
margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
}
.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
float: right;
margin-left: 8px;
}
.fltlft { /* this class can be used to float an element left in your page */
float: left;
margin-right: 8px;
}
.clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
}
-->
</style><!--[if IE 5]>
<style type="text/css">
/* place css box model fixes for IE 5* in this conditional comment */
.twoColFixLtHdr #sidebar1 { width: 230px; }
</style>
<![endif]--><!--[if IE]>
<style type="text/css">
/* place css fixes for all versions of IE in this conditional comment */
.twoColFixLtHdr #sidebar1 { padding-top: 30px; }
.twoColFixLtHdr #mainContent { zoom: 1; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>
<![endif]--></head>
<body class="twoColFixLtHdr">
<div id="container">
<div id="header">
<h1>Reparamos Desktops y Laptops</h1>
<!-- end #header --></div>
<div id="sidebar1">
<!-- end #sidebar1 -->
</div>
<div id="mainContent">
<h1>Solicitud de Servicios</h1>
<script language="javascript">
function verifica()
{
if (f.email.value=="")
{
alert ("Por favor ingrese su email");
return;
}
f.opt.value=1
f.submit();
}
</script>
<form name="f" action="" method="post">
<table width="200" border="0">
<caption>
Formulario
</caption>
<tr>
<tr><td width="63">Nombre: <br><input type="text" name="nombre"><input type="hidden" name="opt" /></td></tr>
<tr><td width="63">Phone Number: <br><input type="text" name="telefono"></td></tr>
<tr><td width="63">Direccion: <br><input type="text" name="direccion"></td></tr>
<tr><td width="63">E-mail: <br><input type="text" name="email"></td></tr>
<tr><td width="63">Asunto <br><textarea name="asunto" rows="4"></textarea>
</td></tr><tr><td width="63"><input type="button" value="Enviar" onClick="verifica()" /></td></tr></tr>
</table>
</form>
<!-- end #mainContent --></div>
<!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --><br class="clearfloat" />
<div id="footer">
<p>Footer</p>
<!-- end #footer --></div>
<!-- end #container --></div>
</body>
</html>
<?php
if(isset($_POST['opt'])) {
// Conexion Base de datos
$bd = mysql_connect("sql112.byethost5.com","b5_3150600","s7m6o6k5") or die(mysql_error());
mysql_select_db("b5_3150600_database",$bd) or die (mysql_error());
// Obtener datos
$nombre=mysql_real_escape_string($_POST['nombre']);
$email=mysql_real_escape_string($_POST['email']);
$telefono=mysql_real_escape_string($_POST['telefono']);
$direccion=mysql_real_escape_string($_POST['direccion']);
$asunto=mysql_real_escape_string($_POST['asunto']);
// Crear Registro
mysql_query("INSERT INTO contact (nombre, email, telefono, direccion, asunto)
VALUES ('".$nombre."', '".$email."', '".$telefono."','".$direccion."','".$asunto."')") or die (mysql_error());
// Terminar conexion a base de datos
mysql_close($bd);
// Comprobar si el servidor soporta funcion mail
if (function_exists('mail')) {
// Enviar email
$hacia = "bad.stupid.monkey@gmail.com";
$asunto = "Nuevo Registro";
$mensaje = "Un nuevo registro fue añadido: <br> Nombre: $nombre <br> Email: $email <br> Telefono: $telefono
<br> Direccion: $direccion <br> Asunto: $asunto";
if(mail($to, $subject, $message)) { echo "Su mensaje fue enviado. Gracias 1"; } else {echo "Error en el envio";}
} else { echo "Su mensaje fue enviado. Gracias 2";}
}
?>
$hacia = "bad.stupid.monkey@gmail.com";
$asunto = "Nuevo Registro";
$mensaje = "Un nuevo registro fue añadido: <br> Nombre: $nombre <br> Email: $email <br> Telefono: $telefono
<br> Direccion: $direccion <br> Asunto: $asunto";
if(mail($to, $subject, $message)) { echo "Su mensaje fue enviado. Gracias 1"; } else {echo "Error en el envio";}
} else { echo "Su mensaje fue enviado. Gracias 2";}
}
if(mail($to, $subject, $message)) { echo '<img src="imagen.jpg" />'; } else {echo '<img src="error.jpg" />';}