I am learning php after using asp for years.
using dreamweaver 8 os is xp pro
i have a simple email form with a page redirect. I used php script email with mail for windows object.
page can be found http://www.bellchemicalservice.com
the problem i have is when the address is
http://www.bellchemicalservice.com/index.php the scripts work as they
should, but when the address is just http://www.bellchemicalservice.com it
does not work; neither the redirect nor the send mail.

i have tested locally with apache server on both ie7 and firefox and
remotely with windows 2003 server on both ie7 and firefox. same results?

thanks for your help,
jbwebworks.com

    you should look into apache's configuration file, it may be set up to look for a primary page other than index.*

      i am new to php. i downloaded and installed from wampserver.com/en/. so you are saying that i should look in apache config file which i think is httpd.conf?
      what should i look for?
      so the index.php page that is on the remote server which is windows 2003 would possibly be effected by the apache config file on my development pc to not execute the email or redirect script?

      thanks

        Of course not, the issue is local to whatever machine where the script you are proving for is housed.

        in httpd.conf check for the following values:

        </Directory>
        
        #
        # DirectoryIndex: sets the file that Apache will serve if a directory
        # is requested.
        #
        <IfModule dir_module>
            DirectoryIndex index.php index.php3 index.html index.htm index.html.var
        </IfModule>

          i had this correct in httpd.config on local machine

          <IfModule dir_module>
          DirectoryIndex index.php index.php3 index.html index.htm index.html.var
          </IfModule>

            At a guess, the script is doing some sort of check against one of the $SERVER['HTTP*'] variables, such as $_SERVER['HTTP_REFERER'] and is not "smart" enough to handle differences between which URL was used.

              Thanks that is what the problem was.
              i had a $server['http_referer'] variable from and 'any form post' trigger resulting in this code.
              if (($
              SERVER["REQUEST_METHOD"] == "POST") && (strpos($SERVER["HTTP_REFERER"], $SERVER["SERVER_NAME"].$SERVER["SCRIPT_NAME"])===0 || strpos($SERVER["HTTP_REFERER"], $SERVER["SERVER_NAME"].$SERVER["SCRIPT_NAME"])>0))

              changed to submit button pressed trigger and it worked perfectly.

              thanks very much for your help

                Write a Reply...