View Complete Thread
  • Re: Undefined index errors on contact form

    Jan 10, 2012 10:43 AM|agilb884|LINK

    I had a similar problem. I was able to get my php scripts to work from a web app in IIS 7.0 but not when running the same site from the Expression Web Development Server. The problem was the way I had set up PHP in my Expression Web Dev Server. I was pointing at the wrong php executable. Originally I had set the server up to use "php-win.exe". When I changed it to use "php-cgi.exe" my undefined index problem was resolved. I am using version: php-5.4.0RC4-Win32-VC9-x86 on a 32 bit Windows Vista laptop (Service Pack 2). Lastly, I recommend wrapping your code in an if block that tests for the availability of the indices you are accessing. The following is a snippet I "borrowed" off of another post. In my case, 'fname' is the name of the array index I am accessing. if(isset($_POST) && array_key_exists('fname',$_POST)) Bottom line, this may be a configuration issue and have nothing to do with your code.