Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

php error?

26 views
Skip to first unread message

Stephan Bird

unread,
May 6, 2017, 4:47:38 PM5/6/17
to
Hi all,

I had a php file working on a website I developed for my parents'
business but it no longer seems to work. The source is as below - this no
longer seems to e-mail the results of the form on but still completes
from an end-user point of view. Does anyone know how to fix this. An
info.php file on the webserver is at http://www.cwmcadnantvalley.co.uk/
info.php if it helps

STARTS
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/
html4/strict.dtd">

<html>

<head><title>Cwm Cadnant Valley - Booking Enquiries</title>

<?php include("http://www.cwmcadnantvalley.co.uk/meta.html"); ?>

<link rel="STYLESHEET" href="/forms.css" type="text/css">

</head>

<body>

<div class="content">

<?php include("http://www.cwmcadnantvalley.co.uk/top.html"); ?>

<h2>Booking Enquiries</h2>

<p class="nav centre">Jump to... <a href="#YCI">Your Contact Information</
a>, <a href="#PS">Details of your proposed stay</a>, <a href="#OI">Other
useful information</a>, <a href="#BC">Specific Booking Conditions</a>.</p>

<p>There are many ways to make a booking enquiry</p>

<p>You can make an enquiry using the form below; download a <a
href="BookForm2009.pdf" title="2009 Booking Form, to send in the post to
Cwm Cadnant Valley.">2009 booking form</a> here (in PDF format); <a
href="mailto:cam...@cwmcadnantvalley.co.uk" title="E-mail:
cam...@cwmcadnantvalley.co.uk.">e-mail us
(cam...@cwmcadnantvalley.co.uk)</a> with your enquiry; write to Cwm
Cadnant Valley, Llanberis Road, Caernarfon, Gwynedd, LL55 2DF, Wales;
telephone <a href="skype:+441286673196?call" title="Call Cwm Cadnant
using Skype">+44 1286 673196</a>, fax: <span class="nw">+44 1286 675941</
span>, or Skype: <a href="skype:Cwmcadnant?call">Cwmcadnant</a>.</p>

<?php // Create an empty array to hold the error messages.

$arrErrors = array(); //Only validate if the Submit button was clicked.

