PDA

View Full Version : My form



nick1346
04-24-2006, 12:11 PM
Hi All,

I've finally got my form up and running, but I've had a few problems with it in the last few days. Could some off you nice (gulp!) friendly people test it for me and have a general nose round the site whilst your there?
The short way to the form: http://www.yourlocal.org.uk/yourpage2.html
or you can take the scenic route by clicking on the link at the bottom of
this page, http://www.yourlocal.org.uk/demo.html
Cheers
nick

nick1346
04-24-2006, 12:17 PM
It would be great if some of you could actually quickly fill the form out, but don't worry about the photo's bit even though it says it's required, it'll send fine without.
Thanks
Nick

Girlonthehill
04-24-2006, 12:26 PM
Hi Nick, I visited your site, which looks great, by the way. I filled in your form as Donald Duck and got all the way through only to submit and get an internal server error. Sorry matie - I tried to fill all the fields in with something, although made up, would fit the parameters of the fields.

kassi59
04-24-2006, 12:32 PM
Hey this is what I got after submitting the form.

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@yourlocal.org.uk and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

nick1346
04-24-2006, 12:37 PM
Hi Amanda and Kate,

Sods law isn't it! I've been getting this for a few days, form works for four or five submissions then goes mad. Try a few things today and it seems to be resolved then as soon as I open me gob, it goes off on one!
Any ideas?
Yours going slightly grey
Nick

Girlonthehill
04-24-2006, 12:44 PM
Hi Amanda and Kate,

Sods law isn't it! I've been getting this for a few days, form works for four or five submissions then goes mad. Try a few things today and it seems to be resolved then as soon as I open me gob, it goes off on one!
Any ideas?
Yours going slightly grey
Nick

Nick, you need Navy Rescue Mate! Lol.

NavalDesign is your man - he might have a clue why it's happening.

kassi59
04-24-2006, 12:51 PM
Im in total agreement with Amanda! when your down and in trouble find a navy man to save ya!
I know that when I had trouble with my form it was within the html of the submit options...but argh...Im not real positive of how or what to tell ya as Id more than likely cause more problems that not!
good luck!

nick1346
04-24-2006, 12:52 PM
Nick, you need Navy Rescue Mate! Lol.

NavalDesign is your man - he might have a clue why it's happening.

Haha, there's a tv series in that, Naval could be played by David Hasslehoff. I apologise for the gratuitous use of hairy imagery.

I shall put a distress flare up.

SChajin
04-24-2006, 02:05 PM
Hey guy,

Sorry it didn't work for me.

Andy128
04-24-2006, 03:47 PM
nick1346,

Try changing the encode type in the form. I notice that you have it as
multi part/ form data. Try leaving this balnk.

Just a thought

Andy

navaldesign
04-24-2006, 06:04 PM
NO, please DO NOT change the encoding.
The problem has probably something to do with the changes you have made to use two upload fields. Please use http://www.navaldesign.info/feedback13.html to give me your loggin information: IP, username and password. I'll see what i can do.

nick1346
04-24-2006, 06:40 PM
Hi Naval

I've just the details,

Cheers my friend

Nick

kassi59
04-25-2006, 06:38 PM
Whoo Hoo Nick! youre saved! good luck!

nick1346
04-25-2006, 08:46 PM
Hi Kassi,

Not quite yet, there's still something not right somewhere.
I asked Naval design to have a look and the code works perfectly for him and it's based on a code he's been running for many months without a hitch. So it must be a server problem right? Aparently not say BV, it's the code they say. If Giorgio says the code is sound then I'll go with that, it may just 'sort' itself. BV have told me how to reset the form by altering my public_html permisions SOOOO what I'd like as many of you as possible to do is attack my form and see how often it works and I'll get an idea of how much of a problem it is.
One thing Kassi by what you say I get the impression that you've used my form successfully because if you did then I didn't recieve anything, which could mean it's my email?

Cheers

Nick

davidundalicia
04-25-2006, 10:54 PM
nick,
tested your form and everything seemed to be working fine...
even a wrong email address was picked up....
can you email me a copy of your php file as I seem
to be having problems with my contact page.
kiko@mvtinia.com
cheers pal

nick1346
04-25-2006, 11:39 PM
Hi Davaidundalicia (David and Alicia?)

Thanks for your response I picked the form bit up but not this at first! The code on the contact page I haven't even looked at to honest as this 'upload page' is the important one. I Have a feeling the problem rests in my email setup but I want to be proved wrong.
Your site by the way? Is that place up as a holiday villa?Let me know
Cheers mate
Nick

