[PHP] time question
How do I get the current time() for Central European Time (= GMT +01:00). I want it to work wherever the server stands. How can I get the difference between server time and GMT, for instance? A. Nawroth -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] include_once()
Have you put ?php tags in your include-files? Anders - Ursprungligt meddelande - Från: Mauricio Cuenca [EMAIL PROTECTED] Till: [EMAIL PROTECTED] Skickat: den 19 mars 2002 17:43 Ämne: [PHP] include_once() Hello, I have a very long script with several functions in it. I wanted to split the script into several files, so I created two sub-scripts and one main script. This is the code from the main script: ?php include_once(sub_script_1.php); incude_once(sub_script_2.php); $temp = MyFunction(); ? MyFunction() is contained in the file sub_script_1.php which is properly enclosed with valid PHP start and end tags. But When I try to run the main script, I get this error: Fatal error: Call to undefined function: MyFunction()in /main_script.php on line 4. How can I properly divide my script into several ones ??? TIA, __ Mauricio Cuenca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Targetted redirection?
I use this code to break out of frames: if (top.frames.length!=0) top.location=self.document.location; Put this code in the head section between script tags. If the document isn't on top, it soon will be. (This solution slows the loading of the page a bit, the browser will have to go thru the page once more, I think.) Anders - Ursprungligt meddelande - Från: Brinkman, Theodore [EMAIL PROTECTED] Till: PHP List [EMAIL PROTECTED] Skickat: den 15 mars 2002 17:27 Ämne: RE: [PHP] Targetted redirection? OK, If I understand correctly, the following scenario would work? Given: My site is being brought up inside somebody else's (say about.com)frameset. [We'll call this page about.html] Given: I want my main page (index.html) to break out of the frames in the about.html page. Solution: My main page (index.html) should send header('Window-target: _Top'); So, if I use frames, and I want to keep my frameset page out of someone else's frame, I should send that header for my frameset page? Is this correct? - Theo -Original Message- From: Analysis Solutions [mailto:[EMAIL PROTECTED]] Sent: Friday, March 15, 2002 10:27 AM To: PHP List Subject: Re: [PHP] Targetted redirection? Hi Folks: Okay, here's what I'm talking about... A sample system. Four files. index.php main page holding the frameset. frameset has two frames. one on left. one on right. left.php navigation menu that goes in the left hand frame right.php content in right hand frame. this page is the default one that comes up in the initial frameset. right2.phpanother page for the right hand frame * index.php ** ?php # This has no effect. # header('Window-target: _top'); ? html headtitleindex page/title/head frameset COLS=120,* FRAME SRC=left.php name=menu scrolling=no frame src=right.php name=content /frameset /html * left.php ** ?php # Turning this on will jump this page out of the frames. # header('Window-target: _top'); ? htmlheadtitlethe menu/title/headbody a href=right.php target=contentright/a br /a href=right2.php target=contentright 2/a /body/html * right.php ** ?php # Turning this on will jump this page out of the frames. # header('Window-target: _top'); ? HTMLHEADTITLERight/TITLE/HEADBODY Hi there. This is the main content page in the right frame. /BODY/HTML * right2.php ** ?php # This has no effect. # header('Window-target: _top'); ? HTMLHEADTITLERight 2/TITLE/HEADBODY Hi there. This is the secondary content page in the right frame. /BODY/HTML Now, put all those files on your machine. Hit index.php and you'll see everything normally. Then, uncomment the header function in left.php or right.php and you'll see that page jump out of the frames. But, turn the header on in index.php or index2.php and you'll still be in the frames. Enjoy, --Dan -- PHP scripts that make your job easier http://www.analysisandsolutions.com/code/ SQL Solution | Layout Solution | Form Solution T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Web Hosts and PHP 4.10 +
From phpinfo at Aleita.com: PHP Version 4.1.0 System Linux cobra.nocdns.com 2.4.7-10smp #1 SMP Thu Sep 6 17:09:31 EDT 2001 i686 unknown Build Date Dec 15 2001 Configure Command './configure' '--with-apache=../apache_1.3.22' '--with-mysql' '--with-gd' '--with-freetype' '--enable-track-vars' '--with-jpeg-dir=/usr' '--enable-ftp' '--enable-sockets' '--with-openssl=/usr' '--with-sysvshm' '--with-sysvsem' '--enable-i18n' '--enable-mbregex' '--with-imap' '--with-curl=/usr/local' '--with-kerberos=/usr/kerberos' '--with-zlib' '--with-ttf' Server API Apache But it still can be different on other machines at Aletia, I don't know. Anders - Ursprungligt meddelande - Från: Neil Freeman [EMAIL PROTECTED] Till: Edward Marczak [EMAIL PROTECTED] Kopia: [EMAIL PROTECTED] Skickat: den 8 februari 2002 12:04 Ämne: Re: [PHP] Web Hosts and PHP 4.10 + I have a feeling that www.aletia.com use 4.1.1 Don't quote me on that though :) Neil Edward Marczak wrote: I know the subject of web hosts that support PHP comes up frequently - but here's a twist: After going through the archives, and checking out many, many hosts, I haven't found a web host that is up to PHP 4.10 or better. Most seem stuck at 4.04 or, at best, 4.06. Since 4.10 made some important changes/improvments, (and most of my code already takes advantage of this), I'd like to find a host supporting 4.10 and MySQL. I understand I could run a dedicated server, but I'm trying to save that as a last resort right now. Any recommendations? Thanks. -- Ed Marczak [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php *** This message was virus checked with: SAVI 3.53 Jan 2002 last updated 30th January 2002 *** -- Email: [EMAIL PROTECTED] [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Web Hosts and PHP 4.10 +
Sorry, should spell aletia.com From phpinfo at Aleita.com: PHP Version 4.1.0 System Linux cobra.nocdns.com 2.4.7-10smp #1 SMP Thu Sep 6 17:09:31 EDT 2001 i686 unknown Build Date Dec 15 2001 Configure Command './configure' '--with-apache=../apache_1.3.22' '--with-mysql' '--with-gd' '--with-freetype' '--enable-track-vars' '--with-jpeg-dir=/usr' '--enable-ftp' '--enable-sockets' '--with-openssl=/usr' '--with-sysvshm' '--with-sysvsem' '--enable-i18n' '--enable-mbregex' '--with-imap' '--with-curl=/usr/local' '--with-kerberos=/usr/kerberos' '--with-zlib' '--with-ttf' Server API Apache But it still can be different on other machines at Aletia, I don't know. Anders - Ursprungligt meddelande - Från: Neil Freeman [EMAIL PROTECTED] Till: Edward Marczak [EMAIL PROTECTED] Kopia: [EMAIL PROTECTED] Skickat: den 8 februari 2002 12:04 Ämne: Re: [PHP] Web Hosts and PHP 4.10 + I have a feeling that www.aletia.com use 4.1.1 Don't quote me on that though :) Neil Edward Marczak wrote: I know the subject of web hosts that support PHP comes up frequently - but here's a twist: After going through the archives, and checking out many, many hosts, I haven't found a web host that is up to PHP 4.10 or better. Most seem stuck at 4.04 or, at best, 4.06. Since 4.10 made some important changes/improvments, (and most of my code already takes advantage of this), I'd like to find a host supporting 4.10 and MySQL. I understand I could run a dedicated server, but I'm trying to save that as a last resort right now. Any recommendations? Thanks. -- Ed Marczak [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php *** This message was virus checked with: SAVI 3.53 Jan 2002 last updated 30th January 2002 *** -- Email: [EMAIL PROTECTED] [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] While on array?
ie - i have: while($myrow=mysql_fetch_array($result)) { etc... But i want the loop to run with an array i created earlier ($anotherarray = [key1] = value1, [key2] = value2). use foreach($anotherarray as $key = $value) { . A Nawroth -- 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]
SV: [PHP] Matching strings in a flat/text file?
Why not use RegEx? I'm doing a similar search with RegEx. Makes the code much shorter. Anders Nawroth www.nawroth.com - Ursprungligt meddelande - Från: Jack Dempsey [EMAIL PROTECTED] Till: [EMAIL PROTECTED]; Nick Richardson [EMAIL PROTECTED] Skickat: den 23 oktober 2001 07:20 Ämne: RE: [PHP] Matching strings in a flat/text file? lots of ideas nick, but can you use a database? MySQL is free and i've found its almost always better to use databases when you can... if you can't, you could do something like this: 1. find the pos of the string you need using strpos 2. find the pos of the ending delimiter 3. substr from the first pos to the end (you'll need to add/subtract some strlen's to slice off the delimiters as well... jack -Original Message- From: Nick Richardson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 23, 2001 1:10 AM To: [EMAIL PROTECTED] Subject: [PHP] Matching strings in a flat/text file? Hey everyone, Anyone out there know how i could do this: I have a client who is an import car tuner. They would like to feature the cars they work on in their website. Instead of creating a new .html or .php file for every car they add to include the background setup, and the general content (type of car, owner, etc...) i want to put the information in to text file and search for it in there. So that's where i need help. I want to be able to put the info into a text file and pass the string to search for through the URL, then match everything between that line and an ending line in the text file, and print that out to the browser. Example: I want to pass a string using the URL (blah.php?car=civic_si) then search for ##civic_si in the text file, and print everything until it finds ##end. So the text file will look like this: ##civic_si This is my content, blah blah ##end ##nissan This is more content... yadda yadda ##end Any ideas on how i can do this??? //Nick Richardson [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] -- 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] PHP/MySQL speed
I'm running win98 / apache 1.3.20 / php 4.0.6 / MySQL 3.23.38 Just doing mysql_connect('localhost', 'foo', 'bar'); mysql_select_db('xyz'); is 0.06 second. Is this normal?? My queries take 0.01 second or less, that works fine. But why is the connect so slow? Anders www.nawroth.com -- 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]
SV: [PHP] HTML table creation software
I use some rather complex table layouts. I make them with modular programming. Every function that produces a TABLE also produces a /TABLE. And such a function maybe calls another function that also puts a table inside the HTML. And so on ... That way I can keep track on what's happening! Sometimes I also put comments in the HTML to see what actually happens, to find errors in my code. Anders webmaster www.bibbi.nawroth.com - Ursprungligt meddelande - Från: Seb Frost [EMAIL PROTECTED] Till: [EMAIL PROTECTED] Skickat: den 6 september 2001 19:05 Ämne: [PHP] HTML table creation software I expect I'll get flamed for being off topic but never mind. I'm fine with creating simple tables and stuff - even nested a couple of levels. But there's so many sites these days with super-complex table layouts. How are these created? Is it just some super-talented table guru who codes the lot in notepad, or is there a bit of software (like Frontpage but obviously NOT frontpage) that aids their creation significantly? Frontpage is poo. - seb --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.274 / Virus Database: 144 - Release Date: 23/08/2001 -- 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]
SV: [PHP] Re: The future of PHP - accessory libraries
installation for the other 400 customers using the server. Then they have to take the server down to install the new build. Is it any wonder that they just say no? I have to go with the (few) extensions/librarys provided by my ISP. If you don't run your own server, that's how it works with most ISPs, I think. Some ISP don't even run PHP4, they still use PHP3. If you don't agree that this is a major issue that needs to be addressed, I fear for the future of PHP. I agree 100%. Anders Nawroth - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [EMAIL PROTECTED] http://www.nawroth.com/ -- 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]