Mi Proyecto del curso: Proyecto Perú
by Vittorio Di Gianvito @vittorio_dg
- 567
- 7
- 3
Hola @martuishere te envío el link de mi proyecto final. He insertado varias de las propiedades revisadas a lo largo del curso, espero te parezca bien ejecutados.
https://www.dropbox.com/sh/x64g1w95w32a0a6/AABIco8-SyMuDSWfdC7Z0YXqa?dl=0
Solo te quería hacer dos consultas:
Tuve un inconveniente con el botón del bloque culinario "Ir a la noticia", en realidad en la vista desktop, debería quedar sobre la imagen del plato tal como se muestra en la imagen adjunta y no en todo el ancho. Lo dejé así porque no me salía por ningún camino, te agradecería un consejo.
La segunda consulta, es con relación a los formularios, se suelen hacer todavía formularios en html o ya no es muy común porque ya existen otros formatos o por un tema de seguridad o usabilidad?, en todo caso que archivo debería agregar para que el formulario funcione correctamente?
Muchas gracias y buen curso!!
3 comments
vittorio_dg
Hello @martuishere I await your comments to know if I managed to apply the codes or any recommendations well.
Thanks a lot.
See original
Hide original
martuishere
Teacher Plus@vittorio_dg Hello! Sorry for the delay in replying. The project is great! (and now I really want to visit Peru!)
I answer your questions:
- To place the button "Go to news" on the image, the easiest thing would have been to load the image as a background image of a div containing the button. On the other hand, there may be reasons to upload that image as a content image. If that's the case, then I would put it in a div that had a position: relative and within the div itself, the button with a position: absolute (and the corresponding positioning).
- The interface of the forms is still done, effectively, in HTML. But for data processing (collecting it and composing an email, for example) PHP or other backend languages are usually used. Here are the steps to prepare one (I hope the code is pasted correctly):
1- Link the HTML form with the action (PHP file)
<form method="post" action="enviamail.php" id="contacto">
2- Make sure that all the fields of the form to be collected have the name attribute with a unique identifier. Example:
<label for="nombreusuario">Name:</label>
<input type="text" name="nombre" id="nombreusuario" />
(We put the id to link it with the label, but what the PHP script will look at will be the name attribute)
3- Create a file called sendmail.php with the following code, and change the values that are indicated:
<?php
// Change the email for your email so that the messages arrive
$ EmailTo = "your @email .com";
$ Subject = "Contact form";
// These variables, which are marked with the $, clean of rare characters and collect the values of the names that coincide with name, phone, email and message. If you want to add more, you would have to create new variables, or remove them if it were the case.
$ Name = Trim (stripslashes ($ _ POST ['nombre']));
$ Tel = Trim (stripslashes ($ _ POST ['telefono']));
$ Email = Trim (stripslashes ($ _ POST ['email']));
$ Message = Trim (stripslashes ($ _ POST ['mensaje']));
// Here we put that the email from which it is sent is the email of the one who has filled out the form
$ EmailFrom = $ Email;
// Here we create the body of the message to be sent. If there are more or fewer variables to collect, lines with the corresponding variables should be added or removed. We are adding values to $ Body, which is what is sent at the end.
$ Body = "";
$ Body. = "Name:";
$ Body. = $ Name;
$ Body. = "\ N";
$ Body. = "Tel:";
$ Body. = $ Tel;
$ Body. = "\ N";
$ Body. = "Email:";
$ Body. = $ Email;
$ Body. = "\ N";
$ Body. = "Message:";
$ Body. = $ Message;
$ Body. = "\ N";
// Send the email
$ success = mail ($ EmailTo, $ Subject, $ Body, "From: <$ EmailFrom>");
// Once sent, redirect to an HTML page of "thanks for your message" that you can prepare, rename it if you want
if ($ success) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=muchasgracias.html\"> ";
}
// Or if it failed, redirect you to an error page
else {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\"> ";
}
?>
Hope this can help you. A greeting!
See original
Hide original
vittorio_dg
Hi @martuishere
Thank you very much for your comments and for the answers to my questions.
I'm going to apply that code to the form to see how it goes.
And I'm looking forward to taking another HTML course to register again, your course was very good, I congratulate you!
Cheers!!
See original
Hide original
Log in or join for Free to comment