nick1346
04-25-2006, 11:41 PM
sorry the code link for the main contactlink page!!!
http://www.yourlocal.org.uk/script.html

davidundalicia
04-26-2006, 12:17 AM
hi nick,
Thanks for the code, I will study it in the morning when I am less tired.
Yes Alicia is my better half, hence, D&A.
My holiday place to let has recently been described as
a "Penthouse type Apartment" in the sun....
Feel free to book any time.............................

kassi59
04-26-2006, 10:42 AM
Hi Kassi,

Not quite yet, there's still something not right somewhere.
I asked Naval design to have a look and the code works perfectly for him and it's based on a code he's been running for many months without a hitch. So it must be a server problem right? Aparently not say BV, it's the code they say. If Giorgio says the code is sound then I'll go with that, it may just 'sort' itself. BV have told me how to reset the form by altering my public_html permisions SOOOO what I'd like as many of you as possible to do is attack my form and see how often it works and I'll get an idea of how much of a problem it is.
One thing Kassi by what you say I get the impression that you've used my form successfully because if you did then I didn't recieve anything, which could mean it's my email?

Cheers

Nick


Im not by any means pro here! - I seemed to have a similar issue with my form. After filling it out it went nowhere..I solved it by re writing the html and gave it direction. below is the outline I used with the script for the clear and submit buttons:
--------------------------------------------------------------
<p><br>
<input type="submit" value="Send">
<input type="reset" value="Clear the form">
<!-- Option 1 -->
<input type="hidden" name="subject" value="Survey Results">
<!-- Option 2 -->
<input type="hidden" name="required_fields" value="Name,URL">
<!-- Option 3
<input type="hidden" name="next_url" value="http://www.geocities.com//index.html">
-->
</form>
------------------------------------------------------------------
I imbarrassingly enough didnt use the BV as Im lazy and never looked to see if there was one! <brutal self honesty!> I have used this and re written to my certain needs in the past and Im used to it, so I just grabbed and ran!
dont know if that helps or not - but if it does then email me and I can give you more info on the script! - kassi1959****.com

kassi59
04-26-2006, 10:50 AM
I just filled it out and it worked wonderfully. I had an error to go back and insert my true email, I did so, then it submitted nicely.
When I fill forms, Im a "tab" person, and I did notice that that option is all over the board when I should be directed to the next query..

nick1346
04-26-2006, 11:58 AM
Thanks kate. I appreciate the help
I now actually think I've spotted the problem, but i can't sort it put till this evening. It looks like it crashes everytime someone sends one photo, two or no photos works fine, but one crashes it. Easy to fix.
By the way I'm not sure what you mean in your last post.
Cheers
nick

