php-windows Digest 1 Oct 2002 20:14:12 -0000 Issue 1366
Topics (messages 16090 through 16106): Printer Write 16090 by: Luis Moreira Re: Connecting to MS SQLserver problem?? 16091 by: Lukas Boldrino 16093 by: Gard Rødahl Re: [PHP-DB] convert 2 dates to number of hours] 16092 by: José Moreira using exec on WIMP 16094 by: MWCT - Markus Weber i have a problem in php.ini setting about smtp 16095 by: konchim 16098 by: Matt Kynaston 16099 by: konchim 16100 by: Matt Kynaston 16102 by: konchim Login on IIS 16096 by: Radovan Radic 16101 by: Asendorf, John count hours from 2 dates 16097 by: José Moreira How to set folder access in Apache 16103 by: konchim srand and array_rand do not function properly on Win32 16104 by: sKreeM Access Violations, CGI errors 16105 by: Nicholas Fitzgerald Re: dynamic combo boxes 16106 by: Tim Blackwell Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] ----------------------------------------------------------------------
--- Begin Message ------ End Message ---
Have posted this once, got no answer.Anyone knows why a script like
$handle = printer_open();
printer_start_doc($handle);
printer_start_page($handle);
printer_write ($handle, "line 1");
printer_write ($handle, "line 2");
printer_end_page($handle);
printer_end_doc($handle);
printer_close($handle);
produces two separate pages, one with "line 1" and the other with "line 2", instead of a single page with both lines ?
Thanks
Luis Moreira
--- Begin Message ---try ODBC or set a timeout spezifikation in your scripts "Gard RøDahl" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I'm trying to connect to a mssqlserver from PHP, i have got the > php_mssql.dll and this one has > also been untagged in the php.ini file. > But for some reason does ALL the php scripts timeout when the php_mssql.dll > is being setup in > the .ini file. I'm running the php.exe from c:/PHP through ISAPI in IIS5, > and i've put the php_mssql.dll file in the same dir. > The ntwdblib.dll is also present in the system32 folder. > > Any ideas? Have I missed something here? > > Gard > > >--- End Message ---
--- Begin Message ---Well, I got to the point now where it loads the DLL. But in the script page when i try to connect to a MS SQL server I get the error message: Fatal error: Call to undefined function: mssql_connect() Know any reasons why the function call fails? Thanks, Gard "Lukas Boldrino" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > try ODBC or set a timeout spezifikation in your scripts > "Gard RøDahl" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > I'm trying to connect to a mssqlserver from PHP, i have got the > > php_mssql.dll and this one has > > also been untagged in the php.ini file. > > But for some reason does ALL the php scripts timeout when the > php_mssql.dll > > is being setup in > > the .ini file. I'm running the php.exe from c:/PHP through ISAPI in IIS5, > > and i've put the php_mssql.dll file in the same dir. > > The ntwdblib.dll is also present in the system32 folder. > > > > Any ideas? Have I missed something here? > > > > Gard > > > > > > > > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.393 / Virus Database: 223 - Release Date: 30.09.2002--- End Message ---
--- Begin Message ----------- Original Message -------- Subject: Re: [PHP-DB] convert 2 dates to number of hours Date: Mon, 30 Sep 2002 16:43:14 +0100 From: José Moreira <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] To: Chris Boget <[EMAIL PROTECTED]> CC: PHP-DB <[EMAIL PROTECTED]> References: <[EMAIL PROTECTED]> <152e01c26894$00370710$8c01a8c0@ENTROPY> thank you for your help, i figured this out : SELECT id, to_days(t1.closedate) - to_days(t1.date) FROM tracking AS t1 ... yes i am .. whe are using the IRM for internal help desk and im creating event reports ... it only makes sense to include in the calculations the work hours so thats what im trying to do, to make the reports more viable .... Chris Boget wrote: >>Hello, how can i calculate the number of hours between 2 dates, >> >> > >( $unixDateTimeTo - $unixDateTimeFrom ) * 60 * 60 > > > >>and better yet , the work hours ( example from 8.30am to 6pm excluding >>weekends) >> >> > >This would be more involved. Are you trying to find out how many work >hours there were between 2 dates? > >Chris > > > > >--- End Message ---
--- Begin Message ---Hi, may be someone can help me: I want to use the exec() function to run an executable as background process. This means my php script should not wait for the end of the background process. I tried a lot but without success. My script always wait for the end of the background process. My php script contains this line: exec(getenv("COMSPEC").' /c c:\mysql\bin\mysql.exe < E:/Inetpub/wwwroot/update/load_logs.sql > E:/Inetpub/wwwroot/update/load_logs.log'); Regarding to the online documentation on php.net all screen output is redirected to the file "load_logs.log". When I type in this string via command line the execution is successful. As I learned from the online documentation on php.net is that on LINUX systems something like "2>1&" or ">/dev/null" will help - but not on Windows. Any ideas ? regards, Markus Weber--- End Message ---
--- Begin Message ---i have a problem in php.ini setting about smtp [mail function] SMTP = mail.netvigator.com ;for win32 only sendmail_from = [EMAIL PROTECTED] ;for win32 only ;sendmail_path = it have error"Warning: Server Error in c:\....." My SMTP need a username and password,how can i set it in php.ini Thank you very very much Konchim--- End Message ---
--- Begin Message ---> My SMTP need a username and password,how can i set it in php.ini You can't. I use: http://phpmailer.sourceforge.net/ Matt--- End Message ---
--- Begin Message ---How to use? I don't know how to setup "Matt Kynaston" <[EMAIL PROTECTED]> ¼¶¼g©ó¶l¥ó·s»D :[EMAIL PROTECTED] > > My SMTP need a username and password,how can i set it in php.ini > > You can't. I use: > http://phpmailer.sourceforge.net/ > > Matt >--- End Message ---
--- Begin Message ---> How to use? > I don't know how to setup Take a look at the installation bit and example on the main page of the site. I ignored the AddAttachment() and IsHTML() bit and cut and paste the rest, then changed the Host, Username and Password to fit my server. It worked straight out the box :) Matt--- End Message ---
--- Begin Message ---I can Use it Now! Thank You "Matt Kynaston" <[EMAIL PROTECTED]> ???????:[EMAIL PROTECTED] > > How to use? > > I don't know how to setup > > Take a look at the installation bit and example on the main page of the > site. I ignored the AddAttachment() and IsHTML() bit and cut and paste the > rest, then changed the Host, Username and Password to fit my server. It > worked straight out the box :) > > Matt >--- End Message ---
--- Begin Message ---Hello! I need to use login form when user opens my page so this is for session. Then i need to get userno from usertable for input user and pass, because userno is almost in all tables. Then i need to put userno in cookie (or i guess). I think i need to do something like this in every php script: include('login.php') or require('login.php') But i only want to show login form, read data from it and somehow continue loading script normally, i dont want that login form stays above all my page. How to do this? Thanks, Radovan--- End Message ---
--- Begin Message ---You'll need to use sessions. Then, on each page (you can do this in an include I think)... you will have session_start beginning each page. From there you can do a check to see if the user has already logged in... if they are logged in, it will spit out the page... if not, it will ask them to log in. When they do log in, you then register those session variables needed to flag that the user is logged in. You could also do this with cookies... but then you'd probably end up storing user data on the user's machine which could be a bigger security hassle. Not too hard... just need to plan in advance. --------------------- John Asendorf - [EMAIL PROTECTED] Web Applications Developer http://www.lcounty.com - NEW FEATURES ADDED DAILY! Licking County, Ohio, USA 740-349-3631 Nullum magnum ingenium sine mixtura dementiae fuit > -----Original Message----- > From: Radovan Radic [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, October 01, 2002 9:49 AM > To: [EMAIL PROTECTED] > Subject: [PHP-WIN] Login on IIS > > > Hello! > > I need to use login form when user opens my page so this is > for session. > Then i need to get userno from usertable for input user and > pass, because > userno is almost in all tables. Then i need to put userno in > cookie (or i > guess). > I think i need to do something like this in every php script: > include('login.php') or require('login.php') > But i only want to show login form, read data from it and > somehow continue > loading script normally, i dont want that login form stays > above all my > page. How to do this? > > Thanks, Radovan > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >--- End Message ---
--- Begin Message ---hello, um using this SQL string : SELECT computer, date, closedate,UNIX_TIMESTAMP(closedate), UNIX_TIMESTAMP(date), (UNIX_TIMESTAMP(closedate) - UNIX_TIMESTAMP(date)) / POW(60,2) FROM tracking (18 Records) computer date closedate UNIX_TIMESTAMP(closedate) UNIX_TIMESTAMP(date) (UNIX_TIMESTAMP(closedate) - UNIX_TIMESTAMP(date)) / POW(60,2) 45 2002-06-19 14:12:22 2002-06-19 16:21:10 1024500070 1024492342 2.14666667 13 2002-01-28 10:04:56 2002-02-19 15:00:30 1014130830 1012212296 532.92611111 96 2002-06-19 15:46:00 2002-08-21 15:18:21 1029939501 1024497960 1511.53916667 45 2002-06-25 15:42:45 2002-06-26 11:11:27 1025086287 1025016165 19.47833333 239 2002-06-26 15:07:25 2002-06-27 17:21:38 1025194898 1025100445 26.23694444 188 2002-06-27 10:52:35 2002-06-27 17:55:48 1025196948 1025171555 7.05361111 173 2002-07-02 15:06:27 2002-07-02 15:29:01 1025620141 1025618787 0.37611111 43 2002-07-03 17:50:22 2002-08-21 15:17:28 1029939448 1025715022 1173.45166667 45 2002-07-09 10:54:56 2002-07-09 12:32:07 1026214327 1026208496 1.61972222 37 2002-07-09 10:57:50 2002-08-01 16:53:30 1028217210 1026208670 557.92777778 12 2002-07-17 10:24:37 2002-07-18 16:28:19 1027006099 1026897877 30.06166667 9999 2002-08-21 15:28:11 2002-08-22 14:46:48 1030024008 1029940091 23.31027778 25 2002-08-30 11:01:53 2002-09-04 10:55:27 1031133327 1030701713 119.89277778 151 2002-09-04 10:01:25 2002-09-04 10:38:42 1031132322 1031130085 0.62138889 43 2002-09-06 19:00:47 2002-09-09 15:25:30 1031581530 1031335247 68.41194444 182 2002-09-19 15:57:44 2002-09-23 10:22:53 1032772973 1032447464 90.41916667 193 2002-09-20 10:53:00 2002-09-27 17:48:46 1033145326 1032515580 174.92944444 6 2002-09-23 10:24:27 2002-09-23 11:10:35 1032775835 1032773067 0.76888889 im converting seconds to hours with POW ... 1 hour = 60* 60 seconds i maked and example in RED ... why do i get that mouch hours diference in cases where the dates are days apart ????--- End Message ---
--- Begin Message ---How to set folder access in Apache(win32) Thank You--- End Message ---
--- Begin Message ---my code: srand ((float) microtime() * 10000000); return array_rand($lines,100); The returned array is ALWAYS in the same order. I'm running PHP 4.2.3 and Apache/2.0.39 Does anyone have a solution or a workaround for this problem? The script works fine on a UNIX server.--- End Message ---
--- Begin Message ---Hello. I'm fairly new to PHP. I'm not a developer, I just want to be able to use the functionality of PHP on my server. I've tried several times in the past to implement PHP on my NT server to no avail. The problem is when using the CGI, (php.exe), it just throws a ton of error messages on the screen and not any of my output. I've tried going through and working out each error, but there are literally hundreds of them. Most are just repetitive, but there are still some that just don't seem to have any rhyme or reason to them. How do I get rid of these? This has to be a known problem, I can't be the only guy on the planet using PHP with windows. The server is NT4.0 IIS4 SP6a. I realize that somewhere out there is a document that has the information I need to fix this. God knows I've tried to find it, but so far no luck. In order to solve this problem temporarily I'm started using php4isapi. This worked really great for about a month. Now I have two sites where all I get is access violations. I haven't changed anything. You can see this in action here: http://icesource.com/forum/index.php. I'd prefer to use the CGI version if I can get it working. Any help, or at least a point in the right direction, would be greatly appreciated. Nick--- End Message ---
--- Begin Message ---okay, i figured out the combo thing--code is below. it actually wasn't too difficult with some help! but, when i use tutname i get an undefined variable it works fine with the static combo that i was using? can you think of any reason for this? function load_combobox() { ?> <? @ $db = mysql_pconnect("localhost", "", ""); if (!$db) { echo "Error: Could not connect to database. Please try again later."; exit; } mysql_select_db("tutorial"); $options = "select distinct tutorialname from tutorial"; $optres = mysql_query($options); $opt_results = mysql_num_rows($optres); echo "<select name=tutname>"; for ($i=0; $i <$opt_results; $i++) { $optrow = mysql_fetch_array($optres); $optionval = stripslashes($optrow["tutorialname"]); echo "<option>$optionval</option>"; echo "<br>"; } echo "</select>"; ?> <? } tim "Tim Blackwell" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > hi--i'm having some trouble autoloading a combo box with a mysql column. > could someone help please > > thanks, > > tim > >--- End Message ---