if (!empty($_REQUEST['Submit'])) { // Each time there's an error, add an
error message to the error array using the field name as the key.

if ($_REQUEST['name']=='')

$arrErrors['name'] = 'Please provide your name.';

if (ereg("^[a-zA-Z0-9_\.\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$",
$_REQUEST['email']));

else $arrErrors['email'] = 'It seems as if your e-mail address is not
valid. If you are certain that it is, then it may be a problem at our
end, feel free to <a href="/contact.html" title="Contact Cwm Cadnant
Valley">contact Cwm Cadnant Valley</a> some other way with your details.';

if ($_REQUEST['start']=='')

$arrErrors['start'] = 'Please let us know when you want
to arrive.';

if ($_REQUEST['end']=='')

$arrErrors['end'] = 'Please let us know when you want to
leave.';

if ($_REQUEST['size']=='')

$arrErrors['size'] = 'Please provide the size of your unit, so we
can check to see if we have appropriate space.';

if (count($arrErrors) == 0) {

$CCVemail ="BookingE...@cwmcadnantvalley.co.uk";

$title ="A copy of your Booking Enquiry to Cwm Cadnant Valley (for your
records)";

$title2 ="A Booking Enquiry from the Cwm Cadnant Valley website";

$message ="

-------------------------------------

Booking Enquiry to Cwm Cadnant Valley

-------------------------------------



CONTACT INFORMATION

-------------------



Name: ".$_REQUEST["name"]." (".$_REQUEST["email"].")

Address: ".$_REQUEST["post"]."

Phone: ".$_REQUEST["phone"]."

I would".$_REQUEST["e-con"]." like electronic confirmation of my booking
(if there's availability)



STAY INFORMATION - Personal

---------------------------



Adults: ".$_REQUEST["adult"]."

Children: ".$_REQUEST["child"]."

Infants: ".$_REQUEST["infant"]."

Dogs: ".$_REQUEST["dog"]."

Arriving on ".$_REQUEST["start"]." and departing on ".$_REQUEST["end"]."



STAY INFORMATION - Units

------------------------



Tents: ".$_REQUEST["tent"]."

Hike tents: ".$_REQUEST["backpack"]."

Caravans: ".$_REQUEST["tourer"]."

Motorhomes: ".$_REQUEST["motorhome"]."



We will ".$_REQUEST["tenthu"]."require electric hook-up for our tent.

We will ".$_REQUEST["awning"]."be using an awning or gazebo.



Cars: ".$_REQUEST["car"]."



Size: ".$_REQUEST["size"]."



MISCELLANEOUS INFORMATION

-------------------------



Other information: ".$_REQUEST["info"]."



Your first contact: ".$_REQUEST["1stcont"]."



Please note that the filling out of this form does not guarantee space,
unless further contact has been made.



By making these enquiry, you confirm that you have read and understand
our terms and conditions. Should you have any queries in this regard, you
should contact us to resolve any problems.



We recognise that owing to the nature of the site and the existing
facilities it is possible that certain people may be disadvantaged for
access. The management and staff will work with individuals and their
helpers as appropriate to take all practicable actions to reduce this
inconvenience. If you feel that you have a special access requirement
that may cause problems with a proposed stay at Cwm Cadnant Valley,
please feel free to contact us to discuss possible resolutions.



-------------------

David and June Bird



Cwm Cadnant Valley, Llanberis Road, Caernarfon, Gwynedd, LL55 2DF

Phone: +44 1286 673196 Fax: +44 1286 675941

E-mail: cam...@cwmcadnantvalley.co.uk

Web: http://www.cwmcadnantvalley.co.uk";

mail($email, $title, $message, "From: $CCVemail");

mail($CCVemail, $title2, $message, "From: $email");

echo("<meta http-equiv='refresh' content='0; url=http://
www.cwmcadnantvalley.co.uk/questions.html'>");

} else {

// The error array had something in it. There was an error.

// Start adding error text to an error string.

$strError = '<div class="formerror"><p>Please check the following
and try again:</p><ul>';

// Get each error and add it to the error string

// as a list item.

foreach ($arrErrors as $error) {

$strError .= "<li>$error</li>";

}

$strError .= '</ul></div>';

}



}

?>

<?php echo $strError; ?>

<form method="post" action="<?php echo $PHP_SELF; ?>">

<fieldset>

<legend id="YCI">Contact Information</legend>

<p<?php if (!empty($arrErrors['name'])) echo ' class="formerror"'; ?
>><span class="nw" title="What is your name?"><label for="name">Your name
</label> <input type="text" id="name" name="name" size="30" class="req"
value="<?php echo $_REQUEST['name'] ?>"></SPAN>

<?php if (!empty($arrErrors['name'])) echo '<br><span class="errortext">'.
$arrErrors['name'].'</span>'; ?></p>

<p<?php if (!empty($arrErrors['email'])) echo ' class="formerror"'; ?
>><span class="nw" title="What is your e-mail address?"><label
for="email">Your e-mail address </label> <input type="text" id="email"
name="email" size="30" class="req" value="<?php echo $_REQUEST['email'] ?
>"></SPAN>

<?php if (!empty($arrErrors['email'])) echo '<br><span
class="errortext">'.$arrErrors['email'].'</span>'; ?></p>

<p><label for="phone">Phone:</label><input name="phone" type="text"
size="30" id="phone" value="<?php echo $_REQUEST['phone'] ?>"></p>

<p title="Please enter your address here."><label for="post">Your
Address:</label><BR>

<textarea name="post" id="post" rows="9" cols="75"><?php echo $_REQUEST
['post'] ?></textarea></p>

<p>If we have availability and you are able to book, can Cwm Cadnant
Valley send you confirmation electronically <INPUT TYPE="RADIO"
class="rad" name="e-con" id="EYes" value="" checked><label
for="EYes">Yes</label> or <INPUT TYPE="RADIO" class="rad" name="e-con"
id="ENo" value=" not"><label for="ENo">No</label> (in PDF format)? If you
opt for electronic delivery, it is your responsibility to ensure any e-
mail address given for contact is correct.</p>

</fieldset>

<fieldset>

<legend id="PS">Proposed Stay</legend>

<p>I am looking for space for...</p>

<p><span class="nw" title="How many adults in your group?"><input
type="text" id="adult" name="adult" size="2" value="<?php echo $_REQUEST
['adult'] ?>"><label for="adult"> adult(s)</label>,</SPAN>

<span class="nw" title="How many children in your group?">

<input type="text" name="child" id="child" size="2" value="<?php echo
$_REQUEST['child'] ?>"><label for="child"> child(ren) (aged 5-15)</
label>,</SPAN> <span class="nw" title="How many infants in your group?">

<input type="text" name="infant" id="infant" size="2" value="<?php echo
$_REQUEST['infant'] ?>"><label for="infant"> infant(s) (less than 5 years
old)</label>,</SPAN> <span class="nw" title="How many dogs in your
group?">and