nick1346
04-29-2006, 12:20 PM
Hello all
I'm sorry to raise this old chestnut again, but I now know what is causing the problem is. On my form www.yourlocal.org.uk/yourpage2.html (http://www.yourlocal.org.uk/yourpage2.html)
I have two file attachment bits for photo's, called photo1 and photo2 respectively. Now if both fields have a file attached then all is well, the form sends. If niether filed is sent then all sends fine. The problem is caused when photo1 is the only field completed, this then changes the permisions on my public html folder to 777 and gives out the internal server error. Now the odd thing is that if you fill out photo2 only then it works perfectly. Now I've tried everthing to resolve this by myself I know your all busy enough and I've already recieved a huge amount of support especially from Naval Design, but I just can't get it to work properly. Can I ensure that both photo fields are filled out or that it will send fine no matter which photo fields are filled out. I can sort out the text only validation fields but I'm baffled by this.
My script
<?php
// Receiving variables
@$name = addslashes($_POST['name']);
@$company_name = addslashes($_POST['company_name']);
@$address1 = addslashes($_POST['address1']);
@$address2 = addslashes($_POST['address2']);
@$town = addslashes($_POST['town']);
@$county = addslashes($_POST['county']);
@$postcode = addslashes($_POST['postcode']);
@$phone = addslashes($_POST['phone']);
@$email = addslashes($_POST['email']);
@$title = addslashes($_POST['title']);
@$other = addslashes($_POST['other']);
@$photo1_Name = $_FILES['photo1']['name'];
@$photo1_Size = $_FILES['photo1']['size'];
@$photo1_Temp = $_FILES['photo1']['tmp_name'];
@$photo1_Mime_Type = $_FILES['photo1']['type'];
@$photo2_Name = $_FILES['photo2']['name'];
@$photo2_Size = $_FILES['photo2']['size'];
@$photo2_Temp = $_FILES['photo2']['tmp_name'];
@$photo2_Mime_Type = $_FILES['photo2']['type'];
@$namepage = addslashes($_POST['namepage']);
@$mainbody = addslashes($_POST['mainbody']);
@$contact = addslashes($_POST['contact']);
@$postcode2 = addslashes($_POST['postcode2']);
function RecursiveMkdir($path)
{
if (!file_exists($path))
{
RecursiveMkdir(dirname($path));
mkdir($path, 0777);
}
}
// Validation
if (strlen($email) == 0 )
{
header("Location: yourpage2/upload_errortypeemail.html");
exit;
}
if (strlen($name) == 0 )
{
header("Location: yourpage2/upload_errortypename.html");
exit;
}
if (strlen($company_name) == 0 )
{
header("Location: yourpage2/upload_errortypecomname.html");
exit;
}
if (strlen($address1) == 0 )
{
header("Location: yourpage2/upload_errortypeaddress.html");
exit;
}
if (strlen($town) == 0 )
{
header("Location: yourpage2/upload_errortypeaddress.html");
exit;
}
if (strlen($county) == 0 )
{
header("Location: yourpage2/upload_errortypeaddress.html");
exit;
}
if (strlen($postcode) == 0 )
{
header("Location: yourpage2/upload_errotypeaddress.html");
exit;
}
if (strlen($phone) == 0 )
{
header("Location: yourpage2/upload_errortypephone.html");
exit;
}
if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email))
{
header("Location: yourpage2/upload_errortypeemail.html");
exit;
}
if (strlen($email) == 0 )
{
header("Location: yourpage2/upload_errortypeemail.html");
exit;
}
if (strlen($title) == 0 )
{
header("Location: yourpage2/upload_errortypetitle.html");
exit;
}
if ($photo1_Size>0)
{
if( $photo1_Size >100000)
{
//delete file
unlink($photo1_Temp);
header("Location: yourpage2/upload_errortypephoto.html");
exit;
}
}if ($photo2_Size>0)
{
if( $photo2_Size >100000)
{
//delete file
unlink($photo2_Temp);
header("Location: yourpage2/upload_errortypephoto.html");
exit;
}
if (strlen($mainbody) == 0 )
{
header("Location: yourpage2/upload_errortypebody.html");
exit;
}
if (strlen($contact) == 0 )
{
header("Location: yourpage2/upload_errortypecontact.html");
exit;
}

$uploadFile = "upload/".$photo1_Name ;
if (!is_dir(dirname($uploadFile)))
{
@RecursiveMkdir(dirname($uploadFile));
}
else
{
@chmod(dirname($uploadFile), 0777);
}
@move_uploaded_file( $photo1_Temp , $uploadFile);
chmod($uploadFile, 0644);
$photo1_URL = "<A href="http://www.yourlocal.org.uk/upload/".$photo1_Name">http://www.yourlocal.org.uk/upload/".$photo1_Name ;
}
$uploadFile = "upload/".$photo2_Name ;
if (!is_dir(dirname($uploadFile)))
{
@RecursiveMkdir(dirname($uploadFile));
}
else
{
@chmod(dirname($uploadFile), 0777);
}
@move_uploaded_file( $photo2_Temp , $uploadFile);
chmod($uploadFile, 0644);
$photo2_URL = "<A href="http://www.yourlocal.org.uk/upload/".$photo2_Name">http://www.yourlocal.org.uk/upload/".$photo2_Name ;
}
// Find Server date and Time
$date = date("l jS F Y, g:i A");
// Find Browser and IPaddress
$browser =$_SERVER['HTTP_USER_AGENT'];
$ip = $_SERVER['REMOTE_ADDR'];
//Sending Email to form owner
$pfw_header = "From: $email\n"
. "Reply-To: $email\n";
$pfw_subject = "New Picture Upload";
$pfw_email_to = "info@yourlocal.org.uk";
$pfw_message = "A new Picture has been uploaded\n"
. "-----------------------------------------\n"
. "\n"
. "\n"
. "name: $name\n"
. "company_name: $company_name\n"
. "address1: $address1\n"
. "address2: $address2\n"
. "town: $town\n"
. "county: $county\n"
. "postcode: $postcode\n"
. "phone: $phone\n"
. "email: $email\n"
. "title: $title\n"
. "other: $other\n"
. "photo1: $photo1_URL\n"
. "photo2: $photo2_URL\n"
. "namepage: $namepage\n"
. "mainbody: $mainbody\n"
. "contact: $contact\n"
. "postcode2: $postcode2\n"
. " \n"
. "Date of upload : $date\n"
. "Browser : $browser\n"
. "IP address : $ip\n";

*****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
header("Location: yourpage2/upload_thankyou.html");
?>
Thanks all
Nick