RE: [PHP] Capturing Windows Login Details
Indeed that works thank you very much :) -Original Message- From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Sent: 11 July 2003 15:50 To: Gary Ogilvie; [EMAIL PROTECTED] Subject: Re: [PHP] Capturing Windows Login Details > Well here is some more information so you can understand what I am > trying to do: > > I need to display their username in html/php document. This document has > a form which they fill out. It is to stop people changing who they are > when they fill out the form (for example joe bloggs filling out a > timesheet for Melinda messenger - hey it cud happen ;)). > > So, by grabbing the username of their NT logon or Firewall access I can > control this. Your web server needs to be IIS in order to get this. Is that the case? If so, disable anonymous browsing. That may be all you have to do. Now, access to the webroot, even though HTTP will require a valid user on your NT domain. You can adjust the security settings of the webroot folder to allow specific people or groups, also. Now, $_SERVER['LOGON_USER'] will be set with the username of the person. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Capturing Windows Login Details
Well here is some more information so you can understand what I am trying to do: I need to display their username in html/php document. This document has a form which they fill out. It is to stop people changing who they are when they fill out the form (for example joe bloggs filling out a timesheet for Melinda messenger - hey it cud happen ;)). So, by grabbing the username of their NT logon or Firewall access I can control this. Many thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Capturing Windows Login Details
I have found out that all I actually need is the username. That is all - either the windows login username or the firewall username. How do I grab either? Gary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Capturing Windows Login Details
Everything I try I get "undefined index" what does this mean? It is vital also that I can grab the user and the pass before somebody can access a certain part of the website, like the authentication dialogs that appear in Internet Explorer. Gazza -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Capturing Windows Login Details
OK - is there any other way of grabbing both the username and password from somewhere else? For example the login details used to login onto the Intranet through the firewall, or IIS? Thanks :) -Original Message- From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Sent: 11 July 2003 14:36 To: Gary Ogilvie; [EMAIL PROTECTED] Subject: Re: [PHP] Capturing Windows Login Details > I need to capture the username and password used to login to Windows > 2000/XP with PHP. Does anybody know how to do this? You can get the username, that's it. $_SESSION['LOGON_USER'] ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Capturing Windows Login Details
Hi All, I need to capture the username and password used to login to Windows 2000/XP with PHP. Does anybody know how to do this? Many thanks Gary Ogilvie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Refresh in PHP [solved]
Yeah I found that out eventually. Thanks :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Refresh in PHP
Hi Everyone, My user has reported a problem when he loads a page. The page grabs data from MSSQL and displays this on the screen. However, it is not updated. Is there any way in getting the page to automatically refresh itself ONCE when it is loaded, without ending up in a loop? Many thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Refresh in PHP
Hi Everyone, My user has reported a problem when he loads a page. The page grabs data from MSSQL and displays this on the screen. However, it is not updated. Is there any way in getting the page to automatically refresh itself once when it is loaded? Many thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Forms & PHP - Thanks
Thanks all, I shall try these methods now. I may be a while - the form is pretty large :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Forms & PHP
Ah I understand that - many thanks. -Original Message- From: Greg Wiley [mailto:[EMAIL PROTECTED] Sent: 02 July 2003 14:59 To: Gary Ogilvie; 'PHP General' Subject: Re: [PHP] Forms & PHP On Wed, 2 Jul 2003 14:45:27 +0100, Gary Ogilvie <[EMAIL PROTECTED]> wrote: > [snip] > By maintaining the POST (assuming you're using POST)variables and > calling them into the form values when reloaded. If you go to the second > page store the POST variables in hidden form input types, then grab them > when the second page is POSTED. Does this make sense? Not enough > caffeine for me yet...[/snip] > > So basically I need to have 2 versions of the first page, is that right? > :) > > No, in your first form you have code like ; } else { $foo = $_POST['foo']; } ?> ... and in the second form you have: ... Cheers, Greg. -- Greg Wiley www.wileysworld.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Forms & PHP[Scanned]
Wouldn't I then be saving the contents of that page twice in the database? -Original Message- From: Michael Egan [mailto:[EMAIL PROTECTED] Sent: 02 July 2003 14:53 To: PHP General Subject: RE: [PHP] Forms & PHP[Scanned] If I've understood your initial email correctly another approach would be to save the contents of the form to your database and populate the form fields presented subsequently with information retrieved from the database. You can use the header function to redirect to whatever page you wish once the information has been saved. Regards, Michael Egan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Forms & PHP
[snip] Not really, test for emptiness of the variable (isset())...if it is set display it, if not show it as blank. HTH! Jay [/snip] You'll have to forgive me as I am unfamiliar with PHP, still a beginner!! So if I have a page (page1.php) which is my first page with a form. When I click a normal link within this form it takes me to page2.php. This page has another smaller form. When the submit button in this form is clicked it updates the database with no problems and displays a link - linking back to page1.php (I have decided not to use redirect). How do load the page and fill all the text boxes with the information that was already written - because this information (from page1.php, first form) has not been saved to the database yet. You probably knew this anyway - but I had to go through that process to satisfy myself!! Many Thanks Gary Ogilvie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Forms & PHP
[snip] By maintaining the POST (assuming you're using POST)variables and calling them into the form values when reloaded. If you go to the second page store the POST variables in hidden form input types, then grab them when the second page is POSTED. Does this make sense? Not enough caffeine for me yet...[/snip] So basically I need to have 2 versions of the first page, is that right? :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Forms & PHP
Hello everyone, I have a form that gets filled out and within this form there is a link to add additional information in a new form. When this information is saved I would like the browser to redirect to the previous form (this I can do) but with all the details they have already filled out still in the text boxes. What is the easiest way to do this using PHP? Many thanks Gary Ogilvie
RE: [PHP] Using header in if statement
I didn't realise you could use echo to run a URL. Thanks for your help :) -Original Message- From: Adam Voigt [mailto:[EMAIL PROTECTED] Sent: 27 June 2003 14:08 To: Gary Ogilvie Cc: 'PHP General' Subject: Re: [PHP] Using header in if statement Just have it echo, example: echo "http://192.92.0.248/company_search/admin/admin2.php\";>"; On Fri, 2003-06-27 at 09:03, Gary Ogilvie wrote: > If I attempt to direct the user to a url with in a if statement using a > header I get the following error message: > > Warning: Cannot modify header information - headers already sent by > (output started at c:\inetpub\wwwroot\company_search\admin\login.php:3) > in c:\inetpub\wwwroot\company_search\admin\login.php on line 48 > > The code I am trying : > > if ($myUser == $myReturnedUser && $myPass == $myReturnedPass) { > ("Location: > http://192.92.0.248/company_search/admin/admin2.php";); > } else { > > Is there any other way I can try and do this? > > Many thanks -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using header in if statement
If I attempt to direct the user to a url with in a if statement using a header I get the following error message: Warning: Cannot modify header information - headers already sent by (output started at c:\inetpub\wwwroot\company_search\admin\login.php:3) in c:\inetpub\wwwroot\company_search\admin\login.php on line 48 The code I am trying : if ($myUser == $myReturnedUser && $myPass == $myReturnedPass) { ("Location: http://192.92.0.248/company_search/admin/admin2.php";); } else { Is there any other way I can try and do this? Many thanks
RE: [PHP] Just a small question on if statement - Solved
Thanks that is great!! -Original Message- From: Adam Voigt [mailto:[EMAIL PROTECTED] Sent: 27 June 2003 13:55 To: Gary Ogilvie Cc: 'PHP General' Subject: Re: [PHP] Just a small question on if statement if($myUser == $myReturnedUser && $myPass == $myReturnedPass) { } On Fri, 2003-06-27 at 08:51, Gary Ogilvie wrote: > Hi everyone, > > I want to make an if statement that works only if the 2 conditions are > correct > > It starts as: > > If ($myUser == $myReturnedUser) > > But I want to add another so that the if statement runs only if $myUser > is equal to $myReturnedUser AND $myPass is equal to $myReturnedPass. How > do I do this? > > Thanks a lot =) > > Gary -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Just a small question on if statement
Hi everyone, I want to make an if statement that works only if the 2 conditions are correct It starts as: If ($myUser == $myReturnedUser) But I want to add another so that the if statement runs only if $myUser is equal to $myReturnedUser AND $myPass is equal to $myReturnedPass. How do I do this? Thanks a lot =) Gary
RE: [PHP] mssql_num_rows problem (Solved)
Thanks a lot Jay It seems that when a "password" type of form is used then you must send the password variable to the database instead of the user...Strange but it works !! -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: 27 June 2003 13:45 To: Gary Ogilvie; PHP General Subject: RE: [PHP] mssql_num_rows problem [snip] $numRows = mssql_num_rows($result); print ("$numRows"); [/snip] A. print($query); //to make sure it is correct, double check 2. print($numRows); // no quotes, again to test HTH -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mssql_num_rows problem
Hello everyone, I am trying to grab some data from a table in a database. Here is the code I am using: $myServer = "192.92.0.248"; $myUsername = "Admin"; $myPassword = "bluefish"; $myDB = "COMPANY"; $myUser = $_GET['user']; $myPass = $_GET['pass']; #print ("$myUser$myPass"); $s = mssql_connect($myServer, $myUsername, $myPassword) or die; $d = mssql_select_db($myDB, $s) or die; $query = "SELECT * FROM users WHERE user = '$myUser'"; print ("$query"); $result = mssql_query($query) or die; $numRows = mssql_num_rows($result); print ("$numRows"); When printing out the query the correct statement is being sent to MSSQL. The variable $myUser does in face match what is in the database. However when I print the variable $numRows I am getting a "0". So no rows are being sent back - how can this be so when what is being sent to the database does in fact match a record in the table. I am mostly puzzled - PHP is set up correctly as I have been using this sort of thing with other projects. All help is very deeply appreciated. Gary
RE: [PHP] mssql_connect error
Seems ok here. -Original Message- From: Michael A Smith [mailto:[EMAIL PROTECTED] Sent: 25 June 2003 19:45 To: Gary Ogilvie Subject: RE: [PHP] mssql_connect error You need a load_extension ( i think ) directive in the php.ini file pointing to the right dll. -Michael On Wed, 2003-06-25 at 10:36, Gary Ogilvie wrote: > The extensions directory is set to the correct path in the ini file > though. I can't see where my error is... > > -Original Message- > From: Michael A Smith [mailto:[EMAIL PROTECTED] > Sent: 25 June 2003 18:56 > To: Gary Ogilvie > Subject: RE: [PHP] mssql_connect error > > It's in the php.ini file. You have to load an extension. (Which is the > mssql dll file.) You'll need to figure this out for yourself, as I said > before, I've never used PHP on windoze before. > On Wed, 2003-06-25 at 09:57, Gary Ogilvie wrote: > > What do you mean? How do I do this? > > > > -Original Message- > > From: Michael A Smith [mailto:[EMAIL PROTECTED] > > Sent: 25 June 2003 18:53 > > To: Gary Ogilvie > > Subject: Re: [PHP] mssql_connect error > > > > You didn't compile with --enable-mssql. > > > > -Michael > > On Wed, 2003-06-25 at 09:48, Gary Ogilvie wrote: > > > Hi all, > > > > > > I am testing a connection to MSSQL but I get the following error: > > > > > > Fatal error: Call to undefined function: mssql_connect() in > > > c:\inetpub\scripts\newsletter.php on line 28 > > > > > > I don't understand what this error is - my code is as follows: > > > > > > $myServer = "localhost"; > > > $myUser = "admin"; > > > $myPass = "cradle"; > > > $myDB = "MGN"; > > > > > > $s = mssql_connect($myServer, $myUser, $myPass) > > > or die("Unable to connect to MSSQL on $myServer"); > > > > > > $d = mssql_select_db($s, $myDB) > > > or die("Unable to select database: $MGN"); > > > > > > I can't see anything wrong with my code so I assume something is not > > set > > > up correctly? The extensions_dir in php.ini (winnt folder) is > pointing > > > to the correct place. > > > > > > Thanks in advance. > > > > > > Gary > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mssql_connect error
The extensions directory is set to the correct path in the ini file though. I can't see where my error is... -Original Message- From: Michael A Smith [mailto:[EMAIL PROTECTED] Sent: 25 June 2003 18:56 To: Gary Ogilvie Subject: RE: [PHP] mssql_connect error It's in the php.ini file. You have to load an extension. (Which is the mssql dll file.) You'll need to figure this out for yourself, as I said before, I've never used PHP on windoze before. On Wed, 2003-06-25 at 09:57, Gary Ogilvie wrote: > What do you mean? How do I do this? > > -Original Message- > From: Michael A Smith [mailto:[EMAIL PROTECTED] > Sent: 25 June 2003 18:53 > To: Gary Ogilvie > Subject: Re: [PHP] mssql_connect error > > You didn't compile with --enable-mssql. > > -Michael > On Wed, 2003-06-25 at 09:48, Gary Ogilvie wrote: > > Hi all, > > > > I am testing a connection to MSSQL but I get the following error: > > > > Fatal error: Call to undefined function: mssql_connect() in > > c:\inetpub\scripts\newsletter.php on line 28 > > > > I don't understand what this error is - my code is as follows: > > > > $myServer = "localhost"; > > $myUser = "admin"; > > $myPass = "cradle"; > > $myDB = "MGN"; > > > > $s = mssql_connect($myServer, $myUser, $myPass) > > or die("Unable to connect to MSSQL on $myServer"); > > > > $d = mssql_select_db($s, $myDB) > > or die("Unable to select database: $MGN"); > > > > I can't see anything wrong with my code so I assume something is not > set > > up correctly? The extensions_dir in php.ini (winnt folder) is pointing > > to the correct place. > > > > Thanks in advance. > > > > Gary > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mssql_connect error
What do you mean? How do I do this? -Original Message- From: Michael A Smith [mailto:[EMAIL PROTECTED] Sent: 25 June 2003 18:53 To: Gary Ogilvie Subject: Re: [PHP] mssql_connect error You didn't compile with --enable-mssql. -Michael On Wed, 2003-06-25 at 09:48, Gary Ogilvie wrote: > Hi all, > > I am testing a connection to MSSQL but I get the following error: > > Fatal error: Call to undefined function: mssql_connect() in > c:\inetpub\scripts\newsletter.php on line 28 > > I don't understand what this error is - my code is as follows: > > $myServer = "localhost"; > $myUser = "admin"; > $myPass = "cradle"; > $myDB = "MGN"; > > $s = mssql_connect($myServer, $myUser, $myPass) > or die("Unable to connect to MSSQL on $myServer"); > > $d = mssql_select_db($s, $myDB) > or die("Unable to select database: $MGN"); > > I can't see anything wrong with my code so I assume something is not set > up correctly? The extensions_dir in php.ini (winnt folder) is pointing > to the correct place. > > Thanks in advance. > > Gary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mssql_connect error
Hi all, I am testing a connection to MSSQL but I get the following error: Fatal error: Call to undefined function: mssql_connect() in c:\inetpub\scripts\newsletter.php on line 28 I don't understand what this error is - my code is as follows: $myServer = "localhost"; $myUser = "admin"; $myPass = "cradle"; $myDB = "MGN"; $s = mssql_connect($myServer, $myUser, $myPass) or die("Unable to connect to MSSQL on $myServer"); $d = mssql_select_db($s, $myDB) or die("Unable to select database: $MGN"); I can't see anything wrong with my code so I assume something is not set up correctly? The extensions_dir in php.ini (winnt folder) is pointing to the correct place. Thanks in advance. Gary
RE: [PHP] default time (Solved)
Thanks a lot - I never realised you had to use the date() function to get the time! -Original Message- From: Adam Voigt [mailto:[EMAIL PROTECTED] Sent: 25 June 2003 15:44 To: Gary Ogilvie Cc: [EMAIL PROTECTED] Subject: Re: [PHP] default time Read the manual page for the date tag: http://us2.php.net/date On Wed, 2003-06-25 at 10:28, Gary Ogilvie wrote: > Hi everyone, I want to assign the current time to a variable. Currently > I am using: > > $myTime = time() > > But this displays the time as: > > 1056551047 when it is in fact 15:25 > > How do I get the proper format for time? I looked on the web site but > couldn't understand any of it :( > > Thanks in advance -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] default time
Hi everyone, I want to assign the current time to a variable. Currently I am using: $myTime = time() But this displays the time as: 1056551047 when it is in fact 15:25 How do I get the proper format for time? I looked on the web site but couldn't understand any of it :( Thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] - Default Date
Hi everyone, I am about to start work on a PHP script and I need to know how to today's date. Is there a default variable built into PHP that has today's date? Many thanks Gary Ogilvie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Empty Page problems
I don't know what the problem is. I have used this script before with MSSQL with no problems - only this morning in fact. I am VERY new to PHP so I am still trying to get the hang on it. -Original Message- From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Sent: 19 June 2003 15:07 To: Gary Ogilvie; [EMAIL PROTECTED] Subject: Re: [PHP] Empty Page problems > Can anyone tell me what is wrong with my PHP script? I am trying to add > information to an MSSQL database from a separate HTM file. The script it > as follows: How about you tell us what the problem is? What is the result of this script? What are you expecting the result to be? Take away the @ symbols so you'll see errors if there are any. Add some debugging to track the progress through the script ---John Holmes... > > $myEmployeeName=$_GET['name']; > $myEmployeeDept=$_GET['department']; > $myEmployeeNotes=$_GET['notes']; > $myEmployeeCTP=$_GET['ctp_op']; > > $myServer = "192.92.0.248"; > $myUser = "repro"; > $myPass = "repro"; > $myDB = "repro"; > > error_reporting(E_ALL); > > print ("Attempting To Connect To MSSQL - > "); > > $s = @mssql_connect($myServer, $myUser, $myPass) > or die("Couldn't Connect To SQL Server On $myServer"); > > print ("Stage 2"); > > $d = @mssql_select_db($myDB, $s) > or die("Couldn't Open Database $myDB"); > > #this is the create bit > print ("Connected - Attempting To Create Employee..."); > > if ($mYEmployeeCTP == "on") { > $query = "INSERT INTO users (name, department, notes, ctp_op) > VALUES ('$myEmployeeName', '$myEmployeeDept', '$myEmployeeNotes', 'Y')"; > > $result = mssql_query($query) > or die("Creating Employee Failed"); > > } else { > > $query = "INSERT INTO users (name, department, notes, ctp_op) > VALUES ('$myEmployeeName', '$myEmployeeDept', '$myEmployeeNotes', 'N')"; > > $result = mssql_query($query) > or die("Creating Employee Failed"); > > } > > print ("Employee Added To Database"); > > print ("Go back to index"); > > ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Empty Page problems
Hello everyone, Can anyone tell me what is wrong with my PHP script? I am trying to add information to an MSSQL database from a separate HTM file. The script it as follows: Attempting To Connect To MSSQL - "); $s = @mssql_connect($myServer, $myUser, $myPass) or die("Couldn't Connect To SQL Server On $myServer"); print ("Stage 2"); $d = @mssql_select_db($myDB, $s) or die("Couldn't Open Database $myDB"); #this is the create bit print ("Connected - Attempting To Create Employee..."); if ($mYEmployeeCTP == "on") { $query = "INSERT INTO users (name, department, notes, ctp_op) VALUES ('$myEmployeeName', '$myEmployeeDept', '$myEmployeeNotes', 'Y')"; $result = mssql_query($query) or die("Creating Employee Failed"); } else { $query = "INSERT INTO users (name, department, notes, ctp_op) VALUES ('$myEmployeeName', '$myEmployeeDept', '$myEmployeeNotes', 'N')"; $result = mssql_query($query) or die("Creating Employee Failed"); } print ("Employee Added To Database"); print ("Go back to index"); ?> Thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Trapping PHP Errors
Hi everyone, How do I trap a PHP error and display my own error message instead? I have two PHP scripts - one that creates tables on MSSQL and one that deletes tables on MSSQL. I wish to capture the message that appears if the user attempts to create tables that already exist, or delete ones that do not exist. Thanks in advance Gary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] My Problem
After changing the dir to "f:\php\exstensions" all was ok =) -Original Message----- From: Gary Ogilvie [mailto:[EMAIL PROTECTED] Sent: 18 June 2003 16:40 To: 'Terje Torkelsen'; [EMAIL PROTECTED] Subject: [PHP] My Problem Don't worry all - its all been fixed now - thanks for the help :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] My Problem
Don't worry all - its all been fixed now - thanks for the help :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Connecting to MSSQL Using PHP on Apache2.X.XWindowsMachine
It appears don't have a extension_path line in my ini file -Original Message- From: Adam Voigt [mailto:[EMAIL PROTECTED] Sent: 18 June 2003 16:35 To: Gary Ogilvie Cc: 'Jay Blanchard'; [EMAIL PROTECTED] Subject: RE: [PHP] Connecting to MSSQL Using PHP on Apache2.X.XWindowsMachine Copy all the dll's in the dll folder, which is inside the PHP folder, to c:\winnt\system32, as well as the php_mssql.dll out of the extensions folder, to the same path. Then change the line in the php.ini that says "extension_path" to: c:\winnt\system32. On Wed, 2003-06-18 at 11:23, Gary Ogilvie wrote: > Now I get an error message when going to load the page: > > Unknown(): Unable to load dynamic library './php_mssql.dll' - The > specified module could not be found. > > -Original Message- > From: Adam Voigt [mailto:[EMAIL PROTECTED] > Sent: 18 June 2003 16:29 > To: Gary Ogilvie > Cc: 'Jay Blanchard'; [EMAIL PROTECTED] > Subject: RE: [PHP] Connecting to MSSQL Using PHP on Apache > 2.X.XWindowsMachine > > Take the semicolon off the start of the line > to uncomment it. > > > On Wed, 2003-06-18 at 11:18, Gary Ogilvie wrote: > > How do I comment out a line in an ini file... > > > > -Original Message- > > From: Jay Blanchard [mailto:[EMAIL PROTECTED] > > Sent: 18 June 2003 16:14 > > To: Gary Ogilvie; [EMAIL PROTECTED] > > Cc: [EMAIL PROTECTED] > > Subject: RE: [PHP] Connecting to MSSQL Using PHP on Apache 2.X.X > > WindowsMachine > > > > [snip] > > I have tried it on a different machine and it is working... so maybe > its > > something to do with the setup of my computer? > > [/snip] > > > > Check your php.ini as Adam suggested...I strongly suspect that the > > > > ;extension=php_mssql.dll > > > > line is still commented out. > > > > Jay -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Connecting to MSSQL Using PHP on Apache 2.X.XWindowsMachine
Now I get an error message when going to load the page: Unknown(): Unable to load dynamic library './php_mssql.dll' - The specified module could not be found. -Original Message- From: Adam Voigt [mailto:[EMAIL PROTECTED] Sent: 18 June 2003 16:29 To: Gary Ogilvie Cc: 'Jay Blanchard'; [EMAIL PROTECTED] Subject: RE: [PHP] Connecting to MSSQL Using PHP on Apache 2.X.XWindowsMachine Take the semicolon off the start of the line to uncomment it. On Wed, 2003-06-18 at 11:18, Gary Ogilvie wrote: > How do I comment out a line in an ini file... > > -Original Message- > From: Jay Blanchard [mailto:[EMAIL PROTECTED] > Sent: 18 June 2003 16:14 > To: Gary Ogilvie; [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: RE: [PHP] Connecting to MSSQL Using PHP on Apache 2.X.X > WindowsMachine > > [snip] > I have tried it on a different machine and it is working... so maybe its > something to do with the setup of my computer? > [/snip] > > Check your php.ini as Adam suggested...I strongly suspect that the > > ;extension=php_mssql.dll > > line is still commented out. > > Jay -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Connecting to MSSQL Using PHP on Apache 2.X.X WindowsMachine
How do I comment out a line in an ini file... -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: 18 June 2003 16:14 To: Gary Ogilvie; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: [PHP] Connecting to MSSQL Using PHP on Apache 2.X.X WindowsMachine [snip] I have tried it on a different machine and it is working... so maybe its something to do with the setup of my computer? [/snip] Check your php.ini as Adam suggested...I strongly suspect that the ;extension=php_mssql.dll line is still commented out. Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Connecting to MSSQL Using PHP on Apache 2.X.X WindowsMachine
-Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: 18 June 2003 16:14 To: Gary Ogilvie; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: [PHP] Connecting to MSSQL Using PHP on Apache 2.X.X WindowsMachine [snip] I have tried it on a different machine and it is working... so maybe its something to do with the setup of my computer? [/snip] Check your php.ini as Adam suggested...I strongly suspect that the ;extension=php_mssql.dll line is still commented out. Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Connecting to MSSQL Using PHP on Apache 2.X.X WindowsMachine
I have tried it on a different machine and it is working... so maybe its something to do with the setup of my computer? -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: 18 June 2003 15:59 To: [EMAIL PROTECTED] Cc: Gary Ogilvie; [EMAIL PROTECTED] Subject: RE: [PHP] Connecting to MSSQL Using PHP on Apache 2.X.X WindowsMachine [snip] Actually the @ just supress's error messages. And even then, the "or die" part would still get executed if the function error'd out. [/snip] Well, if that is the case then his script is 'hanging up' during the mssql_connect phase. Add this line to the top of the script error_reporting(E_ALL); Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Connecting to MSSQL Using PHP on Apache 2.X.X Windows Machine
If I take out the "@" sign I get the following error: Fatal error: Call to undefined function: mssql_connect() in F:\Program Files\Apache Group\Apache2\htdocs\REPRO\reprotables.php on line 10 Any more ideas? =) -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: 18 June 2003 15:51 To: Gary Ogilvie; [EMAIL PROTECTED] Subject: RE: [PHP] Connecting to MSSQL Using PHP on Apache 2.X.X Windows Machine [snip] "); $s = @mssql_connect($myServer, $myUser, $myPass) or die("Couldn't connect to SQL Server on $myServer"); print ("stage2"); $d = @mssql_select_db($myDB, $s) or die("Couldn't open database $myDB"); #this is the create bit print ("Connected trying to send the query!"); $query = "CREATE TABLE customer (id bigint NULL, cus_name char(100) NULL, address1 char(100) NULL, address2 char(100) NULL, town char(50) NULL, county char(50) NULL, postcode char(30) NULL, tel char(30) NULL, fax char(30) NULL, mobile char(30) NULL, email char(50) NULL, notes char(250) NULL)" or die("Creating table failed"); $result = mssql_query($query); print ("Tables Created"); ?> [/snip] See anything wrong here... $s = @mssql_connect($myServer, $myUser, $myPass) $d = @mssql_select_db($myDB, $s) ??? Remove the '@' signs and you should go just fine if your user has permissions to create tables; HTH! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Connecting to MSSQL Using PHP on Apache 2.X.X Windows Machine
Hi everyone, I am trying to connect to MSSQL and create a table in a database using PHP. Here is my code: "); $s = @mssql_connect($myServer, $myUser, $myPass) or die("Couldn't connect to SQL Server on $myServer"); print ("stage2"); $d = @mssql_select_db($myDB, $s) or die("Couldn't open database $myDB"); #this is the create bit print ("Connected trying to send the query!"); $query = "CREATE TABLE customer (id bigint NULL, cus_name char(100) NULL, address1 char(100) NULL, address2 char(100) NULL, town char(50) NULL, county char(50) NULL, postcode char(30) NULL, tel char(30) NULL, fax char(30) NULL, mobile char(30) NULL, email char(50) NULL, notes char(250) NULL)" or die("Creating table failed"); $result = mssql_query($query); print ("Tables Created"); ?> When viewing the page I only get the first print line displayed in the browser. When I check MSSQL no table has been added. Does anyone know how I can fix this? I am running Apache 2.X.X on Windows 2000 Server (on my local machine) using PHP 4.X.X. Any help is appreciated Gary Ogilvie