<input type="text" name="dog" id="dog" size="2" value="<?php echo
$_REQUEST['dog'] ?>"><label for="dog"> dog(s)</label>,</SPAN><BR>

in <span class="nw" title="How many tents in your group?">

<input type="text" name="tent" id="tent" size="2" value="<?php echo
$_REQUEST['tent'] ?>"><label for="tent"> Tent(s)</label>,</SPAN>

<span class="nw" title="How many touring pitches would you like?">

<input type="text" name="tourer" id="tourer" size="2" value="<?php echo
$_REQUEST['tourer'] ?>"><label for="tourer"> Tourer pitch(es)</label>,</
SPAN>

<span class="nw" title="How many motorcaravans in your group?">

<input type="text" name="motorhome" id="motorhome" size="2" value="<?php
echo $_REQUEST['motorhome'] ?>"> <label for="motorhome"> Motorcaravan(s)</
label>,</SPAN>

<span class="nw" title="How many backpacker tents in your group?">

<input type="text" name="backpack" id="backpack" size="2" value="<?php
echo $_REQUEST['backpack'] ?>"><label for="backpack"> Hike Tent(s)</
label></SPAN> (without cars or other motorised vehicles), and

<span class="nw" title="How many cars or other vehicles in your group?">

<input type="text" name="car" id="car" size="2" value="<?php echo
$_REQUEST['car'] ?>"><label for="car">Vehicle(s)</label>.</SPAN></p>

<p>Will you be using an awning and / or gazebo, <INPUT TYPE="RADIO"
class="rad" name="awning" id="AYes" value=""><label for="AYes">Yes</
label> or <INPUT TYPE="RADIO" class="rad" name="awning" id="ANo"
value="not " checked><label for="ANo">No</label>?</p>

<p>If you are bringing tents, would you like hook-up, <INPUT TYPE="RADIO"
class="rad" name="tenthu" id="HYes" value=""><label for="HYes">Yes</
label> or <INPUT TYPE="RADIO" class="rad" name="tenthu" id="HNo"
value="not " checked><label for="HNo">No</label>?</p>

<p><EM>Please note, tent pitches come without hook-up by default. If you
require hook-up, please let us know, as these are classed as tourer
pitches (and are charged as such).</EM></p>

<p<?php if (!empty($arrErrors['start'])) echo ' class="formerror"'; ?
>><span class="nw" title="When would you like to arrive?"><label
for="start">Arriving on </label> <input type="text" id="start"
name="start" size="25" class="req" value="<?php echo $_REQUEST['start'] ?
>"></SPAN>

<?php if (!empty($arrErrors['start'])) echo '<br><span
class="errortext">'.$arrErrors['start'].'</span>'; ?></p>

<p<?php if (!empty($arrErrors['end'])) echo ' class="formerror"'; ?
>><span class="nw" title="When would you like to leave?"><label
for="end">Leaving on </label> <input type="text" id="end" name="end"
size="25" class="req" value="<?php echo $_REQUEST['end'] ?>"></SPAN>

<?php if (!empty($arrErrors['end'])) echo '<br><span class="errortext">'.
$arrErrors['end'].'</span>'; ?></p>

<p<?php if (!empty($arrErrors['size'])) echo ' class="formerror"'; ?>>

<label for="size">Dimensions (or a make and model that we can search for)?
</label><br>

<textarea id="size" name="size" rows="4" cols="75" class="req"><?php echo
$_REQUEST['size'] ?></textarea>

<?php if (!empty($arrErrors['size'])) echo '<br><span class="errortext">'.
$arrErrors['size'].'</span>'; ?></p>

<p>We require the size of your unit so we can allocate you appropriate
pitches. We reserve the right to charge for additional pitches if your
unit is too large to safely fit on one pitch. Should you subsequently
alter your requirements, we'd appreciate it if you let us know as soon as
possible. If your unit is larger than booked we cannot guarantee
appropriate accomodation for your stay, and reserve the right to charge
you for up to 7 days of lost revenue if we cannot subsquently re-let the
pitch.</p>

</fieldset>

<fieldset>

