Forum Moderators: coopster

Message Too Old, No Replies

PHP, SQL and Microsoft 2003 server

         

monolift

9:27 pm on Oct 3, 2003 (gmt 0)

10+ Year Member



I am pretty much a beginner with PHP, but I have a PHP site that was working just fine connecting to a SQL server.

Recently the host moved the whole site over to a Microsoft 2003 server and now nothing works.

I am getting the following error now:
Fatal error: Call to undefined function: mssql_connect()

It also looks like variables are not being posted. When I submit a form, the variables are empty when the form loads.

Are these all installation issues that the host has missed or is there a way to wake SQL up in my code.

coopster

9:33 pm on Oct 3, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I would check the register_globals [us3.php.net] first.

monolift

10:04 pm on Oct 3, 2003 (gmt 0)

10+ Year Member



I think I understand what is wrong, but how do I fix it.

How do I send form variables via a form using POST without having global variables turned to ON?

coopster

10:11 pm on Oct 3, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



This thread should get you going [webmasterworld.com...]

You can always drop a PER_DIRECTORY configuration file with the

register_globals
directive which will make it all work right away while/if you update your variables. It's described in the link, just turn the directive ON again in your case.

monolift

10:37 pm on Oct 3, 2003 (gmt 0)

10+ Year Member



The .htaccess file that the tread talks about is for an Apache server.

This site is on a Microsoft 2003 server. Is there a similar config file that I can add to my php directory on a Microsoft server?

monolift

11:18 pm on Oct 3, 2003 (gmt 0)

10+ Year Member



It looks like I can get around the register_globals issue now - thanks for that posting.

I still have the issue with the unknown function mssql_connect. I read something on another site about a line needing to be uncommented in the php.ini file. The host for this client says that they won't make that change for me.

Is there a way to activate the extension=php_mssql.dll in the php scripts I upload to the site?

coopster

2:40 pm on Oct 4, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



This site is on a Microsoft 2003 server. Is there a similar config file that I can add to my php directory on a Microsoft server?

A search on microsoft's support site on "htaccess" will turn up a few documents that may provide direction. It seems as though you can use .htaccess files with IIS [support.microsoft.com].


As far as the unknown mssql_connect function issue, I'd start by creating and executing a php_info [us4.php.net] script:

<?php
php_info();
?>

to see if the Microsoft SQL Server functions [us4.php.net] are installed. If it isn't even installed yet, you'll need your host to install them.

MonkeeSage

6:24 pm on Oct 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is there a way to activate the extension=php_mssql.dll in the php scripts I upload to the site?

I think you would do it like this...

if (!extension_loaded("mssql")) {
dl("php_mssql.dll");
}

Jordan

shasan

2:49 am on Oct 6, 2003 (gmt 0)

10+ Year Member



um, stupid question, but is PHP installed on the Microsoft Box?

monolift

3:32 pm on Oct 6, 2003 (gmt 0)

10+ Year Member



Yes, php is installed.

It looks like the php_mssql extension is not though. I ran the phpinfo function on the server and there are no mssql functions listed.

willybfriendly

3:43 pm on Oct 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not of immediate help for your problem, but when I have had hosts made unexpected changes in configuration, followed by less than stellar support, I have chosen to talk with my feet.

Find a new host that offers what you want and with support that you can tolerate.

WBF

monolift

3:48 pm on Oct 6, 2003 (gmt 0)

10+ Year Member



That's good advice. I have actually asked this client to move hosts more that once in the past, but they have been reluctant to enter into the unknown. This might do it though.

Thanks for all the help and responses on this one. I did, at least, learn something with this problem.