php-windows Digest 22 May 2001 20:03:44 -0000 Issue 612 Topics (messages 7803 through 7845): Re: OK, I'm officially screwed if I can't get some suggestions 7803 by: Jason Gan 7808 by: Johan Lundqvist 7812 by: Paco Ortiz 7813 by: Svensson, B.A.T. 7815 by: Svensson, B.A.T. 7820 by: Asendorf, John 7821 by: Asendorf, John 7822 by: Asendorf, John 7823 by: Asendorf, John 7825 by: Svensson, B.A.T. 7839 by: Asendorf, John HELP ! 7804 by: mihai 7807 by: Phil Driscoll Re: Variable in the statement 7805 by: Johannes Janson Upload troubles 7806 by: Warwick Chapman (Budgee) 7814 by: FX Liagre Re: escape loop on timeout 7809 by: Johan Lundqvist 7810 by: Zak Greant 7811 by: Johan Lundqvist Programming in the small WAS: [PHP-WIN] escape loop on timeout 7816 by: Svensson, B.A.T. php install 7817 by: Dalyyla sessions without trans_id 7818 by: Dalyyla problems with php_track_vars. please help 7819 by: juanma cola SQL Server stored procedures and functions 7824 by: Scott 7826 by: Pavel Kalian 7843 by: andrew morton Multiple value selection box (mix php/html problem) returning only one value 7827 by: Michael Kelley 7828 by: Matt Williams 7829 by: Michael Kelley 7830 by: Michael Kelley 7832 by: Svensson, B.A.T. 7833 by: Matt Williams 7836 by: Michael Kelley 7841 by: Vasu Gokaraju 7845 by: Michael Kelley Re: Multiple value selection box (mix php/html problem) returning only one value] 7831 by: Michael Kelley Speed 7834 by: Jerry Nelson 7835 by: John Lim Re: Multiple value selection box (mix php/html problem) 7837 by: Michael Kelley dual web servers? 7838 by: Deborah Dennison 7840 by: Dickerson, Monty Need Help!! 7842 by: Brian Little Re: Need help with Cookies 7844 by: Brian Little 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] ----------------------------------------------------------------------
Hi John Asendorf, Can you supply a short example of the PHP code, so that someone can suggest ways of optimising it? What do you mean "sessions via files"? Do you mean PHP's built-in support for sessions? Maybe it's just the server having a bad day. -----Original Message----- From: Asendorf, John [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 22 May 2001 5:58 AM To: Tim Uckun; Asendorf, John; Php-Windows (E-mail) Subject: RE: [PHP-WIN] OK, I'm officially screwed if I can't get some suggestions
Sounds to me like it might be the firewall messing things up. Are the clients connecting with https? What's the workload on the firewall? You said that the web server is in the DMZ. Where are the clients? On the Private or Public side of the firewall? /Johan "Asendorf, John" wrote: > > I don't think that it's an SQL issue. Searches on the customer "Smith" run > through and back (including formating the data) in about 3.5 seconds (per > the timer in the script) but take about 15 seconds to see a response on the > client. The whole building is base-T and fiber.... > > --------------------- > John Asendorf - [EMAIL PROTECTED] > Web Applications Developer > http://www.lcounty.com - NEW FEATURES ADDED DAILY! > Licking County, Ohio, USA > 740-349-3631 > Aliquando et insanire iucundum est > > > -----Original Message----- > > From: Dan Cleveland [mailto:[EMAIL PROTECTED]] > > Sent: Monday, May 21, 2001 3:37 PM > > To: Asendorf, John > > Subject: Re: [PHP-WIN] OK, I'm officially screwed if I can't get some > > suggestions > > > > > > have you also tried cleaning up your sql table joins? > > Depending on the > > order of your where clause can increase or decrease speed. > > > > select * from table_1 T1, table_2 T2 where T1.id = 5 and T2.id = 6 and > > T1.t2_id = T2.id > > > > that select will run slower then > > > > select * from table_1 T1, table_2 T2 where T1.ts_id = T2.id > > and T1.id = 5 > > and T2.id = 6 > > > > the reason is because in the second one the table are joined > > right away > > and in the first a cartisean (sp) product is first made of table_1 and > > table_2 and then the rows are eleminated. So depeding on your tables > > sizes, the selects could be dragging the overall time down. > > > > Just a thought. > > > > Dan > > > > +-------------------------------------------------------------------+ > > | | > > | If Yoda so strong in force is, | > > | why words in proper order he cannot put? | > > | | > > +-------------------------------------------------------------------+ > > | | > > +-------------------------------------------------------------------+ > > | Daniel J. Cleveland | > > | e-mail: [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]
Hi, perhaps I am missing something, but I want to help, >PHP 4.0.4. IIS 4, Oracle 8 client, Oracle 7.3.4 backend, webserver in DMZ could it be that you need Oracle 7.3.4 client software, instead using Oracle8? Then you would use Ora_Logon (OCI7), instead OCILogon (OCI8) I experienced some months ago problems with client 8.1.6 and a 8.0.5 backend, so perhaps this is your problem too... why don't you try this approach (nothing to loose, unless all your PHP programming is made with OCI8 :-( ) Greetings, F.J.Ortiz 5/21/01 9:24:12 PM, "Asendorf, John" <[EMAIL PROTECTED]> wrote: >OK... > >PHP 4.0.4. IIS 4, Oracle 8 client, Oracle 7.3.4 backend, webserver in DMZ > >I'm having some speed problems with a data entry front end that is being >used in house. > >The queries sometimes (most times) take upwards of 13-17 seconds to run. >I've put a timer which starts at the beginning of the script and doesn't end >until the very end. It usually registers 2-3 seconds. I'm using sessions >via files. > >I've tried making the code as clean as possible, and the scripts themselves >seem to be running very fast. Would sessions be the most likely culprit for >my speed loss? It's (the slowness) threatening to kill the whole project... >We have a similar ASP/M$SQL server application (vendor product) which >blazes... and it's driving me nuts... > >Thanks in advance if you have some clues for me... > >John > >--------------------- >John Asendorf - [EMAIL PROTECTED] >Web Applications Developer >http://www.lcounty.com - NEW FEATURES ADDED DAILY! >Licking County, Ohio, USA >740-349-3631 >Aliquando et insanire iucundum est > > >-- >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] > > ___________________________________ Francisco Javier Ortiz Torre ComuNET,S.A. mailto:[EMAIL PROTECTED] ComuNET, S.A Gral. Concha 39,6º 48012 Bilbao España Tel: +34 944 700 101 Fax: +34 944 700 185 http://www.comunet.es ___________________________________
>I've tried making the code as clean as possible, and the scripts themselves >seem to be running very fast. Would sessions be the most likely culprit for >my speed loss? It's (the slowness) threatening to kill the whole project... >We have a similar ASP/M$SQL server application (vendor product) which >blazes... and it's driving me nuts... You say it runs fast on MS SQL server. Two points: 1) Is there any differences in between the oracle server and the MS SQL server in terms of for ex. indexing? 2) Is it possible to use the MS SQL server for this task instead?
>I don't think that it's an SQL issue. Searches on the customer "Smith" run >through and back (including formating the data) in about 3.5 seconds (per >the timer in the script) but take about 15 seconds to see a response on the >client. The whole building is base-T and fiber.... Sound like the lag-monster are eating networks packages again... Are other (applications) connection's suffering a similar kind of lag (or any notable delays?) An extreme long shot might be hardware problem. :) We once at my former company had severe networks delays. Nobody really knew what it was. A guy (which was an idiot anyway:) suggested that this was because lots of people were downloading (to much and big) stuff. I had a regular ping on the gateway, but couldnt notice any deviation because of this. After a couple of weeks, we had a electrician there, and he found oxide on the plugs for the network cables in the main switch... After removing the faulty plugs, everything went oki again...
We thought so too, but other scripts and ASP stuff runs fine... Regular http, firewal gets banged pretty hard all day. Client for this app are on the private side. --------------------- John Asendorf - [EMAIL PROTECTED] Web Applications Developer http://www.lcounty.com - NEW FEATURES ADDED DAILY! Licking County, Ohio, USA 740-349-3631 Aliquando et insanire iucundum est > -----Original Message----- > From: Johan Lundqvist [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, May 22, 2001 5:31 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP-WIN] OK, I'm officially screwed if I can't get some > suggestions > > > Sounds to me like it might be the firewall messing things up. > Are the clients connecting with https? What's the workload on the > firewall? > > You said that the web server is in the DMZ. Where are the clients? On > the Private or Public side of the firewall? > > /Johan > > "Asendorf, John" wrote: > > > > I don't think that it's an SQL issue. Searches on the > customer "Smith" run > > through and back (including formating the data) in about > 3.5 seconds (per > > the timer in the script) but take about 15 seconds to see a > response on the > > client. The whole building is base-T and fiber.... > > > > --------------------- > > John Asendorf - [EMAIL PROTECTED] > > Web Applications Developer > > http://www.lcounty.com - NEW FEATURES ADDED DAILY! > > Licking County, Ohio, USA > > 740-349-3631 > > Aliquando et insanire iucundum est > > > > > -----Original Message----- > > > From: Dan Cleveland [mailto:[EMAIL PROTECTED]] > > > Sent: Monday, May 21, 2001 3:37 PM > > > To: Asendorf, John > > > Subject: Re: [PHP-WIN] OK, I'm officially screwed if I > can't get some > > > suggestions > > > > > > > > > have you also tried cleaning up your sql table joins? > > > Depending on the > > > order of your where clause can increase or decrease speed. > > > > > > select * from table_1 T1, table_2 T2 where T1.id = 5 and > T2.id = 6 and > > > T1.t2_id = T2.id > > > > > > that select will run slower then > > > > > > select * from table_1 T1, table_2 T2 where T1.ts_id = T2.id > > > and T1.id = 5 > > > and T2.id = 6 > > > > > > the reason is because in the second one the table are joined > > > right away > > > and in the first a cartisean (sp) product is first made > of table_1 and > > > table_2 and then the rows are eleminated. So depeding on > your tables > > > sizes, the selects could be dragging the overall time down. > > > > > > Just a thought. > > > > > > Dan > > > > > > > +-------------------------------------------------------------------+ > > > | > | > > > | If Yoda so strong in force is, > | > > > | why words in proper order he cannot put? > | > > > | > | > > > > +-------------------------------------------------------------------+ > > > | > | > > > > +-------------------------------------------------------------------+ > > > | Daniel J. Cleveland > | > > > | e-mail: > [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] > > -- > 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'd be happy to send these scripts via email to anyone who would request them, but I don't want to post them to the forum. --------------------- John Asendorf - [EMAIL PROTECTED] Web Applications Developer http://www.lcounty.com - NEW FEATURES ADDED DAILY! Licking County, Ohio, USA 740-349-3631 Aliquando et insanire iucundum est > -----Original Message----- > From: Jason Gan [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, May 22, 2001 4:38 AM > To: [EMAIL PROTECTED] > Subject: RE: [PHP-WIN] OK, I'm officially screwed if I can't get some > suggestions > > > Hi John Asendorf, > > Can you supply a short example of the PHP code, so that > someone can suggest > ways of optimising it? > What do you mean "sessions via files"? Do you mean PHP's > built-in support > for sessions? > > Maybe it's just the server having a bad day. > > > -----Original Message----- > From: Asendorf, John [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, 22 May 2001 5:58 AM > To: Tim Uckun; Asendorf, John; Php-Windows (E-mail) > Subject: RE: [PHP-WIN] OK, I'm officially screwed if I can't get some > suggestions > > > > -- > 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] >
1) About the only difference is the server where the dbs reside and they are still VERY similar. Other than that, wiring is similar or identical and the databases are quite a bit difference, but our Oracle dba (who I trust to the nth degree) says the db is indexed as well as he can imagine indexing it for the queries we are doing. 2) Unfortunately, the MS SQL Server being used is a vendor install and drives a vendor's program. All of our in house data is Oracle driven. --------------------- John Asendorf - [EMAIL PROTECTED] Web Applications Developer http://www.lcounty.com - NEW FEATURES ADDED DAILY! Licking County, Ohio, USA 740-349-3631 Aliquando et insanire iucundum est > -----Original Message----- > From: Svensson, B.A.T. [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, May 22, 2001 6:44 AM > To: Asendorf, John; Php-Windows (E-mail) > Subject: RE: [PHP-WIN] OK, I'm officially screwed if I can't get some > sugg estions > > > >I've tried making the code as clean as possible, and the > scripts themselves > >seem to be running very fast. Would sessions be the most > likely culprit > for > >my speed loss? It's (the slowness) threatening to kill the whole > project... > >We have a similar ASP/M$SQL server application (vendor product) which > >blazes... and it's driving me nuts... > > You say it runs fast on MS SQL server. Two points: > > 1) Is there any differences in between the oracle server and the > MS SQL server in terms of for ex. indexing? > > 2) Is it possible to use the MS SQL server for this task instead? > > -- > 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] >
No noticeable delays coming out of anything else I'm afraid. Everything else seems to blaze... --------------------- John Asendorf - [EMAIL PROTECTED] Web Applications Developer http://www.lcounty.com - NEW FEATURES ADDED DAILY! Licking County, Ohio, USA 740-349-3631 Aliquando et insanire iucundum est > -----Original Message----- > From: Svensson, B.A.T. [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, May 22, 2001 6:54 AM > To: Asendorf, John; Php-Windows (E-mail) > Subject: RE: [PHP-WIN] OK, I'm officially screwed if I can't get some > sugg estions > > > >I don't think that it's an SQL issue. Searches on the > customer "Smith" run > >through and back (including formating the data) in about 3.5 > seconds (per > >the timer in the script) but take about 15 seconds to see a > response on the > >client. The whole building is base-T and fiber.... > > Sound like the lag-monster are eating networks packages again... > > Are other (applications) connection's suffering a similar kind of > lag (or any notable delays?) > > An extreme long shot might be hardware problem. :) We once at > my former > company had severe networks delays. Nobody really knew what it was. A > guy (which was an idiot anyway:) suggested that this was because lots > of people were downloading (to much and big) stuff. I had a regular > ping on the gateway, but couldnt notice any deviation because of this. > After a couple of weeks, we had a electrician there, and he found > oxide on the plugs for the network cables in the main switch... > > After removing the faulty plugs, everything went oki again... >
So we can exclude the hardware then. :) Assuming the queries runs for about the same time in the RDBMS', then I would like to agree with Johan Lundqvits: It seams to be something wrong on (ISO) Transport, Network, Session level, etc. Maybe you should review which transport protocols are used within both configurations. And then analyze which way the packets is communicated over the network, and determine what kind of bridges, etc. etc the traffic has to pass, and check what kind of eventually services that might be able to filter you applications. >-----Original Message----- >From: Asendorf, John [mailto:[EMAIL PROTECTED]] >Sent: Tuesday, May 22, 2001 2:44 PM >To: Svensson, B.A.T. ; Php-Windows (E-mail) >Subject: RE: [PHP-WIN] OK, I'm officially screwed if I can't get some >sugg estions > > >No noticeable delays coming out of anything else I'm afraid. >Everything >else seems to blaze... > >--------------------- >John Asendorf - [EMAIL PROTECTED] >Web Applications Developer >http://www.lcounty.com - NEW FEATURES ADDED DAILY! >Licking County, Ohio, USA >740-349-3631 >Aliquando et insanire iucundum est > > >> -----Original Message----- >> From: Svensson, B.A.T. [mailto:[EMAIL PROTECTED]] >> Sent: Tuesday, May 22, 2001 6:54 AM >> To: Asendorf, John; Php-Windows (E-mail) >> Subject: RE: [PHP-WIN] OK, I'm officially screwed if I can't get some >> sugg estions >> >> >> >I don't think that it's an SQL issue. Searches on the >> customer "Smith" run >> >through and back (including formating the data) in about 3.5 >> seconds (per >> >the timer in the script) but take about 15 seconds to see a >> response on the >> >client. The whole building is base-T and fiber.... >> >> Sound like the lag-monster are eating networks packages again... >> >> Are other (applications) connection's suffering a similar kind of >> lag (or any notable delays?) >> >> An extreme long shot might be hardware problem. :) We once at >> my former >> company had severe networks delays. Nobody really knew what it was. A >> guy (which was an idiot anyway:) suggested that this was because lots >> of people were downloading (to much and big) stuff. I had a regular >> ping on the gateway, but couldnt notice any deviation >because of this. >> After a couple of weeks, we had a electrician there, and he found >> oxide on the plugs for the network cables in the main switch... >> >> After removing the faulty plugs, everything went oki again... >> >
LATEST UPDATE: It looks like I've found my culprit... I have an include (dl_app.inc) which contains the following lines: These lines are eating up 12-14 second of the 14-16 second run time... (EVEN WITH THE connection check commented out i.e. the check didn't seem to make any difference) I get the same problem if I put the code directly into the script itself I never have an OCILogoff in any of the scripts that this runs through... Is the OCI P Logon valid when using an 8.1.6 client and a 7.3.4 database? ------- /* Simple Oracle Connection */ //establish persistent logon if ( $debug ) { echo "DEBUG: Connecting to Dog License dB<br>"; } //connection info login, password, SID $connection = OCIPLogon( "user" , "password" , "sid" ); //not the real ones so don't bother /* check the connection if ( !$connection ){ if ( $debug ) { echo "DEBUG: Bad connection"; } echo OCIError( $connection ).":".OCIError( $connection )."<br>"; exit; } */ -------- --------------------- John Asendorf - [EMAIL PROTECTED] Web Applications Developer http://www.lcounty.com - NEW FEATURES ADDED DAILY! Licking County, Ohio, USA 740-349-3631 Aliquando et insanire iucundum est > -----Original Message----- > From: Svensson, B.A.T. [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, May 22, 2001 8:56 AM > To: Asendorf, John; Php-Windows (E-mail) > Subject: RE: [PHP-WIN] OK, I'm officially screwed if I can't get some > sugg estions > > > So we can exclude the hardware then. :) Assuming the queries runs > for about the same time in the RDBMS', then I would like to agree > with Johan Lundqvits: It seams to be something wrong on (ISO) > Transport, Network, Session level, etc. > > Maybe you should review which transport protocols are used within > both configurations. And then analyze which way the packets is > communicated over the network, and determine what kind of > bridges, etc. etc the traffic has to pass, and check what kind > of eventually services that might be able to filter you applications. > > > >-----Original Message----- > >From: Asendorf, John [mailto:[EMAIL PROTECTED]] > >Sent: Tuesday, May 22, 2001 2:44 PM > >To: Svensson, B.A.T. ; Php-Windows (E-mail) > >Subject: RE: [PHP-WIN] OK, I'm officially screwed if I can't get some > >sugg estions > > > > > >No noticeable delays coming out of anything else I'm afraid. > >Everything > >else seems to blaze... > > > >--------------------- > >John Asendorf - [EMAIL PROTECTED] > >Web Applications Developer > >http://www.lcounty.com - NEW FEATURES ADDED DAILY! > >Licking County, Ohio, USA > >740-349-3631 > >Aliquando et insanire iucundum est > > > > > >> -----Original Message----- > >> From: Svensson, B.A.T. [mailto:[EMAIL PROTECTED]] > >> Sent: Tuesday, May 22, 2001 6:54 AM > >> To: Asendorf, John; Php-Windows (E-mail) > >> Subject: RE: [PHP-WIN] OK, I'm officially screwed if I > can't get some > >> sugg estions > >> > >> > >> >I don't think that it's an SQL issue. Searches on the > >> customer "Smith" run > >> >through and back (including formating the data) in about 3.5 > >> seconds (per > >> >the timer in the script) but take about 15 seconds to see a > >> response on the > >> >client. The whole building is base-T and fiber.... > >> > >> Sound like the lag-monster are eating networks packages again... > >> > >> Are other (applications) connection's suffering a similar kind of > >> lag (or any notable delays?) > >> > >> An extreme long shot might be hardware problem. :) We once at > >> my former > >> company had severe networks delays. Nobody really knew > what it was. A > >> guy (which was an idiot anyway:) suggested that this was > because lots > >> of people were downloading (to much and big) stuff. I had a regular > >> ping on the gateway, but couldnt notice any deviation > >because of this. > >> After a couple of weeks, we had a electrician there, and he found > >> oxide on the plugs for the network cables in the main switch... > >> > >> After removing the faulty plugs, everything went oki again... > >> > > > > -- > 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 can install PHP on PWS for Windows. I follow the instructions but when run a php script i have an error message Error message: 500 internal server error. Thank you Mihai [EMAIL PROTECTED]
On Tuesday 22 May 2001 09:39, mihai wrote: > > I can install PHP on PWS for Windows. > I follow the instructions but when run a php script i have an error message > Error message: 500 internal server error. > > Thank you > Mihai > [EMAIL PROTECTED] Here's a section from the updated Windows installations notes which should be released with php 4.0.6: ****************************** - You have installed PHP, but when try to access a php script file via your browser, you get a blank screen: Do a 'view source' in the web browser and you will probably find that you can see the source code of your php script. This means that the web server did not send the script to php for interpretation. Something is wrong with the server configuration - double check the server configuration against the php installation instructions. - You have installed PHP, but when try to access a php script file via your browser, you get a server 500 error: Something went wrong when the server tried to run PHP. To get to see a sensible error message, from the command line, change to the directory containing php.exe and run php.exe -i If php has any problems running, then a suitable error message will be displayed which will give you a clue as to what needs to be done next. If you get a screen full of html codes (the output of the phpinfo() function) then php is working ok, and your problem may be related to your server configuration which you should double check. - You have installed PHP, but when try to access a php script file via your browser, you get the error: cgi error: The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: This error message means that php failed to output anything at all. From the command line hange to the directory containing php.exe. Run php.exe -i If php has any problems running, then a suitable error message will be displayed which will give you a clue as to what needs to be done next. If you get a screen full of html codes (the output of the phpinfo() function) then php is working ok. Once php is working at the command line, try accessing the php script via the browser again. If it still fails then it could be one of the following: file permissions on your php script, php.exe, php4ts.dll, php.ini or any php extensions you are trying to load are such that the anonymous internet user ISUR_<machinename> cannot access them. The script file does not exist (or possibly isn't where you think it is relative to your web root directory). Note that for IIS you can trap this error by ticking the 'check file exists' box when setting up the script mappings in the Internet Services Manager. If a script file does not exist then the server will return a 404 error instead. There is also the additional benefit that IIS will do any authentication required for you based on the NTLanMan permissions on your script file. -- Phil Driscoll
Hi, > <?php > global $titel; > $titel='html' missing colon; > $db = mysql_connect("localhost", "root") or die ("Kan geen connectie > maken met het database programma. De Database server kan uit staan.");; > mysql_select_db("setf",$db) or die ("Kan geen connectie maken met de > database"); > > $result = mysql_query("SELECT titel FROM onderwerpen where > titel=$titel") missing colon; no quotes around the $title. > or die ("kan niks uit de database lezen. Reload en probeer het nog een > keer."); > > // the other select i used: > $result = mysql_query("SELECT titel FROM onderwerpen where > titel='$titel'") missing colon; > > file://The working select without a variable > $result = mysql_query("SELECT titel FROM onderwerpen where > titel='html'") colon; Take the third statement, the one with quotes around '$titel'. Exept from the missing colons it looks alright and should work. hope it helps Johannes
Howdy I am trying to get a picture gallery going on a family site. I want family members to be able to upload scans, and the gallery code to display them. I have the gallery code working fine, but I cannot get uploads to work at all. IIS 5 + Windows 2000 Professional + PHP 4.05 (I have also tried Debian Linux 2.2, Apache 1.3.19 and PHP 4.03pl1). I lose track after the form is submitted. I can't seem to find the uploaded file anywhere. It seems not to have been uploaded at all. Please could someone send me code and system configuratyion details which has worked for them. Thanks and regards Warwick Chapman (Glenwood 1999) http://www.boatrace.co.za Assistant IT Manager Glenwood High School, Durban, South Africa 031 2055241 083 7797094 http://www.glenwoodhighschool.co.za
My File field is named FILENAME, and I copy it into ./download directory (from the uploadtemp dir defined in php.ini) In php.ini, I have parametered 2 lines : file_uploads = On ; Whether to allow HTTP file uploads upload_max_filesize = 2M ; Maximum allowed size for uploaded files My form look like : <FORM NAME="UPLD" onSubmit="Javascript:document.UPLD.BTIMPORT.disabled=true" ENCTYPE="multipart/form-data" METHOD="POST" ACTION="Importe_groupes.php"> <TABLE BORDER="0" WIDTH="100%"> <TR> <TD WIDTH="40%" ALIGN="right">List description :</TD> <TD WIDTH="60%" COLSPAN="2"><INPUT TYPE="text" NAME="LIBELLEGROUPE" SIZE="20" MAXLENGTH="40"></TD> </TR> <TR> <TD WIDTH="40%" ALIGN="right">File to import :</TD> <TD WIDTH="60%" COLSPAN="2"><INPUT TYPE="file" NAME="FILENAME" SIZE="20" MAXLENGTH="64"></TD> </TR> <TR> <TD WIDTH="40%" ALIGN="right"></TD> <TD WIDTH="60%" COLSPAN="2"></TD> </TR> <TR> <TD WIDTH="40%"> <P ALIGN="right"><INPUT TYPE="submit" VALUE="Import" NAME="BTIMPORT"> </TD> <CENTER> <TD WIDTH="4%"></TD> <TD WIDTH="56%"><INPUT TYPE="reset" VALUE="Cancel" NAME="BTCANCEL"></TD> </TR> </TABLE> <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="2000000"> <INPUT TYPE="hidden" NAME="TYPEGROUPE" VALUE="2"> </FORM> The MAX_FILE_SIZE hidden field seems to be mandatory for the upload to work. The script in Importe_groupes.php begins with : if(isset($FILENAME_name) && (!empty($FILENAME_name))) { $nname = "./download/" . "$FILENAME_name"; if (file_exists($nname)) exec("del \"$nname\""); // WINNT server... if (!copy($FILENAME, $nname)) { $page = '<HTML><body text="#003399">'; $page .= '<META HTTP-EQUIV="REFRESH" CONTENT="4; URL=Importe_groupes.php">'; $page .= '<CENTER><H2><BR>Unable to generate file onto the server.<br>'; $page .='</H2></CENTER></BODY></HTML>'; echo $page; exit(); } and here I use the uploaded file... HTH -- FX Liagre [EMAIL PROTECTED] [EMAIL PROTECTED] ""Warwick Chapman (Budgee)"" <[EMAIL PROTECTED]> a écrit dans le message news: [EMAIL PROTECTED] > Howdy > > I am trying to get a picture gallery going on a family site. I want > family members to be able to upload scans, and the gallery code > to display them. I have the gallery code working fine, but I cannot > get uploads to work at all. > > IIS 5 + Windows 2000 Professional + PHP 4.05 (I have also tried > Debian Linux 2.2, Apache 1.3.19 and PHP 4.03pl1). > > I lose track after the form is submitted. I can't seem to find the > uploaded file anywhere. It seems not to have been uploaded at all. > > Please could someone send me code and system configuratyion > details which has worked for them. > > Thanks and regards > > Warwick Chapman (Glenwood 1999) > http://www.boatrace.co.za > Assistant IT Manager > Glenwood High School, Durban, South Africa > 031 2055241 > 083 7797094 > http://www.glenwoodhighschool.co.za > > -- > 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] >
This is a way of doing it: $s = time() + 10; for ($i = time(); $i <= $s; $i++) { print $i; } Will run for about ten seconds... /Johan Brendan Gogarty wrote: > > hi, > just wondering if there was any easy way to break/escape from a loop > (for loop) if the loop exceeds a maximum time. > I realise that set_timeout applies to the whole script but i am just > interested in a sub function of the script. > > cheers! > brendan. > > -- > 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]
Johan Lundqvist wrote: > This is a way of doing it: > > $s = time() + 10; > for ($i = time(); $i <= $s; $i++) { > print $i; > } > > Will run for about ten seconds... Did you leave a bit of code out? In most cases, this will run for only a few milliseconds. :) Try something like this instead: $timeout = 1; // Timeout in seconds $start_time = time(); // Get the current time for ($x=0; $x < 1000000000; ++$x) { /* // Check if we have gone over the time limit // Only check every 1000 loops - this keeps // us from chewing run time by checking the time // all the time :) */ if ( (0 === ($x % 1000)) && (time () - $start_time) > $timeout) break; echo ($x, '<br>'); } --zak
U R right Zak, I'm a bit dizzy today, thanx.
> for ($x=0; $x < 1000000000; ++$x) { > > if ( (0 === ($x % 1000)) && (time () - $start_time) > $timeout) > break; > > echo ($x, '<br>'); > } I am a little bit conservative when it comes to use the break-statement, and the rule of thumb I uses is; any singular block should have one defined entry point an one defined exit point. A break statement will break that rule. According to this rule I would prefer to write it like: bTimeOut = false; for ($x=0; $x < 1000000000 && !bTimeOut; ++$x) { /* some statements what so ever.... */ if ( (0 === ($x % 1000)) && (time () - $start_time) > $timeout) { bTimeOut = true; } } Now the code have one entry point and one exit point. Also there is a small little extra bonus with this: it's quite clear from the style of the code what the intention to do is.
Hi, I have installed php with windows installer and i would like to add extensions but these ones doesn't work with my module so I would like to install php again. I would like to know where to put where the php.exe file is located. In the Personal Web Server I don't find the place and in the register too (in the previous automatic installation it wasn't put there). thanks Dalyyla
hi, I have pbs with sessions. I would like to know first how to do , (enable or disable) about sessions in the php.ini file while I don't want to use cookies on the client at all. I suppose I must put the id myself in each page. About this pint, I'd like to check something : if in my application I don't use the trans_id and put id in url's manually then if i publish my application on a server where trans_id is enabled. What would happen ? He would put it anyway ? Thanks Dalyyla
I have the following code in two files: First file: <center><H2>DELETE DOCUMENTS</H2> <FORM NAME=formul METHOD=POST ACTION='deleteFunction.php'> <TABLE NAME = fileTable border=5 cellspacing=3 cellpadding=3> <TR><TD colspan=0></TD><TH></TH><TH>FILE NAME</TH></TR> <?require ("commonftp.php"); echo "<br>"; $connId = ftpConnect(); $dir = ftp_pwd ($connId); $list=Array(); $list=ftp_nlist($connId, "$dir"); $i=0; $number = count($list); for ($i = 0; $i < $number; $i++) { $destinationFile = getFileName ($list[$i]); echo "<TR><TD colspan=0></TD><TH>";?> <INPUT TYPE=checkbox NAME=fileList VALUE='<?$destinationFile?>'> <? printf ("</TH><TH>%s</TH>", $destinationFile); /* echo $list[$i] . "<br>"; */ } ftpDisconnect ($connId); ?> </TABLE> <INPUT TYPE=hidden NAME=func> <p></p><INPUT TYPE=button NAME='delete' VALUE='DELETE' onClick='func.value=1; submit();'> <INPUT TYPE=button NAME='delete' VALUE='BACK' onClick='func.value=2; submit();'></center> </FORM> Second file: <? "php_track_vars"; require ("commonftp.php"); switch ($func) { case 1: $fileName = $HTTP_POST_VARS[$fileList]; echo $fileName; $connId = ftpConnect(); ftpDisconnect($connId); break; case 2: header ("Location: initSeminary.php"); break; } ?> but in $HTTP_POST_VARS i don´t get the values of the check boxes Here is the error. Warning: Undefined variable: fileList in e:\root\webapps\root\projektbueh\proyecto\deletefunction.php on line 18 Warning: Undefined index: in e:\root\webapps\root\projektbueh\proyecto\deletefunction.php on line 18 Can someone help me, please? gracias. _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Hi- I was using PHP on WinNT at my old job, when they closed I took this new job where everything is/was done in ASP 3.0. Now I have been told that I am welcome to explore other options--translation, I can use PHP again :) This db they have set-up does a ton of stored procedures and functions in SQL Server 2000. I am wondering if anyone knows--can PHP call a stored procedure or function from SQL Server? Can you point me to any examples? Thanks in advance. -sap
It sure can. example: $result = mssql_query("execute your_proc '$your_var', $another_var"); note that you will probably have to go with the CGI version under IIS as the ISAPI one is EXTREMELY unstable when used with MS SQL Server in my experience. Pavel ----- Original Message ----- From: "Scott" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, May 22, 2001 2:54 PM Subject: [PHP-WIN] SQL Server stored procedures and functions > Hi- > > I was using PHP on WinNT at my old job, when they closed I took this > new job where everything is/was done in ASP 3.0. Now I have been > told that I am welcome to explore other options--translation, I can > use PHP again :) > > This db they have set-up does a ton of stored procedures and functions > in SQL Server 2000. I am wondering if anyone knows--can PHP call a > stored procedure or function from SQL Server? Can you point me to any > examples? > > Thanks in advance. > > -sap > > > -- > 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'll back that up, I ended up having to reboot constantly to clear out a stalled IIS service. Two problems with stored procedures, no return value and no output parameters. You'll need to reformat all your procedures to have a SELECT statement return those values. I've been told that the 4.0.6 (as of yet unreleased) version has better support for stored procedures. You might want to grab it from CVS and compile before you go and modify a bunch of stuff on the SQL server. Here's an example I pulled from one of my pages, it could probably use some more error handing but it'll give you an easy place to start. $connection = mssql_connect(DB_SERVER, DB_USER, DB_PASS); mssql_select_db(DB_NAME); $query_result = mssql_query("EXEC p_delete_picture '$username', '$password', $pic_id;"); if ($query_result==FALSE) die("query failed"); $obj = mssql_fetch_object($query_result); if ($obj==FALSE) die("query failed"); //read out your return values mssql_free_result($query_result); mssql_close($connection); -----Original Message----- From: Pavel Kalian [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 22, 2001 06:01 To: [EMAIL PROTECTED]; Scott Subject: Re: [PHP-WIN] SQL Server stored procedures and functions It sure can. example: $result = mssql_query("execute your_proc '$your_var', $another_var"); note that you will probably have to go with the CGI version under IIS as the ISAPI one is EXTREMELY unstable when used with MS SQL Server in my experience. Pavel ----- Original Message ----- From: "Scott" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, May 22, 2001 2:54 PM Subject: [PHP-WIN] SQL Server stored procedures and functions > Hi- > > I was using PHP on WinNT at my old job, when they closed I took this > new job where everything is/was done in ASP 3.0. Now I have been > told that I am welcome to explore other options--translation, I can > use PHP again :) > > This db they have set-up does a ton of stored procedures and functions > in SQL Server 2000. I am wondering if anyone knows--can PHP call a > stored procedure or function from SQL Server? Can you point me to any > examples? > > Thanks in advance. > > -sap > > > -- > 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] > -- 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]
Situation: I'm using a DB query to bring back a list of values to populate a selection box on a form. I would like the user to be able to select multiple values. As it stands my code is only returning the last value selected. I plan to use the selected values to run more queries so I believe the best way to handle multiple values is to put them in an array and then run queries based on the array. That's the next stage How should I change this code to have $earnType return multiple values I'm guessing this is a mix of the html & php But I'm betting someone else has solved this already. Here's the code <!doctype html public "-//W3C//DTD HTML 4.0 //EN"> <html> <head> <title>OCFR List Page</title> </head> <body> <?php include("DB.inc"); if($earnType) { $ET = explode(":",$earnType); while ( list($key, $value) = each($ET)) print ("Key: $key, Value: $value <br>"); } Else { $db = odbc_connect($database, $login, $pwd); $cur = odbc_exec($db, "SELECT Distinct EARNTYPE FROM ISIDBA.ISI_CDB_OBJ_T Order by EARNTYPE"); $fields = odbc_num_fields($cur); $Outer=0; print "<tr>"; print "<form action=\"$PHP_SELF\" method = \"post\">"; print "<center>Please pick an Earn Type </center><br>"; print "<center><select name = \"earnType\" multiple size = \"10\">"; while( odbc_fetch_row( $cur )) { $Outer++; for($i=1; $i <= $fields; $i++) { printf("<option value = \"%s\">%s</option>", odbc_result( $cur, $i ), odbc_result( $cur, $i )); } } print "</table>"; print "</select></center>"; print "<br><center><input type = \"submit\" value = \"Submit\"></center>"; print "</tr>"; odbc_close( $db); } ?> </body> </html> -- Michael Kelley [EMAIL PROTECTED] Programmer/Systems Analyst I New Mexico State University Information and Communication Technologies Work # (505)-646-1374 P.O. Box 30001 MSC: 3AT Las Cruces, NM 88003
Hi Michael Try changing this line > printf("<option value = \"%s\">%s</option>", To printf("<option value = \"%s[]\">%s</option>", This should solve your problem HTH M@
Nope, output is now Key: 0, Value: ACL[] instead of Key: 0, Value: ACL Matt Williams wrote: > Hi Michael > > Try changing this line > > >> printf("<option value = \"%s\">%s</option>", > > > To > > printf("<option value = \"%s[]\">%s</option>", > > This should solve your problem > > HTH > > M@ -- Michael Kelley [EMAIL PROTECTED] Programmer/Systems Analyst I New Mexico State University Information and Communication Technologies Work # (505)-646-1374 P.O. Box 30001 MSC: 3AT Las Cruces, NM 88003
I tried the [] inside & outside the quotes, only difference was that inside gave me Key: 0, Value: ACL[] outside gave me Key: 0, Value: ACL Since we changed the %s to an array I changed the Explode statement and the while .... Got the message that $earnType not an array ..... Got an idea ...... hold on Michael Kelley wrote: > Nope, output is now > Key: 0, Value: ACL[] > instead of > Key: 0, Value: ACL > > > Matt Williams wrote: > >> Hi Michael >> >> Try changing this line >> >> >>> printf("<option value = \"%s\">%s</option>", >> >> >> >> To >> >> printf("<option value = \"%s[]\">%s</option>", >> >> This should solve your problem >> >> HTH >> >> M@ -- Michael Kelley [EMAIL PROTECTED] Programmer/Systems Analyst I New Mexico State University Information and Communication Technologies Work # (505)-646-1374 P.O. Box 30001 MSC: 3AT Las Cruces, NM 88003
I am not sure I get what it is you want to do.... >Situation: >I'm using a DB query to bring back a list of values to populate a >selection box on a form. I would like the user to be able to select >multiple values. I dont understand this. You can only select one item from a selct box(?). >As it stands my code is only returning the last value selected. So you wants to store them in a "history" array, then?? Is that what you want to do? Is that what you *need* to do? >I plan to use the selected values to run more queries so I believe the >best way to handle multiple values is to put them in an array and then >run queries based on the array. Why don't you uses check boxes or radiation buttons instead? It seams more proper to use them in this situation... or? >That's the next stage >How should I change this code to have $earnType return multiple values >I'm guessing this is a mix of the html & php But I'm betting someone >else has solved this already.
Hi Michael Sorry brain fade Try changing your selectname to earnType[] > print "<center><select name = \"earnType\" multiple size = \"10\">"; > print "<center><select name = \"earnType[]\" multiple size = \"10\">"; Also I don't know if that's all your code but there is some suspect html in there M@
Sorry Matt, That returns Key: 0, Value: Array If you don't mind, point out the suspect HTML Matt Williams wrote: > Hi Michael > > Sorry brain fade > > Try changing your selectname to earnType[] > > >> print "<center><select name = \"earnType\" multiple size = \"10\">"; > > >> print "<center><select name = \"earnType[]\" multiple size = \"10\">"; > > > Also I don't know if that's all your code but there is some suspect html in > there > > M@ -- Michael Kelley [EMAIL PROTECTED] Programmer/Systems Analyst I New Mexico State University Information and Communication Technologies Work # (505)-646-1374 P.O. Box 30001 MSC: 3AT Las Cruces, NM 88003
I think we can handle this by changing the element name before you submit the form. For example, you have a select box like: <select name=selTest> <option>Value1 <option>Value2 </select> before you submit the form, change the <select> tag name like this <script language=javascript> document.frmForm.selTest.name = "selTest[]"; </script> It worked for me with multiple check boxes. Vasu From: Michael Kelley <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: Re: [PHP-WIN] Multiple value selection box (mix php/html problem) returning only one value Date: Tue, 22 May 2001 12:20:16 -0600 Sorry Matt, That returns Key: 0, Value: Array If you don't mind, point out the suspect HTML Matt Williams wrote: >Hi Michael > >Sorry brain fade > >Try changing your selectname to earnType[] > > >>print "<center><select name = \"earnType\" multiple size = \"10\">"; > > >>print "<center><select name = \"earnType[]\" multiple size = \"10\">"; > > >Also I don't know if that's all your code but there is some suspect html in >there > >M@ -- Michael Kelley [EMAIL PROTECTED] Programmer/Systems Analyst I New Mexico State University Information and Communication Technologies Work # (505)-646-1374 P.O. Box 30001 MSC: 3AT Las Cruces, NM 88003 -- 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] _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
I'm not to clear on exactly what you meant. What I tried with your code was to add these lines print "</select></center>"; print "<script language=javascript>"; print " document.frmForm.earnType.name = \"earnType[]\" "; print "</script>"; prior to my submit button print "<br><center><input type = \"submit\" value =\"Submit\"></center>"; I still get a single value returned. Vasu Gokaraju wrote: > I think we can handle this by changing the element name before you > submit the form. > > For example, you have a select box like: > > <select name=selTest> > <option>Value1 > <option>Value2 > </select> > > before you submit the form, change the <select> tag name like this > > <script language=javascript> > document.frmForm.selTest.name = "selTest[]"; > </script> > > It worked for me with multiple check boxes. > > Vasu > > > > > From: Michael Kelley <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: Re: [PHP-WIN] Multiple value selection box (mix php/html > problem) returning only one value > Date: Tue, 22 May 2001 12:20:16 -0600 > > Sorry Matt, > That returns > Key: 0, Value: Array > > If you don't mind, point out the suspect HTML > > Matt Williams wrote: > >> Hi Michael >> >> Sorry brain fade >> >> Try changing your selectname to earnType[] >> >> >>> print "<center><select name = \"earnType\" multiple size = \"10\">"; >> >> >> >>> print "<center><select name = \"earnType[]\" multiple size = \"10\">"; >> >> >> >> Also I don't know if that's all your code but there is some suspect >> html in >> there >> >> M@ > > > > -- > > Michael Kelley > [EMAIL PROTECTED] > > Programmer/Systems Analyst I > New Mexico State University > Information and Communication Technologies > Work # (505)-646-1374 > P.O. Box 30001 > MSC: 3AT > Las Cruces, NM 88003 > > > > > > > -- > 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] > > > _________________________________________________________________________ > Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- Michael Kelley [EMAIL PROTECTED] Programmer/Systems Analyst I New Mexico State University Information and Communication Technologies Work # (505)-646-1374 P.O. Box 30001 MSC: 3AT Las Cruces, NM 88003
My idea NO WORK, I tried replacing the value = \"%s\" with versions of value = \"$earnType\"[] value = \"$earnType[]\" value = earnType[] value = $earnType[] Still not what I'm looking for Michael Kelley wrote: > I tried the [] inside & outside the quotes, only difference was that > inside gave me > Key: 0, Value: ACL[] > outside gave me > Key: 0, Value: ACL > > > Since we changed the %s to an array I changed the Explode statement and > the while .... Got the message that $earnType not an array ..... > Got an idea ...... hold on > -- Michael Kelley [EMAIL PROTECTED] Programmer/Systems Analyst I New Mexico State University Information and Communication Technologies Work # (505)-646-1374 P.O. Box 30001 MSC: 3AT Las Cruces, NM 88003 -- Michael Kelley [EMAIL PROTECTED] Programmer/Systems Analyst I New Mexico State University Information and Communication Technologies Work # (505)-646-1374 P.O. Box 30001 MSC: 3AT Las Cruces, NM 88003
I am fairly new to PHP and am right now writing my first complicated script. There is a lot of HTML in the page and I was wondering which method is faster. To always be inside the <?php ?> tags or to stop and start. Here is a quick example (not necessarily a good one) <?php $sql2 = "select ABBREV from STATES"; $result2 = OCIParse($conn,$sql2); OCIExecute($result2) or die("It's not possible to query"); ?> <select name=STATE > <?php while (OCIfetch($result2,1)) { ?> <option><?php echo OCIresult($result2,1)?> <?php } ?> </SELECT> OR <?php $sql2 = "select ABBREV from STATES"; $result2 = OCIParse($conn,$sql2); OCIExecute($result2) or die("It's not possible to query"); echo "<select name=STATE >"; while (OCIfetch($result2,1)) { echo "<option>"; echo OCIresult($result2,1) } echo "</SELECT>"; ?> Also which is faster print or echo. Thanks *---------*-----------*----------*---------*---------*---------*--------* Jerry Nelson Systems Analyst Datanamics, Inc. 973-C Russell Ave Gaithersburg, MD 20879 TEL: 301-948-3515
Aha, an ex-ASP programmer! I've heard that the stop and start is faster, but it really doesn't matter with PHP. In ASP its an issue because ASP does a context switch every time from HTML to the VBScript/JScript compiler. PHP doesn't do any context switches so there's no overhead to stop and start. Echo is probably faster as it's shorter :-) Regards, John "Jerry Nelson" <[EMAIL PROTECTED]> wrote in message 5.0.2.1.0.20010522124748.00a57ec0@dnmcinc">news:5.0.2.1.0.20010522124748.00a57ec0@dnmcinc... > I am fairly new to PHP and am right now writing my first complicated > script. There is a lot of HTML in the page and I was wondering which > method is faster. To always be inside the <?php ?> tags or to stop and > start. > Here is a quick example (not necessarily a good one) > <?php > $sql2 = "select ABBREV from STATES"; > $result2 = OCIParse($conn,$sql2); > OCIExecute($result2) or die("It's not possible to query"); > ?> > <select name=STATE > > <?php > while (OCIfetch($result2,1)) { > ?> > <option><?php echo OCIresult($result2,1)?> > <?php } ?> > </SELECT> > > OR > > <?php > $sql2 = "select ABBREV from STATES"; > $result2 = OCIParse($conn,$sql2); > OCIExecute($result2) or die("It's not possible to query"); > echo "<select name=STATE >"; > while (OCIfetch($result2,1)) { > echo "<option>"; > echo OCIresult($result2,1) > } > echo "</SELECT>"; > ?> > > Also which is faster print or echo. > Thanks > > *---------*-----------*----------*---------*---------*---------*--------* > Jerry Nelson > Systems Analyst > Datanamics, Inc. > 973-C Russell Ave > Gaithersburg, MD 20879 > TEL: 301-948-3515 > > > -- > 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] >
Svensson, B.A.T. wrote: > I am not sure I get what it is you want to do.... > > >> Situation: >> I'm using a DB query to bring back a list of values to populate a >> selection box on a form. I would like the user to be able to select >> multiple values. > > > I dont understand this. You can only select one item from a selct box(?). > HTML provides for a multivalue selection dropdown box > >> As it stands my code is only returning the last value selected. > > > So you wants to store them in a "history" array, then?? > Is that what you want to do? Is that what you *need* to do? Yeah this is my aim, but it's not a history array (easy) but a "selected" array (not getting it) > > >> I plan to use the selected values to run more queries so I believe the >> best way to handle multiple values is to put them in an array and then >> run queries based on the array. > > > Why don't you uses check boxes or radiation buttons instead? > It seams more proper to use them in this situation... or? > Because the first query returns around 45 distinct values. I'm trying to keep scrolling to a minimum (not to mention this is just a proof of concept. > >> That's the next stage >> How should I change this code to have $earnType return multiple values >> I'm guessing this is a mix of the html & php But I'm betting someone >> else has solved this already. -- Michael Kelley [EMAIL PROTECTED] Programmer/Systems Analyst I New Mexico State University Information and Communication Technologies Work # (505)-646-1374 P.O. Box 30001 MSC: 3AT Las Cruces, NM 88003
Hi, First of all. NEWBIE ALERT!...... For all those still here, I have a question. I currently have an NT server using Domino R5 as the web server. It is our production machine. I want to gradually get rid of it and use php and IIS (Apache later but have to use IIS to start.) Can I have both web servers running on the same machine? at the same time? For instance if I use the php 4.05 windows installer it will automatically configure IIS so how does that affect Domino web server and the current state of the website. I need to do some php testing before I can ditch Domino but don't want to mess up what I already have. I hope this makes sense. Any suggestions Thanks so much, Deb
You can only have one service listening to any TCP port at once, so you'd have to bind IIS to a different port number (say, 8080) than Domino R5; this is not difficult. Same is true for SSL (if Domino uses 443, then use another port for IIS https). There's no reason (assuming you have sufficient RAM and CPU) you can't run Apache in parallel as well, just bound to different port numbers. You could run IIS in stealth, only accessing it from your php scripts running on Apache - that way you could encapsulate ASP/VBS stuff and output it through a php script on the Apache httpd. Only problem is that IIS and Domino both are headaches to patch all of the security exploits and vulnerabilities! Whereas apache is much more secure. Never never never experiment on a production server. Always always always do stuff on a dev box first. I recommend installing on your dev box, then manually copy the files and registry keys from the dev box (to staging, then) to your live/production server. Cheers Monty > -----Original Message----- > From: Deborah Dennison [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, May 22, 2001 1:13 PM > To: [EMAIL PROTECTED] > Subject: [PHP-WIN] dual web servers? > > > Hi, > > First of all. NEWBIE ALERT!...... For all those still here, I have a > question. I currently have an NT server using Domino R5 as > the web server. > It is our production machine. I want to gradually get rid of > it and use php > and IIS (Apache later but have to use IIS to start.) > > Can I have both web servers running on the same machine? at > the same time? > For instance if I use the php 4.05 windows installer it will > automatically > configure IIS so how does that affect Domino web server and > the current > state of the website. I need to do some php testing before I can ditch > Domino > but don't want to mess up what I already have. > > I hope this makes sense. Any suggestions > > Thanks so much, > > Deb > > > -- > 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 want to try to fix the character truncation problem when using an mssql database, but I can't seem to figure out how to compile PHP under VC 6. I have searched all over the site for some insight into what to do, but I am still having problems creating/finding TSRM.mak. Any and all help would be apreciated. Brian P.S. The problem I refer to is that in the php_mssql.dll extension char and varchar are treated as chars, this limits the length of the string to 256 characters. But, the problem is that and nvarchar in MS SQL can be up to 4000 characters! So, I want to try to fix the problem in the dll, but it requires the php dll and so on.
Can't say I know what the problem is, but here are two test files, that work on my Windows 2000, IIS 5, SQL 7 machine. Let me know if you have a problem with them and maybe we can find the problem. Brian "Iván Milanez Castellanos" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]... > > Hi: I have sucsessfuly installed PHP on my Win2k/IIS5/SQL > Server 7 machine, and I moved an application that I had > developed in my computer that has Win ME/Apache/PHP/SQL > Server 7 to it. > > It all works fine except for one thing, I can't get the > setcookie() function to work on this server, in my > development machine it works fine and after having set the > cookie my home page changes to reflect the information, but > on the server when I call the form that sets the cookie > nothing happens, the file that sets the cookie is called, > all PHP code is parsed correctly, but the cookie doesn't get > set can anybody help on this one??? > > thanx > > Iván Milanez Castellanos > -------------------------------------------- > Si alla donde tu te encuentras > La luna brilla igual que aquí > Posa en ella tus ojos un momento > Y tan solo un momento piensa en mi > > > _________________________________________________________________ > El correo GRATUITO en tu idioma y con múltiples beneficios. > Obtén tu CorreoWeb del Foco ahora en http://elfoco.correoweb.com > > > -- > 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] > begin 666 SetCookie.php M/#\*"21->4-O;VMI92 ](")#;V]K:64@<V5T('-U8V-E<W-F=6QL>2(["B @ M("!S971C;V]K:64H(")->4-O;VMI92(L("1->4-O;VMI92D["C\^"CQ(5$U, M/@H\2$5!1#X*/&UE=&$@3F%M93TB9V5N97)A=&]R(B!C;VYT96YT/2)02%!% M9" R+C,N,R(^"CQT:71L93X\+W1I=&QE/@H\;&EN:R!R96P](E-(3U)40U54 M($E#3TXB("!H<F5F/2(O<&%T:"UT;RUI8V\M9FEL92]L;V=O+FEC;R(^"CPO M2$5!1#X*/$)/1%D^"CQ!(&AR968](D=E=$-O;VMI92YP:' B/D=E="!#;V]K 7:64\+T$^"CPO0D]$63X*/"](5$U,/@H` ` end begin 666 GetCookie.php M/$A434P^"CQ(14%$/@H\;65T82!.86UE/2)G96YE<F%T;W(B(&-O;G1E;G0] M(E!(4$5D(#(N,RXS(CX*/'1I=&QE/CPO=&ET;&4^"CQL:6YK(')E;#TB4TA/ M4E1#550@24-/3B(@(&AR968](B]P871H+71O+6EC;RUF:6QE+VQO9V\N:6-O M(CX*/"](14%$/@H\0D]$63X*/#\*"65C:&\@(E!(4"!I<R!W;W)K:6YG/$)2 M/EQN(CL*(" @(&5C:&\@(DUY0V]O:VEE(#T@)$UY0V]O:VEE/$)2/EQN(CL* ;/SX*/"]"3T19/@H\+T)/1%D^"CPO2%1-3#X* ` end