bootstrapbay / contact-form

Working Bootstrap Contact Form With PHP
224 stars 270 forks source link

Undefined index? #1

Open Flex-WKD opened 9 years ago

Flex-WKD commented 9 years ago

Hello,

I just copied your index.php file to my index file and not changed a single line (yet) and I'm getting this error? I haven't changed any of the file/code.

Notice: Undefined index: submit in /public_html//contactus/index.php on line 2

imti321 commented 9 years ago

I also copied the code and got this error.I was getting this error when i copied this code to my index file then i changed index and copied only the form code nothing else and i get same error contact form

cyda89 commented 9 years ago

Have you guys set the "$to" to your desired mail adress? Set it to youradress@yourprovider.com/net/whatever. For example: $to = 'YOURADRESS@gmail.com';

regards

edit: thanks for the template, works for me so far (y)

Flex-WKD commented 9 years ago

@cyda89 yep already edited that still no luck :(

cyda89 commented 9 years ago

@Flex-WKD do you have php installed on your webserver? is phpmail working? pushing the index.php to your webserver without copying anything and only changing the $to might clear things up. if it still doesnt work, you probably need to configure your webserver.

Flex-WKD commented 9 years ago

@cyda89 Yeah it's enabled and installed and all other scrips and mail scripts are working fine my host said it's the code.

I'll try on another server with my other provider and see how that goes.

Update: Just tried on another server and it's returning

Notice: Undefined index: submit in /public_html/knowledgebase/bootstrapbay.php on line 2 and;

Notice: Undefined variable: errName in /home/flexmani/public_html/knowledgebase/bootstrapbay.php on line 64, 71, 78, 85 and 95.. bootstrapbay

yateendra commented 9 years ago

How to add ajax into it?

morettimatheus commented 9 years ago

The problem is this code is wrong. You should never echo variables without testing their existance. To fix it, simply add an if(isset($var)) {echo $var} where var is obviously your desired variable

mdogan1 commented 8 years ago

Hello I just copied code on my index and when i preview in the browser I got something like on the image.

ekran resmi 2015-10-12 oo 10 41 28
MaliciaM commented 8 years ago

Hi.

I'm a to-the-core-noob in php... but I think the "Undefined variable: errName " and so on are there because they weren't defined at the beginning. I had the same problem and after some time, I simply added at the very beginning of the php-part.

$errName =''; $errEmail =''; $errMessage =''; $errHuman =''; $result ='';

At least it looks like it works now for me. If this is the wrong solution could you tell me what is the correct solution? Thanks :)

vengatowen commented 8 years ago

@mustyprogrammer You need to rename the html file in to .php so that it will work.

ErikThiart commented 8 years ago

Code does not work.

panneerselvam03 commented 8 years ago

Code is not working for me...

inaztulip commented 8 years ago

Code does not work for me~

fabeka commented 7 years ago

code not, not not

fabeka commented 7 years ago

please help. You are doing a good job