Ive been developing a site on my local Apache box for a friend . His host uses IIS. When i uploaded the site i now get errors and my forms no longer work.
I thought php was cross platform. Is there anything i should automatically change for a move to IIS?
Compare the PHP setup on both machines.
Print out the phpinfo() and compare the settings, it will give clues as to what is different.
This has probably nothing to do with the web server.
Your errors in php.ini are set to "notice", try changing that to "warning" or higher to match your Apache setup.
Also correct line 5 of div_ale.php. This is the only one that I looked at; anywhere else you entered "localhost" without the quotes needs to be changed.
You're getting the 404 error because you're referencing PHP_SELF but should instead be referencing $_SERVER['PHP_SELF'] in line 28 of add_contact_al.php
How did I know? I actually looked at the HTML source of the page that script produced.
As far as those "undefined index" errors go:
Insufficient data for a meaningful answer. No one on this site has any idea what lines 5, 6 and 7 of that script looks like.
Then those errors makes perfect sense. If I go directly to that page, I have submitted no form to the script, so $_POST will be empty. So those indeces do not exist.
You're getting those errors because your script assumes the variables will exist. It should check for the existence of the variables in $_POST before trying to use them. isset() and array_key_exists() are two candidates for testing functions.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.