473,800 Members | 2,406 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unable to disconnect?

13 New Member
I've dealt with issues with not being able to connect to the database through PHP and know how to correct most of them fairly easily, however, I've got a really odd situation here. I'm running PHP 5.2.5, Apache 2.2.8, and SQL Server 2000 under Windows XP (don't laugh, I was given this setup and told to use it). The problem I have is that I don't have to issue a mssql_connect statement in order to run a query on the database. This poses a problem if I'm not very careful about user input and that input gets subsequently displayed anywhere. For example, this actually pulls data from the database:
[PHP]<?php
$query = mssql_query("SE LECT * FROM INFORMATION_SCH EMA.TABLES");
while($row = mssql_fetch_arr ay($query)){ print_r($row); }
?>[/PHP]
I've checked everything I know to check. Here are the highlights.

from php.ini:
disable_functio ns = mssql_pconnect, mysql_pconnect
mssql.allow_per sistent = Off
mssql.secure_co nnection = Off

SQL Server authentificatio n is set to "SQL Server and Windows" and the startup service account is not the system account nor the user logged in at any point. (didn't know if that was an issue or not)

I've denied all access to the database files through NTFS permissions. I can't even browse to them when logged in at this point.

I've rebooted the server several times, and yet somehow I'm still able to query the database without ever connecting & authenticating.

I'm a bit lost at the moment. Does anybody have any ideas as to what else I might look at?

Thanks in advance.
Mar 26 '08 #1
1 1736
code green
1,726 Recognized Expert Top Contributor
The problem I have is that I don't have to issue a mssql_connect statement in order to run a query on the database
That is correct, but that does not mean you are not allowed to issue a connect statement
This is an extract from php manual
mssql_query() sends a query to the currently active database on the server that's associated with the specified link identifier. If the link identifier isn't specified, the last opened link is assumed. If no link is open, the function tries to establish a link as if mssql_connect() was called, and use it.
Simply specify the link identifier returned from mssql_connect() in mssql_query() [PHP]$link = mssql_connect() ;
mssql_query($qu ery,$link);[/PHP]
This poses a problem if I'm not very careful about user input and that input gets subsequently displayed anywhere
Cannot understand how this situation could arise but you could additionally check the resource link is set [PHP]if(isset$link))
mssql_query($qu ery,$link);[/PHP]
Mar 28 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
2896
by: Sven Jacobs | last post by:
Dear newsgroup, I've upgraded to PEAR::DB 1.6.5 recently. Unfortunately now the database connection doesn't work as expected anymore :( The problems seems to be the method disconnect(), which now closes the database connections of _all_ database objects. I ask myself if this is intentional or a bug. Below a code example: 01 <?php 02   error_reporting(E_ALL);
12
2738
by: InProcess | last post by:
Let me start by saying that, yes we know v6.5 is no longer supported by Microsoft and that moving to SQL2000 might resolve our problem. Actually the migration to SQL2000 is 1 to 2 months out and in the QA phase now. Unfortunately we need to resolve the current 6.5 issue now as it heavily impacts a major revenue stream for the company with every outage we encounter. The Problem: At least once every 24 hours the SQL Server begins...
0
2309
by: Sateesh | last post by:
Hello, I am mapping to a network share from a .Net service to transfer some specified directories and some times before I disconnect the drive, network would become unavailable. I am unable to disconnect this drive manually and am getting an error "Network connection not found" and I should restart the machine to disconnect it, but I am able to browse through the drive. I am using my domain account only as logon for the service. Does...
2
13540
by: http://www.visual-basic-data-mining.net/forum | last post by:
Say i have declare a module for connection and two buttons... one button has the method connect() and the other has the method disconnect().... how do i actually connect after i had disconnect my tcpC... I could not connect after i disconnect my connection... Imports System.Net.Sockets
0
2287
by: vicky | last post by:
Hello Experts, Trying to run sample Postgrel's ECPG(Embedded SQL)programs on RHL 9.0. Im unable to connect to PostgreSQL database (sirishadb) when I run the program .... # su postgres (enter)
1
6980
by: Maximus | last post by:
hi all, I want to kow if there is a way to connet a machine using a VPN client through vb.net or c# code. I have requirement where i need to copy file using VPN. Hence, I need to start the connection before copying files and then disconnect it. RASdail API is not an option as I am not using modem for internet connection. Can anyone through some light on it?
0
3816
by: mamod20 | last post by:
Please advise, I have the following example and want to know the best way to use $dbh->disconnect; and $sth->finish; -------------- $sql_host="localhost"; $sql_dataname = "database"; $sql_userid = "root"; $sql_password = "password"; &connect_sql;
3
45516
by: Laurence | last post by:
Hi there, Does anyone know what's difference among "connect reset", "disconnect", and "terminate"? Thanks in advance,
0
678
by: Andreas Tawn | last post by:
>I am trying to run p4python API on top of python 2.5.2 and am extracting a dictionary from perforce. The following code returns the output that follows it: 'monitor': 'enabled', 'P4D/NTX64/2007.3/143793 (2008/01/ Daylight Time', 'clientAd Software, Inc. 140 users ( 'rsgnwep4s1.rockstar.t2.corp:166 'enabled', 'password': 'enabled' the server, which I clearly am. I then followed by adding the following
9
8605
by: Kelii | last post by:
Currently I have a button that allows the user to "Close Company" - at the moment it doesn't do anything :D I would like the button to "disconnect" the back end then show my Open Company form. My question is: 1. Short of closing the application or deleting the linked tables, is there a way to disconnect the user's front end from the common back end using VBA? 2. Does disconnecting the user serve any purpose? I've read a lot of posts...
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10275
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10033
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7576
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5471
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.