<legend id="OI">Other Information</legend>

<p><label for="info">Any further information we ought to be aware of (for
example - you want a pitch near to the showers, or away from the play-
area):</label><BR>

<textarea id="info" name="info" rows="7" cols="75"><?php echo $_REQUEST
['info'] ?></textarea></p>

<p title="For example: The Big sites book, Welsh Tourist Board, Other
webpages..."><label for="cont">How did you first get details of <a href="/
home.html" title="Cwm Cadnant Valley Homepage">Cwm Cadnant Valley</a>?:</
label><BR>

<textarea id="cont" name="1stcont" rows="4" cols="75"><?php echo $_REQUEST
['1stcont'] ?></textarea></p>

</fieldset>

<fieldset>

<legend id="BC">Specific Booking Conditions</legend>

<p><b>Mininum Booking Periods</b>. Bookings for Easter and May Bank
Holiday weekends to be for a minimum of 3 continuous nights, and for
Spring and August Bank Holiday weekends for a minimum of 5 continuous
nights (this may be revised closer to the weekends in question, and is
subject to space being available).</p>

<p><b>Cancellation Policy</b>. Should you cancel your booking or fail to
turn up, the following will apply:</p>

<ul>

<li>Up to 28 days prior to arrival: Full refund of deposit (less
&pound;1.50 / unit administration charge).</li>

<li>7-28 days prior to arrival: No refund of any deposit.</li>

<li>Less than 7 days prior to arrival: Full fees to be paid.</li>

</ul>

<p>Bookings made less than 7 days prior to intended arrival shall have
full fees paid at time of booking. Payment may be made using MasterCard,
Visa, Delta, Maestro, Electron or Solo Cards. Should the card transaction
fail for any reason we shall consider that the booking has not been made.
We will attempt contact by any given means to check the card details.</p>

<p>During the <a href="fees2009.html#Cal">high season</a> advance
bookings of two or more nights only will be accepted.</p>

<p>Please note that the filling out of this form does not guarantee
space, unless further contact has been made.</p>

<p>If we have agreed to e-mail you your booking confirmation, and this is
not received within 48 hours of booking it is your responsibility to
contact us to let us know you have not managed to pick the e-mail up.
This form automatically sends a copy of your enquiry to the e-mail
address you provide - this is not confirmation, but merely a copy of your
enquiry for your records.</p>

<p>Should you have any queries about our Terms and Conditions, you should
<a href="contact.html">contact us</a> with your query.</p>

</fieldset>

<!--#include virtual="motd.html" -->

<p id="SF" class="centre"><input type="submit" value="Make enquiry"
name="Submit" class="BUT"></p>

</form>

<p class="nav centre">Jump to... <a href="#YCI">Your Contact Information</
a>, <a href="#PS">Details of your proposed stay</a>, <a href="#OI">Other
useful information</a>, <a href="#BC">Specific Booking Conditions</a>.</p>

<!--#include virtual="/access.html" -->

<p>Owing to the outdoor nature of a camping experience, there may be
times when we have to cancel reservations due to inclement weather
conditions or similar. We will make efforts to contact you by any given
means if this is the case. In these circumstances any deposit paid can be
transferred to another date (within the current season), or refunded by
the same means used to pay it.</p>

<?php include("pic.html"); echo('</div>'); include("nav.html"); include
("foot.html"); ?>

</body></html>
ENDS

Many thanks

Stephan

Stephan Bird

unread,
Jul 26, 2017, 5:55:56 PM7/26/17
to
Hi - just wanted to gently follow up (appreciate there's a lot of text)

Stephan

Jerry Stuckle

unread,
Jul 26, 2017, 8:22:13 PM7/26/17
to
On 7/26/2017 5:55 PM, Stephan Bird wrote:
> Hi - just wanted to gently follow up (appreciate there's a lot of text)
>
> Stephan
>
> On Sat, 06 May 2017 15:47:27 -0500, Stephan Bird wrote:
>

<code snipped>

I'm not sure what your problem is. I don't see any post from you on May
6, 2017 in this newsgroup. Just what you've posted here.

When you have problems with scripts not working properly, the first
place to look is the error log (production system). For this to work,
your php.ini file must have

error_reporting=E_ALL; // or E_ALL | E_NOTICE
error_log="path_to_error_log";

Then see what, if any, errors are logged.

--
==================
Remove the "x" from my email address
Jerry Stuckle
jstu...@attglobal.net
==================
0 new messages