php-windows Digest 12 Feb 2001 22:49:30 -0000 Issue 442 Topics (messages 5510 through 5533): Re: How to save a file to a blob field? 5510 by: Winston Valenzuela 5512 by: Tom Mathews Re: PHP 'include' function 5511 by: Tom Mathews 5519 by: Bikes 5521 by: Gonzalo Vera 5523 by: Tom Mathews Run a script for 20minutes 5513 by: Martin E. Koss 5514 by: Ben Cairns 5518 by: David Harrison Re: [PHP] Run a script for 20minutes 5515 by: Dominick Vansevenant 5516 by: Martin E. Koss 5517 by: Andy Woolley Re: IIS Manipulation 5520 by: Richard Do I need the API? 5522 by: Jeremy Sharp NT Stability 5524 by: Victor Johansen 5526 by: Phil Driscoll 5529 by: David Elliott 5530 by: Asendorf, John "xml + xsl to html" sample code 5525 by: Antonio Lopez 5528 by: Paul Meagher 5531 by: Phillip Fox PHP4 problem (bug?) with UNC pathnames 5527 by: Jan Matejka assigning variable names on the fly, backed myself in to a corner 5532 by: Asendorf, John 5533 by: Ignatius Teo 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] ----------------------------------------------------------------------
And this is the error that appears on the browser.. Warning: SQL error: [INTERSOLV][ODBC InterBase driver][InterBase]conversion error from string "BLOB", SQL state S1000 in SQLExecDirect in c:/homepages/message/post.php on line 7 > I'm using ODBC to connect to my Interbase 6 database. Using the code: > > $post_stmt = "Insert into > MSGTABLE(firstname,middlename,lastname,msg_subject,msgbody,remote_ip) > values('$fname','$mname','$lname','$subj','$mssg','$remote_ip')"; > > and the msgbody field is a blob type. and the data came from a textarea > field. But i got an error using this insert statement. > > How can i do it without an error? > >
Easier to diagnose if you tell us what the error was? Winston Valenzuela wrote: > I'm using ODBC to connect to my Interbase 6 database. Using the code: > > $post_stmt = "Insert into > MSGTABLE(firstname,middlename,lastname,msg_subject,msgbody,remote_ip) > values('$fname','$mname','$lname','$subj','$mssg','$remote_ip')"; > > and the msgbody field is a blob type. and the data came from a textarea > field. But i got an error using this insert statement. > > How can i do it without an error? > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED]
I'm going to sound like a database freak, but my solution to nearly all 'dynamic' pages is to pull everything out of a database - My implementation would probably be four fields - ID, Name (to display in the select list), text and image. You query the db to get a list of 'Name's and then use the ID to pull out the relevent image and text. By the way, it is possible to use javascript variables in php - I've got some script I can dig out to show you how if you need it. Tom John Morrison wrote: > Hi. > > I have just discovered server side scripting and am trying > to get to grips with it using PHP4 with Xitami on Windows > Me. Straight away, on my first project, it looks as though > I have found a problem I am not going to solve without > help. > > I have an HTML form with an Option Select drop down list > which displays choices of which JPEG file to load into an > <IMG> picturebox. After selecting an option, clicking a > button runs a Javascript function which displays the image, > changing the previous picture. So far so good, but here is > the problem. I also wish to display a caption and > descriptive paragraph or two in an adjacent scrollable > <TEXTAREA>. > > I thought a good way would be to have a text file for each > picture on the server and display the appropriate one as > required. But, so far, I have not managed to find any file > operation capabilities in Javascript. > > My next thought was to use the PHP "include" function, or > some other file reading technique, but I have not found a > satisfactory way to pass the filename to PHP. A Javascript > variable naturally cannot be passed to a PHP function so I > had Javascript copy the file pathname to the TextArea with > the hope of getting my include function to pick it up from > there. But I have not succeeded. PHP does not like the > dots in "$captionpath = > Document.FormName.TextAreaName.Value;" and simply removes > them. > > So I abandoned this and tried doing it completely outside > of Javascript. I have tried everything I can think of > including a rigmarole which involved the self-submit method > <FORM METHOD="POST" ACTION="<?php print('$php_self'); ?>">. > Without going into detail, I did manage to display the > caption but I had other problems which made this avenue > seem unproductive, so I did not persue it. For example, > instead of just a clean change of the IMG and TextArea > contents the whole page was reloaded from the server and > repositioned at "Top of Page". Apart from the slowness of > this, it looked massively clumsy. > > Am I missing the obvious?? > > Regards > John Morrison > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED]
Mathews, could you dig out that script please? I think I might need it. Bikes -----Original Message----- From: Tom Mathews Cc: [EMAIL PROTECTED] Sent: 2/12/01 11:02 AM Subject: Re: [PHP-WIN] PHP 'include' function I'm going to sound like a database freak, but my solution to nearly all 'dynamic' pages is to pull everything out of a database - My implementation would probably be four fields - ID, Name (to display in the select list), text and image. You query the db to get a list of 'Name's and then use the ID to pull out the relevent image and text. By the way, it is possible to use javascript variables in php - I've got some script I can dig out to show you how if you need it. Tom John Morrison wrote: > Hi. > > I have just discovered server side scripting and am trying > to get to grips with it using PHP4 with Xitami on Windows > Me. Straight away, on my first project, it looks as though > I have found a problem I am not going to solve without > help. > > I have an HTML form with an Option Select drop down list > which displays choices of which JPEG file to load into an > <IMG> picturebox. After selecting an option, clicking a > button runs a Javascript function which displays the image, > changing the previous picture. So far so good, but here is > the problem. I also wish to display a caption and > descriptive paragraph or two in an adjacent scrollable > <TEXTAREA>. > > I thought a good way would be to have a text file for each > picture on the server and display the appropriate one as > required. But, so far, I have not managed to find any file > operation capabilities in Javascript. > > My next thought was to use the PHP "include" function, or > some other file reading technique, but I have not found a > satisfactory way to pass the filename to PHP. A Javascript > variable naturally cannot be passed to a PHP function so I > had Javascript copy the file pathname to the TextArea with > the hope of getting my include function to pick it up from > there. But I have not succeeded. PHP does not like the > dots in "$captionpath = > Document.FormName.TextAreaName.Value;" and simply removes > them. > > So I abandoned this and tried doing it completely outside > of Javascript. I have tried everything I can think of > including a rigmarole which involved the self-submit method > <FORM METHOD="POST" ACTION="<?php print('$php_self'); ?>">. > Without going into detail, I did manage to display the > caption but I had other problems which made this avenue > seem unproductive, so I did not persue it. For example, > instead of just a clean change of the IMG and TextArea > contents the whole page was reloaded from the server and > repositioned at "Top of Page". Apart from the slowness of > this, it looked massively clumsy. > > Am I missing the obvious?? > > Regards > John Morrison > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] <<ATT00196.txt>>
Me too! Gonzalo. > Mathews, could you dig out that script please? I think I might need it. > Bikes > -----Original Message----- > From: Tom Mathews > Cc: [EMAIL PROTECTED] > Sent: 2/12/01 11:02 AM > Subject: Re: [PHP-WIN] PHP 'include' function > I'm going to sound like a database freak, but my solution to nearly all > 'dynamic' pages is to pull everything out of a database - > My implementation would probably be four fields - ID, Name (to display > in > the select list), text and image. You query the db to get a list of > 'Name's > and then use the ID to pull out the relevent image and text. > By the way, it is possible to use javascript variables in php - I've got > some script I can dig out to show you how if you need it. > Tom > John Morrison wrote: >> Hi. >> >> I have just discovered server side scripting and am trying >> to get to grips with it using PHP4 with Xitami on Windows >> Me. Straight away, on my first project, it looks as though >> I have found a problem I am not going to solve without >> help. >> >> I have an HTML form with an Option Select drop down list >> which displays choices of which JPEG file to load into an >> <IMG> picturebox. After selecting an option, clicking a >> button runs a Javascript function which displays the image, >> changing the previous picture. So far so good, but here is >> the problem. I also wish to display a caption and >> descriptive paragraph or two in an adjacent scrollable >> <TEXTAREA>. >> >> I thought a good way would be to have a text file for each >> picture on the server and display the appropriate one as >> required. But, so far, I have not managed to find any file >> operation capabilities in Javascript. >> >> My next thought was to use the PHP "include" function, or >> some other file reading technique, but I have not found a >> satisfactory way to pass the filename to PHP. A Javascript >> variable naturally cannot be passed to a PHP function so I >> had Javascript copy the file pathname to the TextArea with >> the hope of getting my include function to pick it up from >> there. But I have not succeeded. PHP does not like the >> dots in "$captionpath = >> Document.FormName.TextAreaName.Value;" and simply removes >> them. >> >> So I abandoned this and tried doing it completely outside >> of Javascript. I have tried everything I can think of >> including a rigmarole which involved the self-submit method >> <FORM METHOD="POST" ACTION="<?php print('$php_self'); ?>">. >> Without going into detail, I did manage to display the >> caption but I had other problems which made this avenue >> seem unproductive, so I did not persue it. For example, >> instead of just a clean change of the IMG and TextArea >> contents the whole page was reloaded from the server and >> repositioned at "Top of Page". Apart from the slowness of >> this, it looked massively clumsy. >> >> Am I missing the obvious?? >> >> Regards >> John Morrison >> >> -- >> PHP Windows Mailing List (http://www.php.net/) >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> To contact the list administrators, e-mail: > [EMAIL PROTECTED] > <<ATT00196.txt>>
Guys It was a while ago, and I recall two ways of doing it - the blunt and clumsy way which is not good for internet applications (OK for intranet where download time isn't an issue) (which I can remember) and the really cool sophisticated way (which I can't remember off hand, so I'll have to dig the code out which is going to take me some time - its on a backup of an old machine). The clumsy and easy way was to write a small script (php) which took a variable out of the query string, gave it a useful name and then returned to the main script at the point of exit (I told you it was clumsy - you have to set a load of markers in the main script so that you know where you are up to!). When a javascript variable needed to passed to php, just call the php script using the jscript variable as the querystring. Of course, if you have a whole load to pass at once, you can do it with a POST method which makes life a bit easier (the way that I initially did it before I worked out my neat trick which I can't find...) it is straightforward to call a POST from an update event in jscript (I triggered it from an update on a drop down list). I'll dig out the neat way of doing things when I get some time, but it ain't going to be for a couple of weeks I guess. Tom [EMAIL PROTECTED] wrote: > Mathews, could you dig out that script please? I think I might need > it. > > Bikes > > > > -----Original Message----- > From: Tom Mathews > Cc: [EMAIL PROTECTED] > Sent: 2/12/01 11:02 AM > Subject: Re: [PHP-WIN] PHP 'include' function > > I'm going to sound like a database freak, but my solution to nearly > all > 'dynamic' pages is to pull everything out of a database - > My implementation would probably be four fields - ID, Name (to display > in > the select list), text and image. You query the db to get a list of > 'Name's > and then use the ID to pull out the relevent image and text. > By the way, it is possible to use javascript variables in php - I've > got > some script I can dig out to show you how if you need it. > > Tom > John Morrison wrote: > > > Hi. > > > > I have just discovered server side scripting and am trying > > to get to grips with it using PHP4 with Xitami on Windows > > Me. Straight away, on my first project, it looks as though > > I have found a problem I am not going to solve without > > help. > > > > I have an HTML form with an Option Select drop down list > > which displays choices of which JPEG file to load into an > > <IMG> picturebox. After selecting an option, clicking a > > button runs a Javascript function which displays the image, > > changing the previous picture. So far so good, but here is > > the problem. I also wish to display a caption and > > descriptive paragraph or two in an adjacent scrollable > > <TEXTAREA>. > > > > I thought a good way would be to have a text file for each > > picture on the server and display the appropriate one as > > required. But, so far, I have not managed to find any file > > operation capabilities in Javascript. > > > > My next thought was to use the PHP "include" function, or > > some other file reading technique, but I have not found a > > satisfactory way to pass the filename to PHP. A Javascript > > variable naturally cannot be passed to a PHP function so I > > had Javascript copy the file pathname to the TextArea with > > the hope of getting my include function to pick it up from > > there. But I have not succeeded. PHP does not like the > > dots in "$captionpath = > > Document.FormName.TextAreaName.Value;" and simply removes > > them. > > > > So I abandoned this and tried doing it completely outside > > of Javascript. I have tried everything I can think of > > including a rigmarole which involved the self-submit method > > <FORM METHOD="POST" ACTION="<?php print('$php_self'); ?>">. > > Without going into detail, I did manage to display the > > caption but I had other problems which made this avenue > > seem unproductive, so I did not persue it. For example, > > instead of just a clean change of the IMG and TextArea > > contents the whole page was reloaded from the server and > > repositioned at "Top of Page". Apart from the slowness of > > this, it looked massively clumsy. > > > > Am I missing the obvious?? > > > > Regards > > John Morrison > > > > -- > > PHP Windows Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: > [EMAIL PROTECTED] > > <<ATT00196.txt>> > > ---------------------------------------------------------------- > > Mathews, could you dig out that script please? I think I might need > it. > > Bikes > > > > -----Original Message----- > From: Tom Mathews > Cc: [EMAIL PROTECTED] > Sent: 2/12/01 11:02 AM > Subject: Re: [PHP-WIN] PHP 'include' function > > I'm going to sound like a database freak, but my solution to nearly > all > 'dynamic' pages is to pull everything out of a database - > My implementation would probably be four fields - ID, Name (to display > > in > the select list), text and image. You query the db to get a list of > 'Name's > and then use the ID to pull out the relevent image and text. > By the way, it is possible to use javascript variables in php - I've > got > some script I can dig out to show you how if you need it. > > Tom > John Morrison wrote: > > > Hi. > > > > I have just discovered server side scripting and am trying > > to get to grips with it using PHP4 with Xitami on Windows > > Me. Straight away, on my first project, it looks as though > > I have found a problem I am not going to solve without > > help. > > > > I have an HTML form with an Option Select drop down list > > which displays choices of which JPEG file to load into an > > <IMG> picturebox. After selecting an option, clicking a > > button runs a Javascript function which displays the image, > > changing the previous picture. So far so good, but here is > > the problem. I also wish to display a caption and > > descriptive paragraph or two in an adjacent scrollable > > <TEXTAREA>. > > > > I thought a good way would be to have a text file for each > > picture on the server and display the appropriate one as > > required. But, so far, I have not managed to find any file > > operation capabilities in Javascript. > > > > My next thought was to use the PHP "include" function, or > > some other file reading technique, but I have not found a > > satisfactory way to pass the filename to PHP. A Javascript > > variable naturally cannot be passed to a PHP function so I > > had Javascript copy the file pathname to the TextArea with > > the hope of getting my include function to pick it up from > > there. But I have not succeeded. PHP does not like the > > dots in "$captionpath = > > Document.FormName.TextAreaName.Value;" and simply removes > > them. > > > > So I abandoned this and tried doing it completely outside > > of Javascript. I have tried everything I can think of > > including a rigmarole which involved the self-submit method > > <FORM METHOD="POST" ACTION="<?php print('$php_self'); ?>">. > > Without going into detail, I did manage to display the > > caption but I had other problems which made this avenue > > seem unproductive, so I did not persue it. For example, > > instead of just a clean change of the IMG and TextArea > > contents the whole page was reloaded from the server and > > repositioned at "Top of Page". Apart from the slowness of > > this, it looked massively clumsy. > > > > Am I missing the obvious?? > > > > Regards > > John Morrison > > > > -- > > PHP Windows Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: > [EMAIL PROTECTED] > > <<ATT00196.txt>>
Hi, I have PHP3 and MySQL on Win98 and am trying to run a script that loops through a file making process and it needs about 20 - 30 minutes to run. It generates static HTML files based on content in a database. I've increased Internet Explorer's timeout to allow for this but for some reason only about half the processing is done before everything seems to just stop. Does anyone know of a very basic way of executing a PHP script on a Win98 machine without the need for a browser? Or, another way of running this script that will take some time and create some 22,000 files through the process. Thanks, Martin.
You could try putting this at the top of your script: ignore_user_abort(true); Although, if it taking 20-30 mins, then I think you may need to optimize your code, or get a WinNT box with a bit more boot. <SALES PITCH> If you want, I can quote </SALES PITCH> -- Ben Cairns - Head Of Technical Operations intasept.COM Tel: 01332 365333 Fax: 01332 346010 E-Mail: [EMAIL PROTECTED] Web: http://www.intasept.com "MAKING sense of the INFORMATION TECHNOLOGY age @ WORK......"
Don't run it from the browser - just grab the php.exe and invoke the script thusly: php.exe script.php from the command line. Make sure you have set_time_limit(0) in there at the top. To make sure its progressing as expected, put in some sort of progress indicator - ie, if you're processing 1,000,000 lines, you don't want to print every line, so just do something like doLoop { ... if ($ct % 1000 == 0) print "$ct ... "; $ct++; } to print an indicator every 1,000 lines. If its breaking anywhere, this will also help you track down where its breaking. --dave ----- Original Message ----- From: "Martin E. Koss" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, February 12, 2001 9:50 PM Subject: [PHP-WIN] Run a script for 20minutes > Hi, > I have PHP3 and MySQL on Win98 and am trying to run a script that loops > through a file making process and it needs about 20 - 30 minutes to run. It > generates static HTML files based on content in a database. I've increased > Internet Explorer's timeout to allow for this but for some reason only about > half the processing is done before everything seems to just stop. > > Does anyone know of a very basic way of executing a PHP script on a Win98 > machine without the need for a browser? Or, another way of running this > script that will take some time and create some 22,000 files through the > process. > > Thanks, > > Martin. > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
I think there are timeouts on php as well: This is taken from the php.ini file. max_execution_time = 30 ; Maximum execution time of each script, in seconds I hope this helps you, you can find php.ini in your windows directory. If you are using a database, also check that for timeouts. D. -----Original Message----- From: Martin E. Koss [mailto:[EMAIL PROTECTED]] Sent: maandag 12 februari 2001 12:51 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP] Run a script for 20minutes Hi, I have PHP3 and MySQL on Win98 and am trying to run a script that loops through a file making process and it needs about 20 - 30 minutes to run. It generates static HTML files based on content in a database. I've increased Internet Explorer's timeout to allow for this but for some reason only about half the processing is done before everything seems to just stop. Does anyone know of a very basic way of executing a PHP script on a Win98 machine without the need for a browser? Or, another way of running this script that will take some time and create some 22,000 files through the process. Thanks, Martin. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
I'm using a mySQL database but to be honest I think the only thing that was timing out was the browser, since hacking the registry to eliminate that timeout the only thing I can do is wonder why it only finishes half what it is supposed to do. I'll try it on a faster machine later - it's on a AMD K6-2/366 with 128mb ram. I have a Athlon 900 that I could run it on but that's not a machine I want to tinker too much with - will go for a trusty old 450 first. Is it a surprise that it might take up to 20 or 30 minutes to build over 20,000 simple HTML files? Martin. -----Original Message----- From: Dominick Vansevenant [mailto:[EMAIL PROTECTED]] Sent: 12 February 2001 11:54 To: Martin E. Koss; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: [PHP] Run a script for 20minutes I think there are timeouts on php as well: This is taken from the php.ini file. max_execution_time = 30 ; Maximum execution time of each script, in seconds I hope this helps you, you can find php.ini in your windows directory. If you are using a database, also check that for timeouts. D. -----Original Message----- From: Martin E. Koss [mailto:[EMAIL PROTECTED]] Sent: maandag 12 februari 2001 12:51 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP] Run a script for 20minutes Hi, I have PHP3 and MySQL on Win98 and am trying to run a script that loops through a file making process and it needs about 20 - 30 minutes to run. It generates static HTML files based on content in a database. I've increased Internet Explorer's timeout to allow for this but for some reason only about half the processing is done before everything seems to just stop. Does anyone know of a very basic way of executing a PHP script on a Win98 machine without the need for a browser? Or, another way of running this script that will take some time and create some 22,000 files through the process. Thanks, Martin. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Something doesn't seem right here. I've executed scripts that have taken 4 hours to complete in the past and the only thing I had to set was: set_time_limit(0); Are you echoing anything to the screen, if not maybe you should after every loop increment, you may also need to use the flush() command. Hope this helps. Andy Woolley www.databasewatch.com ----- Original Message ----- From: "Martin E. Koss" <[EMAIL PROTECTED]> To: "Dominick Vansevenant" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, February 12, 2001 12:08 PM Subject: RE: [PHP] Run a script for 20minutes > I'm using a mySQL database but to be honest I think the only thing that was > timing out was the browser, since hacking the registry to eliminate that > timeout the only thing I can do is wonder why it only finishes half what it > is supposed to do. > > I'll try it on a faster machine later - it's on a AMD K6-2/366 with 128mb > ram. I have a Athlon 900 that I could run it on but that's not a machine I > want to tinker too much with - will go for a trusty old 450 first. > > Is it a surprise that it might take up to 20 or 30 minutes to build over > 20,000 simple HTML files? > > Martin. > > -----Original Message----- > From: Dominick Vansevenant [mailto:[EMAIL PROTECTED]] > Sent: 12 February 2001 11:54 > To: Martin E. Koss; [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: RE: [PHP] Run a script for 20minutes > > > I think there are timeouts on php as well: > > This is taken from the php.ini file. > > max_execution_time = 30 ; Maximum execution time of each script, in > seconds > > I hope this helps you, you can find php.ini in your windows directory. > > If you are using a database, also check that for timeouts. > > D. > > -----Original Message----- > From: Martin E. Koss [mailto:[EMAIL PROTECTED]] > Sent: maandag 12 februari 2001 12:51 > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: [PHP] Run a script for 20minutes > > > Hi, > I have PHP3 and MySQL on Win98 and am trying to run a script that loops > through a file making process and it needs about 20 - 30 minutes to run. It > generates static HTML files based on content in a database. I've increased > Internet Explorer's timeout to allow for this but for some reason only about > half the processing is done before everything seems to just stop. > > Does anyone know of a very basic way of executing a PHP script on a Win98 > machine without the need for a browser? Or, another way of running this > script that will take some time and create some 22,000 files through the > process. > > Thanks, > > Martin. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
How are these functions controlled? Like, if I install this dll, will anyone with a site on my server be able to use these functions? Are there any restrictions as to how they can be used? Thanks, Rick -----Original Message----- From: David Harrison [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 11, 2001 1:24 AM To: [EMAIL PROTECTED] Subject: [PHP-WIN] IIS Manipulation With the absence of any ADSI interface for PHP (and a COM implementation that seems dodgy, at least for me and the others that have tried it), I'd sort of given up thinking about using PHP for IIS manipulation and had resigned myself to a fate of VBScript for anything I needed to do. I'd noticed there's a DLL that comes with the latest distribs of PHP called php_iisfunc.dll, which I'd always wondered what it did. Whilst looking at the zend.com site today, I found a list of undocumented functions (http://www.zend.com/phpfunc/nodoku.php), which makes reference to these functions. Because noone has done it yet (unless I've missed it) I thought I'd just spam some quick information about some testing I did with them. ---------------- string iis_GetScriptMap(string id, string virtualPath, string extension) Returns IIS script mappings for a site. eg: echo iis_GetScriptMap(iis_GetServerByComment("srvName"), "", ".asp"); returns: .asp,F:\WINNT\System32\inetsrv\asp.dll,1,GET,HEAD,POST,TRACE ---------------- int iis_AddServer(string Path, string Comment, string ServerIP, int ServerPort, string HostName, int ServerRights, int StartServer) Adds a server to the IIS Metabase with the supplied parameters. eg: iis_AddServer("f:\\", "comment","130.102.1.1", 80,"hostname", 0,1); Creates a new server with a hostheader name "hostname". Returns the Server Instance ID for the created server. ---------------- int iis_GetServerByComment(string comment); int iis_GetServerByPath(string path); Returns the server instance ID for the server with the comment (ie, the name that appears in MMC). This ID can then be passed to some of the other functions (as done below). eg: iis_GetServerByComment("Default Web Site"); iis_GetServerByPath("f:\inetpub\wwwroot"); Returns: Using 'Default Web Site' as the comment should return 1. ---------------- int iis_StopServer(int serverID); Stops a particular server eg: iis_StopServer("Default Web Site"); Returns 1 on success, 0 on failure, I _think_ - however, I couldn't get this function to work. I'm not sure of the difference between this one and iis_StopService. I would have thought StopService would stop the whole webservice, but it seems to take a serverID parameter. Shrug. ---------------- int iis_StartServer(int serverID); Starts a particular server eg: iis_StartServer("Default Web Site"); Returns 1 on success, 0 on failure, I _think_. That is, the function returned 1 on one site that I'd stopped, and successfully restarted it. However, I couldn't make it restart the 'Default Web Site', yet it still returned 1. Shrug. ---------------- int iis_RemoveServer(int serverID); eg: iis_RemoveServer(iis_GetServerByComment("comment")); Returns 1 on success, -602 on failure (if I made up a fake comment) ---------------- There are also the following, which return values that I didn't try to figure out (laziness), and take a 2nd parameter (referred to in the source as string VirtualPath) that I also didn't figure out (also laziness): iis_getdirsecurity(iis_GetServerByComment("website"), ""); iis_GetServerRight(iis_GetServerByComment("website"), ""); iis_GetServiceState(iis_GetServerByComment("website")); Sorry about the poor documentation, but its better than what is on the PHP site :) I'm not sure how stable/reliable these are. I had a quick look through the source but I'm not familiar enough with the metabase functions that are used to know whether or not its done in the most stable way. I know though that I've had enough problems with metabase corruption on servers that have only ever been administered through MMC to be wary when trying 3rd party products to do a similar thing. --dave -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Hello. I have been asked to provide php support for all the websites on my IIS5 server, but I am not entirely sure what benefits the bigger 3.6meg API install will bring me over the smaller CGI install. Do I need it? Should I use it?! Any comments much appreciated! Thanks Jeremy _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
One of our ISPs is refusing to put PHP on their server(s) (I believe they are using IIS). The reason they give is that they have heard that PHP is unstable on the NT platform. Has anyone heard of problems using PHP in the NT environment and if so what problems are there? Thanks! Victor Johansen PC/LAN Manager Coates Screen [EMAIL PROTECTED]
PHP on NT as an ISAPI module is unstable on many systems. PHP as a CGI is rock solid stable - I have had no problems at all with php on any of my production (or test!) NT4 boxes. Cheers -- Phil Driscoll Dial Solutions +44 (0)113 294 5112 http://www.dialsolutions.com http://www.dtonline.org
Hi Phil, On 12 February 2001 at 16:11:16 -0000 (which was 16:11 where I live) words of wisdom emanated from Phil Driscoll. PD> PHP on NT as an ISAPI module is unstable on many systems. PHP as a CGI PD> is rock solid stable - I have had no problems at all with php on any of PD> my production (or test!) NT4 boxes. Snap. That is what I have found. I have crashed a server with ASP but never with PHP. <grin> -- Regards, _______________________________________________ David | David Elliott | Software Engineer | _________________________| [EMAIL PROTECTED] | PGP Key ID 0x650F4534 | | Has anyone seen my Tagline? I think someone stole it!! |
I have to agree with Phil. I've been running PHP on our NT 4 / IIS 4 box for almost a year now without any problems while installed as a CGI. IMHO, the ISAPI module should not be used on production machines on NT yet. You should tell them that "hearing" and "researching the truth" are usually two different things and you would prefer that they do the latter. Unstable: no. Security risk: perhaps. That answer I can't really deny. If they are worried about you putting a line of code like unlink ( '*.asp' ); on their machine (not a bad idea really...) then they might have to take some extra steps on the security side. John --------------------- Founder of The 'What Kind of Idiot Uses PHP with IIS with Oracle on NT?' Consortium Members: John Asendorf, Thomas Kryger, Florian Clever, Ron Woods, Bod John Asendorf - [EMAIL PROTECTED] Web Applications Developer http://www.lcounty.com - NEW FEATURES ADDED DAILY! Licking County, Ohio, USA 740-349-3631 Vah! Denuone Latine loquebar? Me ineptum. Interdum modo elabitur. > -----Original Message----- > From: Victor Johansen [mailto:[EMAIL PROTECTED]] > Sent: Monday, February 12, 2001 11:04 AM > To: [EMAIL PROTECTED] > Subject: [PHP-WIN] NT Stability > > > One of our ISPs is refusing to put PHP on their server(s) (I > believe they > are using IIS). The reason they give is that they have heard > that PHP is > unstable on the NT platform. Has anyone heard of problems > using PHP in the > NT environment and if so what problems are there? > > Thanks! > > Victor Johansen > PC/LAN Manager > Coates Screen > [EMAIL PROTECTED] > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: > [EMAIL PROTECTED] >
I need a sample code of a php that has a xml string, a xsl string, and generates html output. I've seen the php.net manual sample, but doesn't work correctly !!!. Thank you for your help!!! =================================================== Antonio López Luna Ingeniería e Integración Avanzadas (Ingenia), S.A. Parque Tecnológico de Andalucía 29590 - Málaga (Spain) Tel. 34-952029300 Ext. 386 Fax. 34-952029309 Web: http://www.ingenia.es
PHPBuilder.com has a good article: Transforming XML with XSL using Sablotron ----- http://www.phpbuilder.com/columns/justin20001025.php3 Regards, Paul ----- Original Message From: "Antonio Lopez" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, February 12, 2001 12:06 PM Subject: [PHP-WIN] "xml + xsl to html" sample code I need a sample code of a php that has a xml string, a xsl string, and generates html output. I've seen the php.net manual sample, but doesn't work correctly !!!. Thank you for your help!!! =================================================== Antonio López Luna Ingeniería e Integración Avanzadas (Ingenia), S.A. Parque Tecnológico de Andalucía 29590 - Málaga (Spain) Tel. 34-952029300 Ext. 386 Fax. 34-952029309 Web: http://www.ingenia.es -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
The Article on PHP Builder is a great introduction to the XSL functions, but the sample code uses file pointers instead of strings. Just this weekend I created the following code based on the PHP sample: $templateXSL = "d:/xml/filename.xsl" // load the xls file as a string $fp = fopen($templateXSL,"r"); if($fp) { // get length if (getType($fp) == 'file') { $length = filesize($templateXSL()); } else { $length = 1000000; } $xslData = (fread($fp,$length)); } else { return 0; } if (xslt_process($xslData, $xmlString, $result)) { echo $result; } else { echo "There was an error that occurred in the XSL transformation...\n"; echo "\tError number: " . xslt_errno() . "\n"; echo "\tError string: " . xslt_error() . "\n"; } Hope that helps! --> Phillip Fox -- [EMAIL PROTECTED] 405.773.WORX -- 1.888.772.WORX -- http://www.TheWorxCo.Net/ > -----Original Message----- > From: Antonio Lopez [mailto:[EMAIL PROTECTED]] > Sent: Monday, February 12, 2001 10:07 AM > To: [EMAIL PROTECTED] > Subject: [PHP-WIN] "xml + xsl to html" sample code > > > > I need a sample code of a php that has a xml string, a xsl string, and > generates > html output. > > I've seen the php.net manual sample, but doesn't work correctly !!!. > > > Thank you for your help!!! > > > > > > =================================================== > Antonio López Luna > Ingeniería e Integración Avanzadas (Ingenia), S.A. > Parque Tecnológico de Andalucía > 29590 - Málaga (Spain) > > Tel. 34-952029300 Ext. 386 > Fax. 34-952029309 > Web: http://www.ingenia.es > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: > [EMAIL PROTECTED] >
Hi, I found following problem (maybe bug ?) in PHP 4.0.x. When I try to read contents of UNC named directory, function: opendir() always return success even when the directory doesn't exist. readdir() always returns nothing even when the directory exists and contain files. is_dir() on the contrary always results in: stat failed for ....... (errno=2 - No such file or directory) When UNC is mapped to letter it seems to work OK. All this tests I did both using PHP.EXE from command line and from Apache 1.3.17 with php4apache.dll When I compiled test C program using readdir.c,readdir.h and strlcpy.c from PHP 4.0.4PL1 sources - it hapilly passed all my tests. When downgraded to PHP 3.0.17 CGI, all was working OK. My problem is, that I need PHP 4.x (I am using COM component) and I don't like the idea of mapping UNC pathnames to letters. My question is: does somebody what should I do ? thanks MaT
I've written a little script that makes a form using a simple for loop: if ( $num_reg != "" ) { //we're doing regulars for ( $i = 1 ; $i <= $num_reg ; $i++ ) { echo "<tr><td>A<input type=\"hidden\" name=\"tag_type${i}\" value=\"A\"></td>"; echo "<td><input type=\"text\" name=\"tag_num${i}\"></td>"; echo "<td><input type=\"text\" name=\"tag_cost${i}\" value=\"\"></td>"; echo "<td><input type=\"text\" name=\"tag_late${i}\"></td></tr>\n"; } $tag_count = $num_reg; } Now what I have is a number of variables that look something like this $tag_type1, $tag_num1, $tag_cost1, $tag_late1, $tag_type2, $tag_num2, $tag_cost2, $tag_late2, etcetera... up to any number of tags... now I'm trying to write a little for loop that drops this information into a database after the POST: for ( $i=1 ; $i <= $tag_count ; $i++ ) { //tag_count came from the post (dl_post_3.php) $sql = "INSERT into cfull2.tbl_dl_tags (TAGID_NUM, CUSTID_NUM, TAG_NO, TAG_YEAR, TYPE_CODE, COST, TYPE) VALUES ($CUSTID_NUM, $tag_num$i, $tag_year, '$tag_type$i' , $tag_cost$i )"; $stmt = OCIParse ( $connection , $sql ); OCIExecute ( $stmt , OCI_DEFAULT ); OCICommit( $connection ); OCIFreeStatement ( $stmt ); } This obviously doesn't work and I'm not really sure what to do now. Is this a case of variable variable names? I don't quite get those either :) Thanks in advance all, John --------------------- John Asendorf - [EMAIL PROTECTED] Web Applications Developer http://www.lcounty.com - NEW FEATURES ADDED DAILY! Licking County, Ohio, USA 740-349-3631 Ipsa scientia potestas est
dHJ5IGFzc2lnbmluZyBpdCB0byBhbm90aGVyIHZhcmlhYmxlIGZpcnN0Og0KZm9yIC4uLi4NCgkk dGFnID0gIiR0YWdfbnVtJGkiOw0KCSR0eXBlID0gInRhZ190eXBlJGkiOw0KCSRzcWwgPSAuLi4u IFZBTFVFUyAoLi4uLCAkdGFnLCAkdHlwZS4uLi4pOw0KDQpJZ25hdGl1cw0KDQo+IC0tLS0tT3Jp Z2luYWwgTWVzc2FnZS0tLS0tDQo+IEZyb206IEFzZW5kb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