Jump to content

Reservation calendar JS


edoplaza

Recommended Posts


<?php
if(isset($_POST['submit'])){
// multiple recipients
$to = 'edoplaza@yahoo.com';
$subject = 'Feedback form results';

$message = 'name: '.$_POST['name']."
";
$message.= 'Check in date: '.$_POST['checkindate']."
";
$message.= 'Check out date: '.$_POST['checkoutdate']."
";
$message.= 'Adults: '.$_POST['adults']."
";
$message.= 'Childs: '.$_POST['child']."
";
$message.= 'Comments: '.$_POST['comments']."
";

$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

$headers .= 'From: Birthday Reminder ' . "\r\n";
mail($to, $subject, $message, $headers);
}
?>

Name:

Check in date:

Check out date:

Adults:

Childs:

Comments:


Edited by bishwadeep
Link to comment
Share on other sites

Hello bishwadeep,

 

Thank you very much for all your help. This is exactly what I wanted. Of course, I'll put all the css in a different file, I just wanted to focus on the js - php part.

 

Thank you very much and greetings from Venezuela. When the site is finished, I'll let you know.

 

Regards,

 

Eduardo

Link to comment
Share on other sites

Sorry to bother you one last time.

 

Your code works perfectly, but now, I've lost my little "thank you" page after the user submits the info, and the other one,

"oops, there has been an error."

 

How do I integrate a verification code?

 

I used to have this:

 

 

 

then, on the sendmail.php I had this:

 

if (!isset($_REQUEST['email'])) {

header( "Location: http://www.puntabahareque.com/thankyou.html\" );

etc. (you can see it on the top post)

 

 

I can see that in your new code you don't have the action="sendmail.php" anymore,

 

but action "".

 

 

So, where do you put the verification code?

 

You can see what I mean here:

 

http://www.puntabahareque.com/thankyou.html

 

 

 

 

 

Thanks once again,

 

Eduardo

Edited by edoplaza
Link to comment
Share on other sites


<?php
if ($_POST && isset($missing) && !empty($missing)) {
?>

Por favor, complete la informaci?n requerida.


<?php
}
elseif ($_POST && !$mailSent) {
?>

Disculpe, su mensaje no pudo ser enviado. Por favor int?ntelo m?s tarde.


<?php
}
elseif ($_POST && $mailSent) {
?>

Su mensaje fue enviado con ?xito. Gracias por contactarnos.


<?php } ?>




Datos personales


Nombre y apellido:



<?php if (isset($missing)) {
echo 'value="'.htmlentities($_POST['name']).'"';
} ?>
/>
<?php
if (isset($missing) && in_array('name', $missing)) { ?>
Por favor, escriba su nombre
<?php } ?>






Tel?fono celular:



<?php if (isset($missing)) {
echo 'value="'.htmlentities($_POST['telefono']).'"';
} ?>
/>
<?php
if (isset($missing) && in_array('telefono', $missing)) { ?>
Por favor, escriba su tel?fono
<?php } ?>






Correo electr?nico:


<?php if (isset($missing) && in_array('email', $missing)) {
echo 'value="'.htmlentities($_POST['email']).'"';
} ?>
/>
<?php
if (isset($missing) && in_array('email', $missing)) { ?>
Por favor, escriba su correo electr?nico
<?php } ?>





Fecha de llegada:





<?php if (isset($missing) && in_array('checkindate', $missing)) {
echo 'value="'.htmlentities($_POST['checkindate']).'"';
} ?>
/>
<?php
if (isset($missing) && in_array('checkindate', $missing)) { ?>
Por favor, selecione o escriba la fecha de llegada
<?php } ?>





Hora de llegada




7:00
8:00
9:00
10:00
11:00
12:00
13:00
14:00
15:00
16:00
17:00
18:00
19:00
20:00
21:00






Fecha de salida




<?php if (isset($missing) && in_array('checkoutdate', $missing)) {
echo 'value="'.htmlentities($_POST['checkoutdate']).'"';
} ?>
/>
<?php
if (isset($missing) && in_array('checkoutdate', $missing)) { ?>
Por favor, seleccione o escriba la fecha de salida
<?php } ?>





Hora de salida




7:00
8:00
9:00
10:00
11:00
12:00
13:00
14:00
15:00
16:00
17:00
18:00
19:00
20:00
21:00




Adultos




0
1
2
3
4
5
6
7
8
9
10




Ni?os menores de 4 a?os




0
1
2
3
4
5
6
7
8
9
10








Ni?os entre 4 y 10 a?os




0
1
2
3
4
5
6
7
8
9
10




Comentarios



<?php
if (isset($missing) && in_array('comments', $missing)) { ?>
Por favor escriba sus comentarios<?php } ?>



<?php if (isset($missing)) {
echo htmlentities($_POST['comments']);
} ?>




















Edited by edoplaza
Link to comment
Share on other sites

Hi edoplaza,

 

Since I dont have all the files you have used, I could not test it properly, But i think you can change the values in the $expected array to meet your requirements.

 

For example: $expected = array('name', 'telefono', 'email','checkindate', 'checkintime', 'checkoutdate', 'checkouttime','adults', 'under4', 'between4and10','comments');

 

Change the name to Name and telefono to Telephone Number etc.

 

Then try once and let me know.

Link to comment
Share on other sites

Hi bishwadeep,

 

I only use two files, and I fully posted them in my previous message. The first one is called contacto9.php the sencond one is called process_mail.inc.php. There is nothing more. If you need me to send you the files, I will.

 

I changed what you suggested but it didn't work. I changed one field, just to try:

where it says:

 


$expected = array('name', 'telefono', 'email','checkindate', 'checkintime', 'checkoutdate', 'checkouttime','adults', 'under4', 'between4and10','comments');

 

I changed it to:

 


$expected = array('name', 'telefono', 'email','checkindate', 'checkintime', 'checkoutdate', 'checkouttime','adults', 'under4', 'between 4 and 10 years','comments');

 

On the mail message I get:

 

between 4 and 10 years: not selected.

 

Notice this variable on the code:

 


p>
Ni?os entre 4 y 10 a?os




0
1
2
3
4
5
6
7
8
9
10





 

The variable "between4and10" is written several times and I think it has to match the variable in the array.

 

 

Maybe, there is a way to convert each variable of the "expected" array into strings.

 

Greetings,

 

Eduardo

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...