Had a simple form script that suddenly stopped working


Posted on 16th Feb 2014 07:03 pm by admin

It was made about a year ago and had been working fine. Last time it was known to work for sure was in early October. I got a message from someone saying they didn't think it work and I tried it through both Firefox and IE and it didn't work.

What it does do right now is load up fine but when you fill out the form and hit submit it just clears the form. Since it's having the same issue on two different browsers I'm wondering if maybe my host (yahoo) did something or if it's some universal browser change. Any help would be great because I don't see anything wrong with it but I'm far from an expert. I just need to get it working again.

Also here is the website to where it is if you want to see how it acts.

http://www.thebrocadeblackbird.com/ then click on anything and then go to consultation.


Code: <html>
<head>
<style type="text/css">
head { margin: 0 0 0 0 }
body { margin: 0 0 0 0 }
img
{
position:absolute;
top:0px;
left:20px;
}
div.alertone
{
position:absolute;
top:10px;
left:295px;
z-index: 1;
}
div.alerttwo
{
position:absolute;
top:30px;
left:68px;
z-index: 1;
}
div.alertthree
{
position:absolute;
top:10px;
left:45px;
z-index: 1;
}
div.one
{
position:absolute;
top:35px;
right:355px;
z-index: 1;
}
div.two
{
position:absolute;
top:35px;
right:50px;
z-index: 1;
}
div.three
{
position:absolute;
top:74px;
right:355px;
z-index: 1;
}
div.four
{
position:absolute;
top:72px;
right:103px;
z-index: 1;
}
div.five
{
position:absolute;
top:112px;
right:355px;
z-index: 1;
}
div.six
{
position:absolute;
top:112px;
right:50px;
z-index: 1;
}
div.seven
{
position:absolute;
top:145px;
right:505px;
z-index: 1;
}
div.eight
{
position:absolute;
top:145px;
right:48px;
z-index: 1;
}
div.nine
{
position:absolute;
top:73px;
right:50px;
z-index: 1;
}
div.submit
{
position:absolute;
top:240px;
right:60px;
z-index: 1;
}
div.required
{
position:absolute;
top:338px;
right:285px;
font-size: 85%;
color: #808284;
z-index: 1;
}
</style>
</head>
<body>
<?php
# ATTENTION! - IF YOU COPY THIS CODE, CHANGE THE NEXT LINE!
$to = "design@thebrocadeblackbird.com";
$ask = 0;
if (($FName == "") && ($Email == "") && ($PriPhone == "") && ($TimeContact == "") && ($TypeEvent == "") && ($DateEvent == "") && ($Additional == ""))
{
$ask = 1;
}
elseif (($FName == "") || ($Email == "") || ($TypeEvent == "") || ($DateEvent == ""))
{
$ask = 1;
echo "<div class='alertone'>You missed some fields.</div>";
}
if ($ask == 1)
{
echo "
<img src='Consultation_BlueBox.jpg' />
<form name='form' method='post' action='Formmiddle.php'>
<div class='one'><font color='#808284'>*</font>Name <input type='text' name='FName' value='$FName' size='20'></div>
<div class='two'><font color='#808284'>*</font>E-Mail Address <input type='text' name='Email' value='$Email' size='20'></div>
<div class='three'>Phone Number <input type='text' name='PriPhone' value='$PriPhone' size='20'></div>
<div class='four'>Best Time to Contact <input type='text' name='TimeContact' value='$TimeContact' size='11'></div><div class='nine'><select name='AMPM' value='$AMPM'><option value='AM'>am</option><option value='PM'>pm</option></select></div>
<div class='five'><font color='#808284'>*</font>Type of Event <input type='text' name='TypeEvent' value='$TypeEvent' size='20'></div>
<div class='six'><font color='#808284'>*</font>Date of Event <input type='text' name='DateEvent' value='$DateEvent' size='20'></div>
<div class='seven'>Additional Notes </div><div class='eight'><textarea name='Additional' rows='4' cols='54' wrap='hard'>$Additional</textarea></div>
<div class='required'>*required fields</div>";

echo "<div class='submit'><input type='image'SRC='SubmitBox.jpg'></div>";
echo "</form>";
}
else
{
$message = "Name: $FNamenE-mail: $EmailnPrimary Phone: $PriPhonenBest Time to Contact: $TimeContact $AMPMnType of Event: $TypeEventnDate of Event: $DateEventn Additional: $Additionaln";
$eLog="/tmp/mailError.log";
//Get the size of the error log
//ensure it exists, create it if it doesn't
$fh= fopen($eLog, "a+");
fclose($fh);
$originalsize = filesize($eLog);

mail ($to, "Website Email", $message);

/*
* NOTE: PHP caches file status so we need to clear
* that cache so we can get the current file size
*/
clearstatcache();
$finalsize = filesize($eLog);

//Check if the error log was just updated
if ($originalsize != $finalsize) {
print "<div class='alertthree'>There was a problem sending the mail. Please try again later or send the message to<a href="$to">$to</a> using your own mail client progam.</div>";
} else {
echo "<div class='alerttwo'>Thank you for your interest in The Brocade Blackbird. You will be contacted shortly.</div> <img src='Consultation_BlueBox.jpg' />";
}
}

?>


</body>
</html>

No comments posted yet

Your Answer:

Login to answer
178 Like 18 Dislike
Previous forums Next forums
Other forums

pointer 102 question
I read a book
1
2
3
4
5
6
7
8
9
10
11
12
int main() {

Help with syntax
Hi all!

The $bridge variable is not getting passed while it is contained in the line below:

losing session vars when arriving from an email link
Hi,

I've got a confirmation script made that sends an email with a link for a user to confirm

TemplatePower & AJAX
Hi all,



I'm currently implementing some AJAX features in my PHP-framework (which is b

Needing Youtube thumb nail fix.
I have a script on a site that pulls in you-tube videos,
The problem is, that the thumb nails for

Last Weeks sDate and eDate.
sDate - Start Date
eDate - End Date

I need to pull two dates for "Last Week" whi

Is it possible to view php source code??
Hi All

I was just wondering if it's possible to view a websites php source code?
I know

Trouble checking SESSION cookie
I am trying to use $_SESSION cookies to verify admin privileges .
I don't understand why this is

Displaying data from database into a 2 dimensional table
Good day!

I'm a beginner in PHP and I'm not expecting a full coding for this qestion. I'm jus

Could Someone Please Debug This?
I was wondering if someone could debug this script for me. I realize it's not the tidest script (and

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash