Problem with IIS / PHP / MySQL

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
gavinh
Forum Newbie
Posts: 1
Joined: Mon Oct 26, 2009 12:51 am

Problem with IIS / PHP / MySQL

Post by gavinh »

Hi,
I have just installed PHP and MySQL on IIS 5.1 (throughout this problem I have tried multiple different versions of PHP and MySQL).

I copied the website and the DB I was working on, and it worked correctly, was registering new users to the DB, retrieving data etc. Howveer one of the functions of the site is to insert information into the DB and it is not working, I am getting the failure response each time. I know the code works fine as I have tested it on wampserver on my laptop, and also I have tested it online (the site is going onto the LAN in work so I need to use IIS).

I am hoping someone can point out where I have gone wrong in setting it up?

I have the relevant code below, however this exact code is working fine on multiple different servers (albeit all Apache servers)

I really hope someone can point out what I have done wrong in the setup. All of the other functionality driven by the DB seems to be working fine, and I have PHPmyadmin working fine etc too.

Code: Select all

 
/* Include Files *********************/
session_start(); 
include 'library/config.php';
include 'library/opendb.php';
 
include("logon.php");
/*************************************/
 
$title   = $_POST['title'];
$emeraldstandard  = $_POST['emeraldstandard'];
$emeraldexpress  = $_POST['emeraldexpress'];
$emeraldpro  = $_POST['emeraldpro'];
$emeraldpayflow   = $_POST['emeraldpayflow'];
 
if(!isset($_POST['license'])){ 
    $license  = 'no';
}
else if (isset($_POST['license'])&&$_POST['license']=="yes"){
    $license = 'yes';
}
if(!isset($_POST['certified'])){ 
    $certified  = 'no';
}
else if (isset($_POST['certified'])&&$_POST['certified']=="yes"){
    $certified  = 'yes';
}
if(!isset($_POST['hosted'])){ 
    $hosted  = 'no';
}
else if (isset($_POST['hosted'])&&$_POST['hosted']=="yes"){
    $hosted  = 'yes';
}
$language  = $_POST['language'];
$demo  = $_POST['demo'];
$demouser  = $_POST['demouser'];
$demopass  = $_POST['demopass'];
 
 
    if(!get_magic_quotes_gpc())
    {
        $title   = addslashes($title);
        $emeraldstandard  = addslashes($emeraldstandard);
        $emeraldexpress  = addslashes($emeraldexpress);
        $emeraldpro  = addslashes($emeraldpro);
        $emeraldpayflow   = addslashes($emeraldpayflow);
        $modified  = addslashes($title);
        $hosted  = addslashes($hosted);
        $demo  = addslashes($demo);
        $demouser  = addslashes($demouser);
        $demopass  = addslashes($demopass);
    }
 
    $query = "INSERT INTO solutions (title, emeraldstandard, emeraldexpress, emeraldpro, emeraldpayflow, license, certified, hosted, demo, demouser, demopass, language) VALUES ('$title', '$emeraldstandard',  '$emeraldexpress', '$emeraldpro', '$emeraldpayflow', '$license', '$certified', '$hosted', '$demo', '$demouser', '$demopass', '$language')";
    mysql_query($query) or die('Error ,query failed');
 
?>
 
 
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: Problem with IIS / PHP / MySQL

Post by papa »

Tough nut.

I recently installed php with IIS (though IIS 6) using SQL Server 2005. I used this tutorial:
http://peterguy.com/php/install_IIS6.html

Double check and see that everything looks ok.
Doug G
Forum Contributor
Posts: 282
Joined: Sun Sep 09, 2007 6:27 pm

Re: Problem with IIS / PHP / MySQL

Post by Doug G »

I'd start with a phpinfo() and verify the necessary php modules are loaded properly.
Post Reply