[PHP] equivalent of qw?
Hi all, I often find myself creating long arrays like so $a = array( a b c d e f r foo bar etc ... ); is there an easy way I don't know about to quote those vars? Basically just looking for an easier way to make such an array without adding teh quotes and commas, something like perl's qw. Thanks! Jack Dempsey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP 4.1.0 patch for Quanta IDE, The Sequel
really? ? $THIS_IS_A_VARIABLE=1; $this_is_a_variable=2; echo $THIS_IS_A_VARIABLE\n; echo $this_is_a_variable\n; ? seems sensitive to me... Mike Eheler wrote: Cool, however PHP is not case sensitive, nor is ASP or HTML for that matter, therefore case sensitive syntax highlighting will not be good for these languages. Mike J Smith wrote: I sumbitted a similar patch to the Quanta team about a week ago. It may appear in an upcoming release, possibly Quanta 3, which will come with KDE 3.0. A few other additions I made: - highlighting is now case-insensitive for everything. I believe older versions were case-sensitive for keywords, like function, class, etc. - support for ASP-style opening and closing tags (% and % instead of ?php, ?, etc.) I'm also working on porting a newer editor from Kate/ktexteditor into Quanta. It's been slow going, but things have picked up (it compiles and runs now, albeit with a bunch of segfaults). This will make adding syntax highlighting instructions much easier, as the latest versions of Kate allow you to define highlighting rules in XML files, and the highlighting instructions are set up at run-time rather than compile time. Maybe over the XMas break I'll be able to finish it up. J Mike Eheler wrote: http://sourceforge.net/tracker/index.php?func=detailaid=495239group_id=4113atid=304113 Download the attached file, and run patch -p1 -i quanta-2.0.1-php-4.1.0.diff That will patch your source tree.. then just configure, make, install. I've actually tested this one, so go nuts people. :) Please let me know if you find any functions that should be keywords or keywords that shouldn't be keywords, or functions/keywords that just plain aren't in the list. Mike -- 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]
RE: [PHP] preg_grep() and limit parameter
only thing i could think up would be if a user is dealing with huge amounts of text and only needs to have the first ten returned, returning/continuing past that would be wastefulnot confident on how often this would really happen and what the actual difference would be... Jack -Original Message- From: Andrei Zmievski [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 18, 2001 12:40 PM To: [EMAIL PROTECTED] Subject: [PHP] preg_grep() and limit parameter Does anyone see a need for a limit parameter to preg_grep() that would limit the number of array entries returned? -Andrei * My wishlist: http://www.amazon.com/exec/obidos/wishlist/2Q2DIPY7BZLSH/ * -- 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]
RE: [PHP] php htpasswd
not sure i follow...you open it with php do whatever you need and close it...its just a text file... -Original Message- From: jtjohnston [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 18, 2001 1:00 PM To: [EMAIL PROTECTED] Subject: [PHP] php htpasswd I'm sure question has been asked. How can I edit a htpasswd (apache) file using a php script? Does anyone have a piece of code? I would like to see the crypted passwords, but will live without. Thanks, J -- 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]
Re: [PHP] PHP 4.10: any way to override register_globals = OFF
a quick and inelegant hack 4.1 includes an array that has all of the data sent to the script...(or use the different ones like $_GET etc if need be) then write a globalize function that extracts the vars and declares them global...then use this snippet in an auto_prepend file to magically register the vars there's probably a much easier way, including asking your hosting provider to change one little config var... jack Michael Jurgens wrote: Hi, Now that register_globals is (or will be) OFF by default (just like error_reporting) I'm facing a huge rewrite of existing code if my hosting provider decides that he wants to upgrade his php (and believe me, he will use default settings) Is there any way to override register_globals and error_reporing runtime in your PHP script? (there is no way that I can use .htaccess to override :-(( Any help would be much appreciated! -- 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]
RE: [PHP] PHP 4.10: any way to override register_globals = OFF
exactly...in the function you'd have to extract the variables then globalize them... or you could loop through the arrays and store the keys and values in the globals array...that loop should be simple... jack -Original Message- From: Richard Heyes [mailto:[EMAIL PROTECTED]] Sent: Monday, December 17, 2001 4:54 PM To: Jack Dempsey; Michael Jurgens Cc: [EMAIL PROTECTED] Subject: RE: [PHP] PHP 4.10: any way to override register_globals = OFF a quick and inelegant hack 4.1 includes an array that has all of the data sent to the script...(or use the different ones like $_GET etc if need be) then write a globalize function that extracts the vars and declares them global...then use this Or use extract(). -- Richard Heyes If you have any trouble sounding condescending, find a Unix user to show you how it's done. - Scott Adams -- 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]
RE: [PHP] Newsgroups????
a preventative measure against spamAFAIK you don't actually have to sign up for the e-mail list, you just need to give an e-mail address to prove you're not a spammer. jack -Original Message- From: Eddie Shipman [mailto:[EMAIL PROTECTED]] Sent: Monday, December 17, 2001 5:23 PM To: [EMAIL PROTECTED] Subject: [PHP] Newsgroups Just signed up for the mailing list because I couldn't access the newsgroups, what's going on there? __ Do You Yahoo!? Check out Yahoo! Shopping and Yahoo! Auctions for all of your unique holiday gifts! Buy at http://shopping.yahoo.com or bid at http://auctions.yahoo.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] -- 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]
RE: [PHP] PHP 4.10: any way to override register_globals = OFF
i understand that, but if he extracts inside a function, those variables will be in that scope. if his auto_prepend file is simply 'extract($_GET)' then that'd be fine as well jack -Original Message- From: Charles Williams [mailto:[EMAIL PROTECTED]] Sent: Monday, December 17, 2001 5:59 PM To: Jack Dempsey; Michael Jurgens Cc: [EMAIL PROTECTED] Subject: Re: [PHP] PHP 4.10: any way to override register_globals = OFF Jack $_GET is automatically global to all scopes. No need to globalize. chuck - Original Message - From: Jack Dempsey [EMAIL PROTECTED] To: Michael Jurgens [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Monday, December 17, 2001 10:49 PM Subject: Re: [PHP] PHP 4.10: any way to override register_globals = OFF a quick and inelegant hack 4.1 includes an array that has all of the data sent to the script...(or use the different ones like $_GET etc if need be) then write a globalize function that extracts the vars and declares them global...then use this snippet in an auto_prepend file to magically register the vars there's probably a much easier way, including asking your hosting provider to change one little config var... jack Michael Jurgens wrote: Hi, Now that register_globals is (or will be) OFF by default (just like error_reporting) I'm facing a huge rewrite of existing code if my hosting provider decides that he wants to upgrade his php (and believe me, he will use default settings) Is there any way to override register_globals and error_reporing runtime in your PHP script? (there is no way that I can use .htaccess to override :-(( Any help would be much appreciated! -- 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 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]
RE: [PHP] htaccess problems
i don't think you want that space inbetween private/ and .htpasswd -Original Message- From: Jeremiah Jester [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 18, 2001 12:38 AM To: Php-General Subject: [PHP] htaccess problems I cant seem to get my htaccess file to work. Can anyone help? Heres what i have now: AuthUserFile /var/www/html/private/ .htpasswd AuthGroupFile /dev/null AuthName PrivateDomain AuthType Basic Limit GET require valid-user /Limit I then type 'htpasswd -c .htpasswd myusername' and then set password. Everything seems to be in order but i'm not prompted for user name and passwd when i try to access protected area via the web? Both htaccess and htpasswd files are in 'private' directory. Permission on secure folder is 755. Is that right? What about permissions for htaccess and htpasswd files? Do I have to enable htaccess ability through apache first through httpd.conf? Can anyone help? Thansk, JJ -- 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]
Re: [PHP] now who can help me about cach my query every certain time:(
Alawi wrote: now who can help me about cach my query every certain time:( I mean the first user requst the page and php will run query for this first time after that I want other user to have the result that the first user have it !! untill the ten minutes end I want the query to run again this advantge is available in asp and JSP ColdFusion but not available in PHP why ? it is possible...search google for php cache -- 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]
Re: [PHP] Problem with Code
1. http://www.php.net/ChangeLog-4.php 2. and yes, you have to specify the exact filename...your issue is that include_once is not a function in php3, if that code is infact from a php3 file... Phillip B. Bruce wrote: Hi, I have a couple of questions before I get to my problem. 1. Is there any documentation that explains the differences between the versions of PHP? 2. Does it matter when writing php code that you specifiy the file name in the following manner? test.php3 test.php4 or whatever. I'm assumming this is version specific. My Problem: I have the following code: # more headlines* ?php include include_fns.php3; include header.php3; $conn = db_connect(); $pages_sql = select * from pages order by code; $pages_result = mysql_query($pages_sql, $conn); while ($pages = mysql_fetch_array($pages_result)) { $story_sql = select * from stories where page = '$pages[code]' and published is not null order by published desc; $story_result = mysql_query($story_sql, $conn); if (mysql_num_rows($story_result)) { $story = mysql_fetch_array($story_result); print TABLE BORDER=0 WIDTH=400; print TR; print TD ROWSPAN=2 WIDTH=100; if ($story[picture]) print IMG SRC=\resize_image.php?image=$story[picture]\; print /TD; print TD; print H3$pages[description]/H3; print $story[headline]; print /TD; print /TR; print TRTD ALIGN=RIGHT; print A HREF=\page.php3?page=$pages[code]\; print FONT SIZE=1Read more $pages[code] .../FONT; print /A; print /TABLE; } } include footer.php3; ? # I have the following error: Fatal error: Call to unsupported or undefined function include_once() in include_fns.php3 on line 7 It seems to me that include_once is a legal function but I can't the orgination of this funtion other than that stupid include_fns.php3 file? Any ideas on this. Configuration: OS: Solaris 2.8 10/00 on Intel Hardware. Apache: 1.3.9 PHP: 3.0.15 mysql: 3.23.46 My ISP is running: OS: Irix 6.4 Apache: 1.3.9 PHP: 3.0.9 mysql: 3.22.23b I do appreciate any help on this. -- *** Phillip B. Bruce *** *** http://pbbruce.home.mindspring.com *** *** [EMAIL PROTECTED] *** *** *** *** Have you ever noticed? Anybody going slower than*** *** you is an idiot, and anyone going faster than you*** *** is a maniac. - George Carlin*** -- 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]
Re: [PHP] Brain dead - need help!
use a phpinfo() in one of your pages...that'll show you various places to get your data... btw, php does have the $HTTP_GET_VARS that'll have what you want... jack Gaylen Fraley wrote: I know that I know the answer - it's just buried in the recesses of my mind .. PHP has the various $HTTP_*_VARS arrays. Is there one to get the formliteral pairs from the hyperlinks, as in a href=somepage.php?var1=test? I want to extract the $var1 value pair. I know I can do this through javascript, but I want somepage.php to parse and use the variable/value. If there is not an array, then what is the simplest way? Thanks! -- Gaylen [EMAIL PROTECTED] Home http://www.gaylenandmargie.com/ PHP KISGB v2.6 Guest Book http://www.gaylenandmargie.com/phpwebsite/ -- 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]
Re: [PHP] connect to a file outside the web space.
how exactly do you want to connect to it? if you want to link to it in html, then it must be under the html doc root...if you're including, then you can specifiy the path... Webleycity wrote: Hello All If one creates a file outside the web space on a server. How doe's one connect to this from a HTML or PHP page? As I understand it. It is not as simple as normal html link. --- Mark Webley Multimedia design and development WebleyCity Limited London United Kingdom [EMAIL PROTECTED] [EMAIL PROTECTED] Mobile: 07980 213 627 Fax/Tel: 0208 678 1721 Pager 07654 581816 http://www.webleycity.co.uk --- From: Webleycity [EMAIL PROTECTED] Date: Sat, 15 Dec 2001 21:44:22 + To: James Stewart [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: Re: [PHP] Need high bandwidth provider for my Asian community site What bandwidth would you like? | Website design and hosting. | | Your free website trial including design and webspace, contact: | [EMAIL PROTECTED] Visit: http://www.webleycity.co.uk/offers --- WEBLEYCITY CAN DESIGN YOUR WEBSITE TO YOUR EXISTING CORPORATE IDENTITY OR CREATE ONE FOR YOU --- Mark Webley Multimedia design and development WebleyCity Limited London United Kingdom [EMAIL PROTECTED] [EMAIL PROTECTED] Mobile: 07980 213 627 Fax/Tel: 0208 678 1721 Pager 07654 581816 http://www.webleycity.co.uk --- From: James Stewart [EMAIL PROTECTED] Date: Thu, 13 Dec 2001 18:34:31 + To: [EMAIL PROTECTED] Subject: Re: [PHP] Need high bandwidth provider for my Asian community site On Thursday, December 13, 2001, at 06:14 PM, l0t3k wrote: Sunny, AFAICR, br / is for Netscrape, which apparently cant understand br/ for some reason.. It's not a browser thing... br / is the correct syntax for a line break in XHTML. All tags must be closed, hence the / and the white space is necessary to separate the element name from its closure. All major browsers will recognise br but if you want to be XHTML compliant, br / should be used. James. -- James Stewart http://www.britlinks.co.uk -- 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 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]
RE: [PHP] Can i do this?
didn't check your code specifically, but you can definitely have arrays nested inside of arrays...to see how to print them out use something like print_r to look at the structure... -Original Message- From: Daniel Alsén [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 13, 2001 10:12 AM To: PHP Subject: [PHP] Can i do this? Hi, can i do this? $num_vals = array (); for ($i=0; $i10; $i++) { $shot_count = SELECT COUNT(*) FROM statistik WHERE shooter='$shooter_login' shot_one = '$i' || shooter='$shooter_login' shot_two = '$i' || shooter='$shooter_login' shot_three = '$i' || shooter='$shooter_login' shot_four = '$i' || shooter='$shooter_login' shot_five = '$i'; $result = mysql_query($shot_count); $num_vals[$i] = mysql_fetch_array($result); } I guess it´s the last row that is troubling - getting an array into an array. If the code is good - how do i echo the results? # Daniel Alsén| www.mindbash.com # # [EMAIL PROTECTED] | +46 704 86 14 92 # # ICQ: 63006462 | +46 8 694 82 22 # # PGP: http://www.mindbash.com/pgp/ # -- 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]
RE: [PHP] The peacock logo... and others...
True...guess everyone's forgotten the ol' pocket manual... Any chance a new edition will come out? -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 13, 2001 2:30 PM To: Philip Hallstrom Cc: [EMAIL PROTECTED] Subject: Re: [PHP] The peacock logo... and others... The O'Reilly animal for PHP is a cuckoo bird. On Thu, 13 Dec 2001, Philip Hallstrom wrote: Not to throw a wrench into the plans and it's not clear that it really matters, but O'Reilly uses a peacock for an XML book. http://www.oreilly.com/catalog/xmlnut/ and a pelican for this book. http://www.oreilly.com/catalog/webclient/ I suspect that most animals are probably being used by oreilly... whether that matters I'll leave up to someone else :) -philip -- 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]
RE: [PHP] The peacock logo... and others...
Oh great, I didn't realize there was full book in the making...any ideas on when the full book will be hitting the shelfs? -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 13, 2001 2:39 PM To: Jack Dempsey Cc: [EMAIL PROTECTED] Subject: RE: [PHP] The peacock logo... and others... The full book will have the same bird on the cover. I'd like to do a new edition of the pocket reference. (and yes, I will try to get them to not remove the index this time), but O'Reilly wants to get the full book out before they'll let me do another quick reference. -Rasmus On Thu, 13 Dec 2001, Jack Dempsey wrote: True...guess everyone's forgotten the ol' pocket manual... Any chance a new edition will come out? -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 13, 2001 2:30 PM To: Philip Hallstrom Cc: [EMAIL PROTECTED] Subject: Re: [PHP] The peacock logo... and others... The O'Reilly animal for PHP is a cuckoo bird. On Thu, 13 Dec 2001, Philip Hallstrom wrote: Not to throw a wrench into the plans and it's not clear that it really matters, but O'Reilly uses a peacock for an XML book. http://www.oreilly.com/catalog/xmlnut/ and a pelican for this book. http://www.oreilly.com/catalog/webclient/ I suspect that most animals are probably being used by oreilly... whether that matters I'll leave up to someone else :) -philip -- 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]
Re: [PHP] Countdown clock?, X days till christmas
not sure why and how you need mysql for this...why not just do the date calculation in php? Webleycity wrote: Hello all is it possible to do an interactive countdown clock in MYsql that can be embeded in emails. --- Mark Webley Multimedia design and development WebleyCity Limited London United Kingdom [EMAIL PROTECTED] [EMAIL PROTECTED] Mobile: 07980 213 627 Fax/Tel: 0208 678 1721 Pager 07654 581816 http://www.webleycity.co.uk --- From: Mehmet Kamil ERISEN [EMAIL PROTECTED] Date: Wed, 12 Dec 2001 14:25:24 -0800 (PST) To: [EMAIL PROTECTED] [EMAIL PROTECTED] Subject: Re: [PHP] Date what's your raw data. I mean, what is the value of $row[mydatafield]; --- Max [EMAIL PROTECTED] wrote: Hi to all, I'm using this to get date from mySQL database: ... $p_datum = $row[mydatefield]; $mydate = getdate($p_datum); $month = $mydate['month']; $mday = $mydate['mday']; $year = $mydate['year']; ..but I allways get 1/1/1970. Can anybody help me? -- 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] = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Check out Yahoo! Shopping and Yahoo! Auctions for all of your unique holiday gifts! Buy at http://shopping.yahoo.com or bid at http://auctions.yahoo.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] -- 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]
Re: [PHP] echo vs. print() performance?
not as a criticism, but this is among the top 10 questions asked ...or used to be for a while...anyway, there's tons of info on the mailing lists, marc.theaimsgroup.com the short answer is that echo is SLIGHTLY faster being a language construct rather than a function...then again, i believe i remember someone proving the opposite...in general, you'll never notice a differenece between the two... Jon Niola wrote: Someone on this list once mentioned a performance difference between using echo and print(). Is there any evidence to back this up? I am really curious to see if it would make a difference to use one over the other. --Jon -- 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]
RE: [PHP] Another piece of history, kind of
but then again, as things look now, PHP 4.x isn't likely to happen within a foreseeable time range, if at all. its good be wrong sometimes :-) -Original Message- From: Andrei Zmievski [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 12, 2001 10:20 PM To: [EMAIL PROTECTED] Subject: [PHP] Another piece of history, kind of http://marc.theaimsgroup.com/?l=php-generalm=90719202212123w=2 -Andrei -- 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]
RE: [PHP] RegEx gurus help...
from the way you describe, i can't help but think that it'd be one hell of a regex.if all you're doing is stripping out .. i'd load up your fav editor and do a search and replace where you can approve each changeor, just change them all and fix what's broken.it'll be much quicker than trying to write a regex for all of that -Original Message- From: Brian V Bonini [mailto:[EMAIL PROTECTED]] Sent: Monday, December 10, 2001 9:22 AM To: PHP Lists Subject: [PHP] RegEx gurus help... I need to replace all relative links in an html doc with absolute links on the fly weather it be an image link, img src='/_imgs/imgs_nav/transPix.gif' width='10' height='13' img src='../_imgs/imgs_nav/transPix.gif' width='10' height='13' a URL, a href=/dealers/index.asp a link to an external JS file script language='JavaScript' src='/_js/scripts.js' type='text/javascript'/script or external css file. link rel=stylesheet href=../_css/style.css type=text/css Anyone done this before and have a prefab regex laying around they want to share? -Brian -- 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]
RE: [PHP] Running WML (WAP services) under PHP
i think that php sends out headers showing that the page is html.not sure bout this, but you might have to send a diff header.. -Original Message- From: M [mailto:[EMAIL PROTECTED]] Sent: Sunday, December 09, 2001 5:08 PM To: [EMAIL PROTECTED] Subject: [PHP] Running WML (WAP services) under PHP Hello, I am trying to develop some WML apps using PHP. To run WML apps into my local Apache (win98) server, I added AddType application/x-httpd-php .wml into httpd.conf. This works ok when calling directly from netscape http://localhost/mywml.wml , treating script like a true PHP program. BUT when writing a REAL WML app. (cards and so) and trying to run on NOKIA simulator (by calling URL), it shows a parse error on line 1 (for all scripts). The same script, when executed in file mode on NOKIA sim (that is first load .wml file and then press SHOW button) , works fine, proving the error is not in script, but in way PHP interpret .WML pages. I suspect PHP introduces some invisible code (just 1 byte?) or something at beginning of .WML page. Thanks for your attn. Miguel -- 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]
RE: [PHP] simple regexp question - validating new line chars
that's because you're testing to see if '\n' is \n...single quotes mean: interpret the text between literally, so '\n' is a backslash followed by n...doulbe quotes mean: interpolate the value, so \n becomes a newline... -Original Message- From: Krzysztof Jarecki [mailto:[EMAIL PROTECTED]] Sent: Saturday, December 08, 2001 12:10 PM To: [EMAIL PROTECTED] Subject: [PHP] simple regexp question - validating new line chars Hi everyone:) I need to validate a string that comes from a submitted form. There's nothing unusual in it... but the problem part showes up, when I need to validate a new line character... I have tried many diffrent variations of the code and I have ended up on something VERY simple: ?php $regexp='\n'; $text=\n; echo $text; if (true==eregi($regexp, $text)) { echo 'ok'; } else { echo 'error'; } ? Unfortunately this script results with error ;( Does somebody know how to make this regexp to work? Maybe it is a bug? I am using php 4.0.6 on windows 2000. I will appreciate any feedback about this ;) Chris Jarecki -- 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]
RE: [PHP] How to compute time to load page...
the search time is different than the page load timegoogle for example can find thousands of records in a tenth of a second, yet it takes longer to get that html result back to your browseryou could estimate page download time by calculating the filesize and using the connection speedcertainly not 100% accurate, but it will give you a way of estimating. jack -Original Message- From: Torkil Johnsen [mailto:[EMAIL PROTECTED]] Sent: Saturday, December 08, 2001 7:14 PM To: [EMAIL PROTECTED] Subject: [PHP] How to compute time to load page... Hi All... (again) I was just wondering if anyone out there has made a function that will compute how long time (seconds, milliseconds) it will take to load a page? I see some search engines have a function that displays how long time the search took, and I'm looking for the same thing, to compare different designs and improve loading time for my viewers. Anyone? - Torkil Johnsen -- 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]
RE: [PHP] Comparing Dates
you could pass the values to mktime and compare -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Saturday, December 08, 2001 8:17 PM To: [EMAIL PROTECTED] Subject: [PHP] Comparing Dates I'm trying to do a check on a date, to see if it's after the current date, so basically i'm doing an if(date(d-m-y)15-12-01) { do something } I know that's obviously not the right way to do it, but can someone help me out? -- 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]
RE: [PHP] Reg ex help-Removing extra blank spaces before HTML output
using \n as your replacement text will do ithowever, if you want a newline in the html, then you'll want br... and as far as the advanced replace, make an array of search patterns, in this case two. your first pattern will be /[ ]+\n+[ ]+/ with a replacement of a single newline...then the second will be the previous regex.check out php.net for help with syntax and using arrays with preg_* functionsthe first should catch all situations of a series of spaces [with at least one newline in between them] and substitute a newline. check out mastering regular expressions as well.its worth the money jack -Original Message- From: Ken [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 06, 2001 3:08 AM To: Jack Dempsey; liljim; PHP list Subject: RE: [PHP] Reg ex help-Removing extra blank spaces before HTML output At 02:43 PM 12/5/01 -0500, Jack Dempsey wrote: $t = preg_replace('/\s+/',' ',$text); One more thing: How do I replace with newline instead of a space? I read through the manuals but couldn't grasp how to do this. \n didn't cut it. And, more advanced - The above replaces any groups of 2 or more blanks (newlines, spaces, tabs) with a single blank. Is there an easy way to replace them with EITHER a space or a newline, depending on whether any newlines were present in the input? I.e. bb would be replaced with b, but bnbn would be replaced with n. Right now the issue is that I'm sometimes getting results that have no line breaks for a really long time, and I know there are reasons to try to avoid individual lines of HTML longer than 200 characters. Thanks! - Ken [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]
RE: [PHP] Reg ex help-Removing extra blank spaces before HTML output
second issue first: one call to preg_replace...if you check out php.net/preg_replace, you'll see what i mean...use arrays... and as long as you have them ordered in the right way, it'll execute them in that order, so by the time the \s replace comes up all your 'bbbnbb' will be fixed...problem then is that those newlines would get caught by the \s and get switched to spaces...so, if you want them to stay, then use [ ] to represent a space instead of \s...might want [ \t] to catch tabs as well... first issue: hard to see whats going on, but check your syntax. i just ran this; $text = this is some text with a newline in it right here \n there it was; echo $text; echo 'br'; echo preg_replace(/[ ]+\n+[ ]+/,\n,$text); and it made the substitution fine. jack -Original Message- From: Ken [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 06, 2001 1:56 PM To: Jack Dempsey Subject: RE: [PHP] Reg ex help-Removing extra blank spaces before HTML output At 11:41 AM 12/6/01 -0500, Jack Dempsey wrote: using \n as your replacement text will do ithowever, if you want a newline in the html, then you'll want br... Using \n (either in single or double quotes) resulted in actual 'backslash n' being all over my output, instead of newlines. Hence, my inquiry. your first pattern will be /[ ]+\n+[ ]+/ with a replacement of a single newline...then the second will be the previous regex.check out php.net for help with syntax and using arrays with preg_* functionsthe first should catch all situations of a series of spaces [with at least one newline in between them] and substitute a newline. Thanks, sounds about right. The second pattern (which sometimes includes getting rid of newlines) won't clobber the results of the first pattern? And are you suggesting two separate calls to the preg* function? It sounds like you are, if each of the two patterns also has a unique replacement string. Thanks a lot! - Ken [EMAIL PROTECTED] check out mastering regular expressions as well.its worth the money jack -Original Message- From: Ken [mailto:[EMAIL PROTECTED]] At 02:43 PM 12/5/01 -0500, Jack Dempsey wrote: $t = preg_replace('/\s+/',' ',$text); One more thing: How do I replace with newline instead of a space? I read through the manuals but couldn't grasp how to do this. \n didn't cut it. And, more advanced - The above replaces any groups of 2 or more blanks (newlines, spaces, tabs) with a single blank. Is there an easy way to replace them with EITHER a space or a newline, depending on whether any newlines were present in the input? I.e. bb would be replaced with b, but bnbn would be replaced with n. -- 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]
RE: [PHP] Reg ex help-Removing extra blank spaces before HTML output
cool, glad you got it working...if you think there's a bug with using / and | you might want to see if you can replicate the problem, and if its really a bug, submit it...my guess is that it was just a typo or something jack -Original Message- From: Ken [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 06, 2001 5:13 PM To: Jack Dempsey; PHP list Subject: RE: [PHP] Reg ex help-Removing extra blank spaces before HTML output OK, this time the \n worked. The only thing I changed was using / delimiters instead of | delimiters in the search string. No idea if/why that would affect anything in the replacement string. Anyway, I finally came up with exactly what I wanted: preg_replace(array(/\s*\n+\s*/, /[ ]+/), array(\n, ), $input); All padding (defined as any series of spaces, newlines and sometimes tabs) is removed from $input, but always leaving at least a space or a newline in its place. If there were any newlines in the padding, then a newline is left. If there weren't, then a space is left. Thanks for the help! Ken [EMAIL PROTECTED] At 04:40 PM 12/6/01 -0500, Jack Dempsey wrote: one call to preg_replace...if you check out php.net/preg_replace, you'll see what i mean...use arrays... and as long as you have them ordered in the right way, it'll execute them in that order, so by the time the \s replace comes up all your 'bbbnbb' will be fixed...problem then is that those newlines would get caught by the \s and get switched to spaces...so, if you want them to stay, then use [ ] to represent a space instead of \s...might want [ \t] to catch tabs as well... -- 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]
RE: [PHP] Reg ex help-Removing extra blank spaces before HTML output
true...he didn't mention newlines though so i left those out...also, since PHP 4.0.4 $n [meaning $1], being the preferred one. you also don't need double quotes and since + means 1 or more, i'd save myself some typing $input = preg_replace('/(\s|\n)+/',$1,$input); of course since you're now matching and replacing it'll take longer than a straight substitution, although i doubt the files you're scanning are big enough to notice jack -Original Message- From: liljim [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 05, 2001 5:18 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Reg ex help-Removing extra blank spaces before HTML output Hello, The example Jack gave you will clear up spaces well, though to get both newlines and spaces into one: $input = preg_replace(/([ ]|\n){1,}/, \\1, $input); James Jack Dempsey [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... $text = preg_replace('|\s+|',' ',$text); -Original Message- From: Ken [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 05, 2001 2:06 AM To: PHP list Subject: [PHP] Reg ex help-Removing extra blank spaces before HTML output I want to remove all superfluous blank spaces before I sent my HTML output, to make the output smaller. So I'd like to take $input, replace any number of blank space or newlines that are consecutive and replace them with a single blank. I.e. I will list a blank space as b and a newline as n: If input is: bTEXTHEREbbbnnnbnMOREbEVENMORE Then output should be: bTEXTHEREbMOREbEVENMORE I imagine this would be handled by a simple regular expression call, but I'm no pro with them yet. Any help? Thanks, Ken [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]
RE: [PHP] Reg ex help-Removing extra blank spaces before HTML output
actually it does... james' solution will work but I forgot to mention a \s is whitespace, not a space, therefore it will get tabs, newlines, and spaces. look at http://www.cs.tut.fi/~jkorpela/perl/regexp.html \s matches any whitespace character (space, tab, newline) therefore my suggestion works: $t = preg_replace('/\s+/',' ',$text); its quicker to code, easier to understand, and will run faster because it doesn't have to match and remember or do alternation... jack -Original Message- From: Ken [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 05, 2001 2:01 PM To: Jack Dempsey Subject: RE: [PHP] Reg ex help-Removing extra blank spaces before HTML output At 10:57 AM 12/5/01 -0500, Jack Dempsey wrote: a space (\s is from perl) Ah, OK, yours doesn't deal with newlines. From list member James, a solution that does: - From: liljim [EMAIL PROTECTED] The example Jack gave you will clear up spaces well, though to get both newlines and spaces into one: $input = preg_replace(/([ ]|\n){1,}/, \\1, $input); - Thanks again! - Ken [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]
RE: [PHP] problem with ImageCreateJPEG ...
also, are you sure both versions of php were compiled the same way with the same options and support? -Original Message- From: Johan Holst Nielsen [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 04, 2001 9:22 AM To: Miguel Loureiro; [EMAIL PROTECTED] Subject: Re: [PHP] problem with ImageCreateJPEG ... sorry for taking your time, but I still dont understand why I got errors with pjeg... I use the following code on other machine with jpeg support to , and it works, while in my machine I got an empty jpeg file ? Header(Content-type: image/jpeg); $im=ImageCreate(400,200); $bcg = ImageColorAllocate($im,240,240,240); $prt = ImageColorAllocate($im,0,0,0); $rd = ImageColorAllocate($im,255,0,0); ImageFill($im,400,200,$bcg); ImageLine($im,110,85,280,85,$rd); ImageString($im,5,130,90,--- OK ---,$prt); ImageLine($im,110,110,280,110,$rd); ImageJPEG($im,a.jpg); ? html body img src=a.jpg /body /html Try to remove all html, and instead make a ImageJPEG($img); You should then only get the JPEG file? You set a header, and the browser doesn't understand the HTML... regards Johan -- 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]
RE: [PHP] Reg ex help-Removing extra blank spaces before HTML output
$text = preg_replace('|\s+|',' ',$text); -Original Message- From: Ken [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 05, 2001 2:06 AM To: PHP list Subject: [PHP] Reg ex help-Removing extra blank spaces before HTML output I want to remove all superfluous blank spaces before I sent my HTML output, to make the output smaller. So I'd like to take $input, replace any number of blank space or newlines that are consecutive and replace them with a single blank. I.e. I will list a blank space as b and a newline as n: If input is: bTEXTHEREbbbnnnbnMOREbEVENMORE Then output should be: bTEXTHEREbMOREbEVENMORE I imagine this would be handled by a simple regular expression call, but I'm no pro with them yet. Any help? Thanks, Ken [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]
RE: [PHP] php without the php.ini
are you sure its not there? where does phpinfo say its located? its really not there? hmm...i'm not sure, but php might just use its own internal defaults without a php.ini present, but i thought it was needed..who knows.. jack -Original Message- From: Kunal Jhunjhunwala [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 7:52 PM To: [EMAIL PROTECTED] Subject: [PHP] php without the php.ini Hi, How can PHP work without the php.ini file? I have tried to find the php.ini file on a RAQ3, to no success. Looking at the php info and then looking at the system directories doesnt yield anything. The same goes with a server running the Plesk control panel. Any ideas on how this is done? Regards, Kunal Jhunjhunwala -- 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]
RE: [PHP] Array Help
you can just kept adding []'s $var[category][subcategory][Item] = url; -Original Message- From: Brian V Bonini [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 27, 2001 4:56 PM To: PHP Lists Subject: [PHP] Array Help How can I access the inner most info in this array? Ie, Item and url $var = array( category = array( subcategory = array( Item = url ), ) ); -- 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]
Re: [PHP] Display Problemo
1. what do you want the br tags to be? a simple str_replace('br','',$text) will strip the tags... 2. use pre html text /pre jack Lerp wrote: I have a small php app that I'm building to display, insert, edit, etc... various types of code snipits (asp, php, html, etc...) in a db. I also have a download option that creates a text file with the code that they've selected. I have 2 problems...the first is that when I go to view the text file I have all sorts of BR tags within the text, this is due to the nl2br function I used prior to the db insertion. How would I get rid of those? The seond problem is when a user goes to view an html code example on the webpage, say with a hyperlink, the hyperlink is made active replacing the code with the actual a href tag. Thx in advance, Lerp -- 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]
Re: [PHP] schedule a task
cron either a php script itself [if you've got it installed as a cgi] or a lynx request of the page check the archives as well [marc.theaimsgroup.com] because this comes up every week or so - Original Message - From: Gab [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 19, 2001 3:15 PM Subject: [PHP] schedule a task Hi, I have a form (POST method), that creates a back-up of a MySQL database as an SQL file when submited. I am looking for a way to automate this task (ie on a daily basis at midnight). Any idea on how to do it in PHP? (if it is possible) Thanks Gab -- 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]
Re: [PHP] schedule a task
you need some way of automating the process, and without cron automatically doing things for you, you're going to be pressed for a solution...i'm not sure what you could do because you need something to do this automatically...your host doesn't provide perl scripts to be cronned or anything like that? if not, i'm not sure what to tell you... jack - Original Message - From: Gab [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 19, 2001 3:32 PM Subject: Re: [PHP] schedule a task thanks for a quick response but I have a major problem with that: no shell access = can't use cron Any other idea? Gab Jack Dempsey [EMAIL PROTECTED] wrote in message 005401c17137$b930af00$[EMAIL PROTECTED]">news:005401c17137$b930af00$[EMAIL PROTECTED]... cron either a php script itself [if you've got it installed as a cgi] or a lynx request of the page check the archives as well [marc.theaimsgroup.com] because this comes up every week or so - Original Message - From: Gab [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 19, 2001 3:15 PM Subject: [PHP] schedule a task Hi, I have a form (POST method), that creates a back-up of a MySQL database as an SQL file when submited. I am looking for a way to automate this task (ie on a daily basis at midnight). Any idea on how to do it in PHP? (if it is possible) Thanks Gab -- 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]
Re: [PHP] Difference of queries in PHP/mySQL?
are you actually doing anything with $request? that just gets a mysql result back in a variable, you then have to extract the data from it... Jeff Lewis wrote: I am wondering if there are any difference between using PHP and using the command line for mySQL. Entering this at the comman line returns all the membergroups properly. When I use this in my PHP program, it doesn't continue past this line: $request = mysql_query(SELECT membergroup FROM membergroups WHERE 1 ORDER BY ID_GROUP); Jeff -- 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]
RE: [PHP] Converting dates?
search the archives there are tons of messages dealing with date manipulation. basically take the timestamps find the difference in seconds, convert to days, etc jack -Original Message- From: Jeff Lewis [mailto:[EMAIL PROTECTED]] Sent: Saturday, November 17, 2001 3:17 PM To: PHP is not a drug. Subject: [PHP] Converting dates? I am storing a birthdate in my database as a Unix timestamp but when I display it I want to calculate the different between that date and todays date and display the persons age. How can I do that with PHP? I also want to know if it is currently their birthday. So trying to set $isbday to yes if todays month and day are the same as their birthdate in the database. Jeff -- 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]
RE: [PHP] PHP Backing up a Database?
mysqldump check it out, either man or google then ftp that file down, load it wherever, and mysql database dump.sql jack -Original Message- From: cosmin laslau [mailto:[EMAIL PROTECTED]] Sent: Saturday, November 17, 2001 5:25 PM To: [EMAIL PROTECTED] Subject: [PHP] PHP Backing up a Database? Hi, Say I'm not really confident in the prowess of my server, and I want to download my database onto my computer. Can that be done? What can I look (FTP access) in the directory structure. I guess, where is it usually located? Thanks. Cosmin Laslau _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- 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]
RE: [PHP] Regular expressions?
If you'd really like to develop your regex skills, and everyone should, pickup Mastering Regular Expressions by Jeffrey Friedl(O'Reilly Press). Its the best out there, and will probably teach you more than you thought possible. Jack -Original Message- From: Martin Thoma [mailto:[EMAIL PROTECTED]] Sent: Friday, November 16, 2001 2:31 AM To: [EMAIL PROTECTED] Subject: [PHP] Regular expressions? Hello! I need to search for strings between html-tags. For example, I need to know if the String Searchstring is between H2 and /H2 (case-insensitive). How is it done? I think I need regular expressions, but I have no idea about it. I'm not getting to clever out of the php-documentaion. Where can I start to learn reg-exp? Should I use the ereg- oder preg-functions? Help! 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] os x server and php version 4.0b2
I've been meaning to upgrade and finally feel like I have to bite the bullet. However, I can't find much information on OS X Server and a version of php more recent than 4.0b2 which is what I'm currently running. Can anyone provide some links or their configure line? thanks, Jack -- 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] mirrors?
has anyone tried selecting a mirror php site from the drop down at the bottom-right? i just tried brazil and bulgaria and it seems to be broken in general... -- 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]
RE: [PHP] cron not allowed
how did you plan on running php from cron? however you do that you could run a perl script that just makes a system call and does the same thing -Original Message- From: Caspar Kennerdale [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 13, 2001 9:04 AM To: Php-General Subject: [PHP] cron not allowed I have a php script I'd like to run at regular intervals, but my isp will not set a cron job for it but will for a perl script Is there anyway round tis, or does anyone one know of a perl script that might then execute the php script if I can get that to be automated? thanks -- 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]
RE: [PHP] cron not allowed
thanks jonwas more of a 'how are you going to' rather than 'how is it possible' :-) either way, from lynx or from php being a cgi a simple shell script or perl script should be able to make the appropriate call... jack -Original Message- From: Jon Haworth [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 13, 2001 9:29 AM To: 'Jack Dempsey'; [EMAIL PROTECTED] Subject: RE: [PHP] cron not allowed how did you plan on running php from cron? Well, this works for me: 0 3 * * * lynx -dump http://mysite.com/mypage.php /dev/null HTH Jon ** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality' ** -- 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]
RE: [PHP] Re: Can If Else statements be split into code blocks??
David's correct. The reason it wasn't working for you is that you didn't put braces around the code you wanted executed in the if statement. Also, to output large chunks of html in a simple manner with variables included, look into here docs. They look like this: echoEOF This is html with a $variable in it. EOF; jack -Original Message- From: David Robley [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 13, 2001 8:21 PM To: Brad Melendy; [EMAIL PROTECTED] Subject: Re: [PHP] Re: Can If Else statements be split into code blocks?? On Wed, 14 Nov 2001 11:43, Brad Melendy wrote: Ok, I figured out that just using echo seems to be the best way to do this under PHP. In ASP, you can end your code block and start in with HTML, but I couldn't get that to work with PHP. However, I was able to just use the echo statement to get the conditional HTML I wanted to show up when the proper condition was met in the If Else statement. Brad Brad Melendy [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello, I'm trying to execute some HTML in an IF ELSE statement. I'm trying something like: ?php if (strstr($DomResults,$Match)) print Congratulations! $domain.$suffix is available!; ? form method=POST action=step2.asp name=form2 pinput type=submit value=Register name=B1/p /form ?php else print Sorry, $domain.$suffix is already taken.; ? Basically, it works great without the form I'm trying to insert, but with the form after the IF statement, it fails. Is what I want to do against the rules? I'm converting an ASP script I have to PHP and I have it all working under ASP. That means it should be eaiser with PHP right? ;-) Thanks in advance. ...Brad You can drop in and out of php parsing, even in a control structure. So something like ?php if($this == 'that') { ? H2That/H2 ?php } else{ ? H2The Other/H2 ?php } ? will work just fine. -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA Stop talking! I'm out of aspirin! -- 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]
RE: [PHP] Login verification
i would think you could just use crypt() to check the pass against what you read in from the file -Original Message- From: Ashley M. Kirchner [mailto:[EMAIL PROTECTED]] Sent: Monday, November 12, 2001 2:27 AM To: PHP-General List Subject: [PHP] Login verification I want to make a login page in PHP, which will check the user/password against the system's user/password file (in my case, /etc/passwd and /etc/shadow.) With the machine running PAM, how can I have PHP do this? Keep in mind I don't need to modify anything, just verify the login. Once verified, the script either continues on to doing other things, or it bombs with a bad login page. -- H | Life is the art of drawing without an eraser. - John Gardner + Ashley M. Kirchner mailto:[EMAIL PROTECTED] . 303.442.6410 x130 Director of Internet Operations / SysAdmin. 800.441.3873 x130 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave, #6 http://www.pcraft.com . . .. Boulder, CO 80303, U.S.A. -- 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]
RE: [PHP]
you can set error_reporting(E_ALL)that will help... -Original Message- From: Alex Tenitsky [mailto:[EMAIL PROTECTED]] Sent: Monday, November 12, 2001 9:19 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Hello, I'm curious if there's anything in PHP like use strict in Perl. It would save so much of development time! Regards, Alexei Tenitski -- 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]
RE: [PHP] for loop problem?
paste the complete code in and myself and others can run your exact copy -Original Message- From: Tyler Longren [mailto:[EMAIL PROTECTED]] Sent: Monday, November 12, 2001 11:22 PM To: Martin Towell; [EMAIL PROTECTED] Subject: Re: [PHP] for loop problem? I removed all of the quotes that could be affecting it. Still, it loops until I stop it. I let it go all the way up to 350,000 or so. Any other ideas anyone? Thank you! Tyler - Original Message - From: Martin Towell [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 12, 2001 10:06 PM Subject: RE: [PHP] for loop problem? hmmm... I just tried : $value1 = 100; $value2 = 1223109; for($i = $value1; $i = $value2; $i++) { echo $i\n; } and it spat out all 223109 numbers (albiet after a VERY long time) can't see how adding mysql code would affect the loop... Martin T -Original Message- From: Tyler Longren [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 13, 2001 2:53 PM To: Evan Nemerson; [EMAIL PROTECTED] Subject: Re: [PHP] for loop problem? To everyone that said it had something to do with the quotes: that has nothing to do with it. When I first wrote this, It didn't have all the quotes. It did the same thing. Then, I thought I may need some quotes somewhere, but that obviously didn't help. Any other suggestions? If I HAVE to, I'll do this in PERL, but would much rather do it in PHP. Thanks everyone, Tyler - Original Message - From: Evan Nemerson [EMAIL PROTECTED] To: Tyler Longren [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, November 12, 2001 9:41 PM Subject: Re: [PHP] for loop problem? My word why all the quotes? ? $connection = mysql_connect(blah,blah,blah); $db = mysql_select_db(db_to_use, $connection); $value1 = 100; $value2 = 1223109; for($i=$value1; $i=$value2; $i++) { mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i')); if (mysql_error() != ) { print font face=Arial size=2.mysql_error()./font; exit; } } mysql_close($connection); ? That should give you some better results. On Monday 12 November 2001 07:32 pm, you wrote: Hello everyone, I have a pretty big list of codes that need to be put into a mysql db. The numbers range from 100 to 1223109. Here's the PHP I wrote to put these codes into a database: ? $connection = mysql_connect(blah,blah,blah); $db = mysql_select_db(db_to_use, $connection); $value1 = 100; $value2 = 1223109; for($i=$value1; $i=$value2; $i++) { mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i')); if (mysql_error() != ) { print font face=Arial size=2.mysql_error()./font; exit; } } mysql_close($connection); ? Everytime I run this from a browser, it just keeps looping. It should put about 223109 entries into the passcodes table. However, it just keeps looping. I'll end up with 400,000 or so entries before I stop it. I make sure I empty that table before I start running it again. Why is this happening? Thanks everyone, Tyler -- 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 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]
RE: [PHP] for loop problem?
ran it (without mysql queries) and worked finereal strange. have you tried the loop without the mysql queries? -Original Message- From: Tyler Longren [mailto:[EMAIL PROTECTED]] Sent: Monday, November 12, 2001 11:28 PM To: Jack Dempsey; [EMAIL PROTECTED] Subject: Re: [PHP] for loop problem? Exact code: ? $connection = mysql_connect(host_here,user_here,pass_here); $db = mysql_select_db(db_here, $connection); $value1 = 100; $value2 = 1223109; for($i=$value1; $i=$value2; $i++) { mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i')); if (mysql_error() != ) { print font face=Arial size=2.mysql_error()./font; exit; } } mysql_close($connection); ? Tyler - Original Message - From: Jack Dempsey [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 12, 2001 10:34 PM Subject: RE: [PHP] for loop problem? paste the complete code in and myself and others can run your exact copy -Original Message- From: Tyler Longren [mailto:[EMAIL PROTECTED]] Sent: Monday, November 12, 2001 11:22 PM To: Martin Towell; [EMAIL PROTECTED] Subject: Re: [PHP] for loop problem? I removed all of the quotes that could be affecting it. Still, it loops until I stop it. I let it go all the way up to 350,000 or so. Any other ideas anyone? Thank you! Tyler - Original Message - From: Martin Towell [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 12, 2001 10:06 PM Subject: RE: [PHP] for loop problem? hmmm... I just tried : $value1 = 100; $value2 = 1223109; for($i = $value1; $i = $value2; $i++) { echo $i\n; } and it spat out all 223109 numbers (albiet after a VERY long time) can't see how adding mysql code would affect the loop... Martin T -Original Message- From: Tyler Longren [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 13, 2001 2:53 PM To: Evan Nemerson; [EMAIL PROTECTED] Subject: Re: [PHP] for loop problem? To everyone that said it had something to do with the quotes: that has nothing to do with it. When I first wrote this, It didn't have all the quotes. It did the same thing. Then, I thought I may need some quotes somewhere, but that obviously didn't help. Any other suggestions? If I HAVE to, I'll do this in PERL, but would much rather do it in PHP. Thanks everyone, Tyler - Original Message - From: Evan Nemerson [EMAIL PROTECTED] To: Tyler Longren [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, November 12, 2001 9:41 PM Subject: Re: [PHP] for loop problem? My word why all the quotes? ? $connection = mysql_connect(blah,blah,blah); $db = mysql_select_db(db_to_use, $connection); $value1 = 100; $value2 = 1223109; for($i=$value1; $i=$value2; $i++) { mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i')); if (mysql_error() != ) { print font face=Arial size=2.mysql_error()./font; exit; } } mysql_close($connection); ? That should give you some better results. On Monday 12 November 2001 07:32 pm, you wrote: Hello everyone, I have a pretty big list of codes that need to be put into a mysql db. The numbers range from 100 to 1223109. Here's the PHP I wrote to put these codes into a database: ? $connection = mysql_connect(blah,blah,blah); $db = mysql_select_db(db_to_use, $connection); $value1 = 100; $value2 = 1223109; for($i=$value1; $i=$value2; $i++) { mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i')); if (mysql_error() != ) { print font face=Arial size=2.mysql_error()./font; exit; } } mysql_close($connection); ? Everytime I run this from a browser, it just keeps looping. It should put about 223109 entries into the passcodes table. However, it just keeps looping. I'll end up with 400,000 or so entries before I stop it. I make sure I empty that table before I start running it again. Why is this happening? Thanks everyone, Tyler -- 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 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
RE: [PHP] Resetting ID in mySQL DB
say you have 100 records. you delete number 36. your db will then be ... 34 35 37 38 ... correct? after a delete, you could then say: update table set id_num=id_num-1 where id 36 and this would update all relevant records -Original Message- From: Thomas Edison Jr. [mailto:[EMAIL PROTECTED]] Sent: Monday, November 12, 2001 1:52 AM To: [EMAIL PROTECTED] Subject: [PHP] Resetting ID in mySQL DB Hi, I'm facing a problem. I made a simple DB with simple adding records in DB operation. I've even put up a JavaScript validation of the Form from where you add info. And yet, in the display table, there are many many blank fields. I don't know how they are generated. The Adding of info form is at : http://www.mjimm.com/index.php3?page=fanlist_add.php3 The display of records is at : http://www.mjimm.com/fanlist_view.php3 Now the Display table also Displays the ID of the Record. If i go in my mySQL Admnin, and delete the rows with blank or duplicate records.. the ID also is deleted but then is alway missing from the list. That is, if i delete Row with ID 78, the next record feeded will start from 79 and not 78. So there's gonne be missing ID's from Records. Which i don't want. But which has already happened. How can i correct it?? I want to reset the entire IDs to reflect the true Number of records after i delete the Empty/Blank Rows Duplicate Record Rows!! How can i do that! Please help! Cheers Glory, Thomas edison jr. = Rahul S. Johari (Director) ** Abraxas Technologies Inc. Homepage : http://www.abraxastech.com Email : [EMAIL PROTECTED] Tel : 91-4546512/4522124 *** __ Do You Yahoo!? Find a job, post your resume. http://careers.yahoo.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] -- 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]
Re: [PHP] Regular expression question
What is $num going to be? A number? So how do you determine where that number ends and where there shouldn't be another number in front of it...are there any restrictions on the size of $num? say $num is 51 then you're saying that you want to match 51:: but not 151:: however, what if $num is 151? see what i mean? - Original Message - From: Leon Mergen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, November 09, 2001 1:53 PM Subject: [PHP] Regular expression question Hello, I have a little question regarding regular expressions... I want to check for the pattern $num:: But, $num may not be started with another number (assume the number will be 51 , 1 will also match (the pattern 1:: is available in 51::) ... Currently, my regular expression is: eregi(([^0-9]$num::), $string); But that doesn't seem to work... The other option, the start of a line or a : also didn't work: eregi(([^|:]$sess_id::), $string); Anyone can help me with this? Thanks in advance, Leon Mergen -- 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]
RE: [PHP] Am i crazy?
you're assigning, not checking for equality...use two ='s -Original Message- From: Martin [mailto:[EMAIL PROTECTED]] Sent: Sunday, November 04, 2001 12:49 PM To: [EMAIL PROTECTED] Subject: [PHP] Am i crazy? Did I forget everything in a few months? if ($name='admin') { header(Location: $MYPATH/admin.php); } Doesn't. That is it doesn't redirect to whatever $MYPATH/admin.php translates to. Doing an echo $MYPATH directly after the line shows that the path is interpreted correctly - and the file exists (I checked). And the $name is correct - echo $name gives admin. And neither does the php.net example work ... if ($name='admin') { header(Location: http://www.php.net/;); } doesn't redirect to php.net. *sigh* 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]
RE: [PHP] Am i crazy?
what happens? are you sure $name really equal's admin? if you change header to echo $MYPATH does that work? -Original Message- From: Martin [mailto:[EMAIL PROTECTED]] Sent: Sunday, November 04, 2001 12:54 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] Am i crazy? Jack Dempsey wrote: you're assigning, not checking for equality...use two ='s Still not redirecting ... Martin S -- 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] documentation comment
not to start a war, but have you seen php.net's documentation compared to anything microsoft or anyone else has ever put out? i'd say that documentation is microsoft's achilles heel -- 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]
RE: [PHP] problem with copy($file,path) to up load a file
that means you don't have permissions to write that file to whatever directory is your target.if you tried the same thing from teh command line you'd get the same error -Original Message- From: banyWilson [mailto:[EMAIL PROTECTED]] Sent: Saturday, November 03, 2001 11:39 AM To: [EMAIL PROTECTED] Subject: [PHP] problem with copy($file,path) to up load a file When i use function copy($file,$path)to uplode a file , the error message shows that :permision denied! what's wrong ,Who can help me!! -- 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]
RE: [PHP] simple array tutorial wanted
http://www.php.net/manual/en/language.types.array.php start with that -Original Message- From: Justin French [mailto:[EMAIL PROTECTED]] Sent: Friday, November 02, 2001 12:33 AM To: php Subject: [PHP] simple array tutorial wanted Hi all, I really want to get me head around arrays, becuase I KNOW there's a better way to do some of the stuff i'm doing right now. I could mess with stuff for a few hours and probably get it, but i'd rather have a decent tutorial if anyone knows of one... Thanks, Justin French -- 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]
Re: [PHP] split array in 2 halfs
Based on what criteria? if you just want to split the array at element 30, you could use array_splice to get the necessary data... - Original Message - From: Daniel Harik [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 01, 2001 2:16 AM Subject: [PHP] split array in 2 halfs Good evening I was wondering how can I split, array that has 60 elements in it, into 2 arrays with 30 elements each? Thank You very much and have a good night :-) -- 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]
RE: [PHP] Text DB's bbs lists
Hi Arsen, I think that'd be a lot of work, and I'm not sure I understand why you can't use MySQL? I suppose you could do it, but i think you'll find once starting it, that its not worth the time it'll need... Jack -Original Message- From: ArsenKirillov [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 31, 2001 7:41 PM To: [EMAIL PROTECTED] Subject: [PHP] Text DB's bbs lists does anybody hear about board(bbs or phorum) written oin php wihout using any kind of SQL DB ? I think of developing one in text db (separated by | fields in one line) Did anybody think of this is good idea ? (i have problem in my country - stupid admins can't run MySQL to be such stable as php4.) -- 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]
RE: [PHP] Total Newbie in over head
Hi Warwick, Did you look at the install notes that come with PHP? It explains there how you have to configure Apache to recognize php files and give them to the php interpreter...checkout the README or INSTALL files that come with PHP... jack -Original Message- From: J W W L (Warwick) Berg [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 30, 2001 11:21 PM To: [EMAIL PROTECTED] Subject: [PHP] Total Newbie in over head Hi all Sorry about what is probably a total dickhead about to enter your midst, but I've never installed php or seen it much at all before but am trying to do it now. Using RH 7.1 and Apache 1.3.19 Want to install php4 and mysql combo and totally ignorant. Installed php rpm. Restarted apache in case that was needed. made hello.php and pointed browser at it. Got the text, rather than executing it. Can I surmise that apache isn't set up properly, and if so, could someone please point me towards relevant assistance. Got really confused with the manual, etc. Not that bright I suppose ;-) Thanks in advance Warwick -- 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]
RE: [PHP] @#$@# Reg Expressions
ok, are you trying to get the links returned or just split on them? i missed your original post. watch your caps as well... i'd use preg_split also jack -Original Message- From: brendan [mailto:[EMAIL PROTECTED]] Sent: Monday, October 29, 2001 9:59 PM To: [EMAIL PROTECTED] Subject: [PHP] @#$@# Reg Expressions thanks but it didnt work either .. ;) Matt Friedman wrote: Try putting a ? after your quantifier for non-greedy matching. Something like: $the_array=split(A (.*?)/A, $html,-1); Matt. - Original Message - From: brendan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, October 29, 2001 7:55 PM Subject: [PHP] @#$@# Reg Expressions love em.. right now I hate em.. can someone inform me why the below doesnt work? it is intended to strip out all the links in a page and return an array .. insanity is just starting to set in.. cheers $html =GETSITE($url); // and put in a new line break behind every anchor tag $the_array=spliti(A (.*)/A, $html,-1); echo $the_array ; foreach($the_array AS $k) echo $k.HR; } -- 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]
RE: [PHP] @#$@# Reg Expressions
brendan, please clarify: you're trying to strip out all links in the page that is between the a href and /a you're trying to strip out all links and return them? if so, split won't work.it splits on whatever the pattern is. if you're trying to get all the links, you could do [this doesn't get a name which is what you want i think] preg_match_all(|(a href.*?/a)|,$html,$matches); look at the preg_match_all page at php.net for info on how to use it ITE($url); $the_array=spliti(A (.*)/A, $html,-1); //spliti to avoid any case sensitivity. foreach($the_array AS $k) echo $k.HR; I had given preg_split a go but just got flummoxed with the need to slash everything .. Martin .. I'd tried that .. but i get an array count of 0 from $the_array ..(from $the_array=split(A ([^]*)/A, $html,-1); echo count($the_array); Jack Dempsey wrote: ok, are you trying to get the links returned or just split on them? i missed your original post. watch your caps as well... i'd use preg_split also jack -Original Message- From: brendan [mailto:[EMAIL PROTECTED]] Sent: Monday, October 29, 2001 9:59 PM To: [EMAIL PROTECTED] Subject: [PHP] @#$@# Reg Expressions thanks but it didnt work either .. ;) Matt Friedman wrote: Try putting a ? after your quantifier for non-greedy matching. Something like: $the_array=split(A (.*?)/A, $html,-1); Matt. - Original Message - From: brendan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, October 29, 2001 7:55 PM Subject: [PHP] @#$@# Reg Expressions love em.. right now I hate em.. can someone inform me why the below doesnt work? it is intended to strip out all the links in a page and return an array .. insanity is just starting to set in.. cheers $html =GETSITE($url); // and put in a new line break behind every anchor tag $the_array=spliti(A (.*)/A, $html,-1); echo $the_array ; foreach($the_array AS $k) echo $k.HR; } -- 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 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]
RE: [PHP] @#$@# Reg Expressions
or the east coast.only 11:35 here in dc -Original Message- From: brendan [mailto:[EMAIL PROTECTED]] Sent: Monday, October 29, 2001 11:14 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] @#$@# Reg Expressions or really bloody narky afgani's Martin Towell wrote: Off track - seems like the only ppl awake now are ozzies :) would I be right? -Original Message- From: Brad Hubbard [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 30, 2001 3:11 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] @#$@# Reg Expressions On Tue, 30 Oct 2001 14:47, brendan wrote: mate you rock.. You can tell he's an Australian (on ya mate :-) -- 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]
RE: [PHP] Portland, Oregon
ok, how about DC ? :-) -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 23, 2001 6:54 PM To: Richard Baskett Cc: PHP General Subject: Re: [PHP] Portland, Oregon So Rasmus.. how about coming to Portland, Oregon? I havent seen a PHP class, tutorial, anything in this area.. and I would love to attend one :) I was there 2 months ago. -Rasmus -- 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]
RE: [PHP] anyone have...
would need to check, but: preg_replace(/[^a-zA-z]/,'',$data) should about do it... jack -Original Message- From: Jay Paulson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 23, 2001 6:50 PM To: [EMAIL PROTECTED] Subject: [PHP] anyone have... anyone have a function that strips out all the characters in a string that are no a-z or A-Z? thanks... -- 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]
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]
RE: [PHP] Form Question
ok, several different solutions, best being: 1. use sessions. this is probably the simplest, most robust way of doing it, after you've become familiar with sessions. 2. as someone mentioned before, use one page that posts to itself. this would be easier than using sessions, but not as powerful. jack -Original Message- From: Christopher William Wesley [mailto:[EMAIL PROTECTED]] Sent: Sunday, October 21, 2001 6:46 PM To: [EMAIL PROTECTED] Cc: Chip Landwehr Subject: Re: [PHP] Form Question On Sun, 21 Oct 2001, Chip Landwehr wrote: if ($T3==){header (Location: new_narrative.php?FilledName=No);} How do I change this to include a Post? You can put it back on as a query string (kinda dirty, but you can't POST it back). ?php $myQueryString = FilledName=No; while( list( $key, $val ) = each( $HTTP_POST_VARS ) ){ $myQueryString .= . $key . = . $val; } if( $T3 == ){ header( Location: new_narrative.php? . $myQueryString ); } ? ~Chris /\ \ / September 11, 2001 X We Are All New Yorkers / \ rm -rf /bin/laden -- 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]
RE: [PHP] Submit
sure, have to states for your script, one is the normal blank form, the second is the check. in your check, validate the data. if its not good, print the form out again with those values already filled in if they apply. if it is good, redirect to a new page using header(); http://php.net/header be careful not to output any before you make this header call. jack -Original Message- From: Chip Landwehr [mailto:[EMAIL PROTECTED]] Sent: Sunday, October 21, 2001 8:29 PM To: [EMAIL PROTECTED] Subject: [PHP] Submit I got a form (form.php) that recalls itself when you hit submit to verify all the fields. If all the fields are good, I need it to automatically post to a new page. Anyway to do this? -- 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]
RE: [PHP] Submit
sorry chip, i'm so used to using sessions, i just kind of assumed you would :-) sessions will carry the data around.if you can't/won't use them, you could use curl to post the values along, but sessions are much more elegant for this kind of thing my $.02 jack -Original Message- From: Chip Landwehr [mailto:[EMAIL PROTECTED]] Sent: Sunday, October 21, 2001 8:39 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Submit But won't using a header kill all the form data? Thought you had to use post for that? Jack Dempsey [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... sure, have to states for your script, one is the normal blank form, the second is the check. in your check, validate the data. if its not good, print the form out again with those values already filled in if they apply. if it is good, redirect to a new page using header(); http://php.net/header be careful not to output any before you make this header call. jack -Original Message- From: Chip Landwehr [mailto:[EMAIL PROTECTED]] Sent: Sunday, October 21, 2001 8:29 PM To: [EMAIL PROTECTED] Subject: [PHP] Submit I got a form (form.php) that recalls itself when you hit submit to verify all the fields. If all the fields are good, I need it to automatically post to a new page. Anyway to do this? -- 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]
RE: [PHP] Submit
you could just declare one multidimensional array as a session var, then carry that aroundthat's easiest way i've found. jack -Original Message- From: Chip Landwehr [mailto:[EMAIL PROTECTED]] Sent: Sunday, October 21, 2001 8:43 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Submit lol NP--actually I am using sessions-Will I have to declare each form variable as a session variable to do this? Jack Dempsey [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... sorry chip, i'm so used to using sessions, i just kind of assumed you would :-) sessions will carry the data around.if you can't/won't use them, you could use curl to post the values along, but sessions are much more elegant for this kind of thing my $.02 jack -Original Message- From: Chip Landwehr [mailto:[EMAIL PROTECTED]] Sent: Sunday, October 21, 2001 8:39 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Submit But won't using a header kill all the form data? Thought you had to use post for that? Jack Dempsey [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... sure, have to states for your script, one is the normal blank form, the second is the check. in your check, validate the data. if its not good, print the form out again with those values already filled in if they apply. if it is good, redirect to a new page using header(); http://php.net/header be careful not to output any before you make this header call. jack -Original Message- From: Chip Landwehr [mailto:[EMAIL PROTECTED]] Sent: Sunday, October 21, 2001 8:29 PM To: [EMAIL PROTECTED] Subject: [PHP] Submit I got a form (form.php) that recalls itself when you hit submit to verify all the fields. If all the fields are good, I need it to automatically post to a new page. Anyway to do this? -- 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 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]
RE: [PHP] Single Form
make a php page that prints out the html, and direct the form's action to $PHP_SELF. then have some sort of test to determine if there's been a post, process the data, etc, and you're set. -Original Message- From: Srinivasan Ranganathan [mailto:[EMAIL PROTECTED]] Sent: Monday, October 22, 2001 1:20 AM To: [EMAIL PROTECTED] Subject: [PHP] Single Form Hi Instead of using a html and a php page, how can i use a single php page to process data? thanks in advance Srinivasan Ranganathan *NEW* Connect to Yahoo! Messenger through your mobile phone *NEW* Visit http://in.mobile.yahoo.com/smsmgr_signin.html -- 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]
RE: [PHP] How do i retrieve the records that are NOT linked?
if i understand you correctly, perhaps this: select * from categories a,category_user_rights b where a.name!=b.username; jack categories contains: ID, parent_ID, name users contains: username, password, name, etc category_user_rights contains: username, category_ID How do I pull everything out of categories that a given user DOES NOT have rights to? ie. every record from categories that does not have a record in category_user_rights linking it to a username such as fred Any help on this would be greatly appreciated! Thanks! Simon Kimber -- 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]
RE: [PHP] new to the list
Hey Mick, of course its ok...we've all done it that way (cept a few whose names you'll learn soon enough ;-) ) a few suggestions: 1. www.php.net has most everything you could ask for...also, if you have a function you want to learn more about, type it like this: http://www.php.net/function_name (for example, http://php.net/date ) and you'll be taken directly to that page in the manual 2. 98% of your questions are already answered. isn't that great? search the mailing list at http://marc.theaimsgroup.com/?l=php-generalr=1w=2 This'll be faster for you, save you any RTFM's, and in general reduce traffic for the list 3. don't be afraid to try things out yourself. if you want to know if something works, write a small script. take a second to think it through. you'll learn more that way than any other method. 4. www.hotscripts.com and many others have tons of php scripts...check them out to get a feel for what code really looks like best of luck, jack -Original Message- From: Mick Fitzpatrick [mailto:[EMAIL PROTECTED]] Sent: Friday, October 05, 2001 11:27 AM To: [EMAIL PROTECTED] Subject: [PHP] new to the list Hello I've just joined the list and sending this message as a test :-) I'm 'very' new to PHP and therefore here to learn ... I hope that's ok? Mick -- 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]
RE: [PHP] preg_replace
http://php.net/str_replace if you're just replacing a static string, this will be faster and easier...only use regex's when you really need them jack -Original Message- From: W. Kiecksee [mailto:[EMAIL PROTECTED]] Sent: Friday, October 05, 2001 2:17 PM To: [EMAIL PROTECTED] Subject: [PHP] preg_replace Hello! I just want to replace a string with another, but I have problems, when the string contains a [ or something similar. I just need a method to replace [cool] with text. When I use: $mustbereplaced = [cool]; $message = preg_replace(/$mustbereplaced/, hello, $message); only cool will be replaced with hello, but the [ and ] is still there. When I use $message = preg_replace(/$mustbereplaced/e, hello, $message); nothing happens. What must I change, that EVERY string will be replaced? Hope someone can help me, W. Kiecksee -- 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]
RE: [PHP] How to eliminate Warning: Undefined variable: messages
check out error reporting at php.net -Original Message- From: Sridhar Moparthy [mailto:[EMAIL PROTECTED]] Sent: Friday, October 05, 2001 2:54 PM To: [EMAIL PROTECTED] Subject: [PHP] How to eliminate Warning: Undefined variable: messages Hi All, Is these any parameter in php.ini that I need to set so that I wont get Warning: Undefined variable: xx in yyy.php on line zz messages? Thank you, Sridhar Moparthy -- 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]
RE: [PHP] accessing localtime array directly
php doesn't support automatic dereferencing of arrays, so you can't just throw the index on the back, but you could do this: $julianday = array_slice(localtime(),7,1); but then $julianday's an array...so you could wrap an array_pop around that..although it gets you your val in one line, i think it many cases, it's easier/better/more efficient to just grab the array in one line, then access and copy the val in the second line, as you did... jack -Original Message- From: John A. Grant [mailto:[EMAIL PROTECTED]] Sent: Friday, October 05, 2001 5:22 PM To: [EMAIL PROTECTED] Subject: [PHP] accessing localtime array directly In Perl I have done this: $julianday=(localtime)[7]; Is there an equivalent syntax for PHP or do I just do: $now=localtime(); $julianday=$now[7]; I don't need it - I'm just curious about the syntax. -- John A. Grant * I speak only for myself * (remove 'z' to reply) Radiation Geophysics, Geological Survey of Canada, Ottawa If you followup, please do NOT e-mail me a copy: I will read it here -- 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]
RE: [PHP] ereg checking if its only numbers
if(!preg_match(/^\d+$/,$string){ echo $string has something other than a number; } -Original Message- From: Chris Aitken [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 04, 2001 9:34 PM To: PHP General Mailing List Subject: [PHP] ereg checking if its only numbers Ive been playing around with ereg for about half an hour and having no joy because I dont really understand the medhod behind it and how it all works. But what im trying to do is check to see if a 9 digit string is all numbers and nothing else $string1 = 123456789 $string2 = 123456abc how would I check either string with an IF statement and make it continue on string 1 (ie, all numbers) and error on string 2 (not all numbers). Any suggestions ? Thanks Chris -- Chris Aitken - Administration/Database Designer - IDEAL Internet email: [EMAIL PROTECTED] phone: +61 2 4628 fax: +61 2 4628 8890 __-__ It is said that if you line up all the cars in the world end to end, some moron in a rotary will still to try and pass them -- 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]
RE: [PHP] php in css not working with IF's
nice to know demorgan's laws actually show up every now and then ;-) -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 04, 2001 12:58 AM To: Jason Dulberg Cc: [EMAIL PROTECTED] Subject: RE: [PHP] php in css not working with IF's Theoretically, either/or I'm assuming. If A isn't 10 or A isn't 9... But since A cannot be both 9 and 10 at the same time, A will *always* not be one of them. It's exactly the same as saying: if (!(A==9 AND A==10)) Obviously A cannot be both 9 and 10 at the same time so the above will be: if(!(false)) which is the same as if(true) Some people find it helpful to draw Venn diagrams of their boolean logical expressions. See http://www.lib.csub.edu/infocomp/search/boolean/venn.htm for a simple description of those. -Rasmus -- 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]
RE: [PHP] php in css not working with IF's
have you thought about a switch statement? haven't looked at your code, but that would allow you a default, and then a bunch of cases, etc... jack -Original Message- From: Jason Dulberg [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 04, 2001 1:43 AM To: Rasmus Lerdorf Cc: [EMAIL PROTECTED] Subject: RE: [PHP] php in css not working with IF's Thanks for sticking with me here and for your examples!! So basically, I need to use AND instead of OR. if (($site_style!==10) ($site_style!==9) ($site_style!==8)) { } elseif ($site_style==10) { } hrm... it didn't work. Sorry for being such a dope about this :( Jason Ok, you are clearly not following along here... ;) You have (let $site_style = A for brevity): if( A!=10 OR A!=9 OR A!=8 ) When A=10 this becomes: if( 10!=10 OR 10!=9 OR 10!=8 ) falsetrue true if( false OR true OR true ) is the same as if (true) Seriously, try drawing the Venn diagram for your expression. Or try substituting common english. if Jason is not 21 or Jason is not 20 or Jason is no 19 let him into the cool club. Say Jason is 21, is he allowed in? Sure he is, because one of the conditions for getting into the cool club is that Jason is not 20. It doesn't matter that one of the other conditions says to not let Jason in. If the people writing the rules wanted to force all the conditions to apply they would have written: if Jason is not 21 AND Jason is not 20 AND Jason is not 19, let him into the cool club. -Rasmus -- 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] venn diagram producer
think before you code...something i'm quickly learning isn't such a bad mantra so before i and others jump into this, maxim, rasmus, and anyone else following this thread/interested in it, i agree that scoping the script to a max of 3 terms is a necessary choice...any other comments/thoughts on this? go for OO? how to deal with parens, etc...just finished a parser in c++ and would like to avoid any sort of text parsing... thought i'd see others thoughts before hacking away jack -- 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]
RE: [PHP] How can I suppress my variables from showing up in the address bar?
use METHOD=POST in your form -Original Message- From: Salty Marine [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 02, 2001 1:57 PM To: [EMAIL PROTECTED] Subject: [PHP] How can I suppress my variables from showing up in the address bar? Greetings to All of You on the List: How can I suppress my variables from showing up in the address bar? I have a form that's passing information to a script of mine, via the address bar. http://foobar.com/EmailList.php3?Newsletter_ID=4732Subscription_Action=Remo ve[EMAIL PROTECTED] How can I suppress my variables from showing up in the address bar? Regards, Salty _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.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] -- 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]
RE: [PHP] bulk e-mails
check out the archives and google--there's lots of info on things like qmail,ezmlm, and the topic of bulk emails jack -Original Message- From: Tyler Longren [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 02, 2001 11:05 PM To: PHP-General Subject: [PHP] bulk e-mails Hello everyone, I have a few questions about sending bulk e-mails. We have a client who has some customers that are signing up to win a prize in a contest. These users can also join the e-mail club. What's the best way to send many, many e-mails? I don't want to send an e-mail to each individual user (that can be tough on the server). I also don't want to just make a bunch of entries in the To: header. I don't want people to be able to see who else is on the mailing list. Could I solve that problem by putting their e-mails in the bcc section of the header? Any other ideas are appreciated...thanks, Tyler Longren -- 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]
RE: [PHP] Subroutines
they're just functions function your_function($arg1,$arg2){ echo $arg1; echo $arg2; } -Original Message- From: Chris Herring [mailto:[EMAIL PROTECTED]] Sent: Sunday, September 30, 2001 2:08 AM To: php list Subject: Re: [PHP] Subroutines My bad, http://www.b000.net/code/ - Original Message - From: Chris Herring [EMAIL PROTECTED] To: php list [EMAIL PROTECTED] Sent: Sunday, September 30, 2001 1:07 AM Subject: [PHP] Subroutines I've looked through the manual (or at least searched) for subroutines, and I can't find them, there's a guy I know who made a script with custom PHP subroutines. (http://b000.net/) Anyway, I want to know how to make them. Thanks for any input. -- 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]
RE: [PHP] looping through database results
hi karl just to let you know, i believe there's a good calendar app on php.net before i knew about this though, i wrote my own. some general advice: i often take results from mysql calls and build data structures with the data. then, you always have that data available, and you can loop as many times as you want..think about making the result add the results to an array, and then use it where you need it -jack -Original Message- From: Karl Nelson [mailto:[EMAIL PROTECTED]] Sent: Sunday, September 30, 2001 5:46 PM To: [EMAIL PROTECTED] Subject: [PHP] looping through database results I'm working on a basic calendar app in PHP, but I've hit a snag. The events are stored in a MySQL database, and the goal is to have the events displayed on the correct day on the calendar. The calendar is generated through a couple of while() statements that loop through the weeks and days. I'm having trouble getting the events from the database match up with the correct days. I think the problem is that I can only loop through the database results once. The code looks something like this (lots of extraneous stuff trimmed): while ($day_of_week = 6) { while ($event_row = mysql_fetch_array($events)) { $event_day = $event_row[event_day]; if ($event_day == $day) { $event_name = $event_row[event_name]; print $event_name\n; } } } Since it seems to only loop through the while ($event_row = mysql_fetch_array($events)) statement once (instead of the 30 times I want it to loop through), I figure the issue is that after the one loop, $event_row does indeed equal mysql_fetch_array($events). So I try to unset the $event_row after the loop, but that didn't work. I even tried to make $event_row into a variable variable name. Couldn't get that to work either. I'm running PHP version 4.0.6, if that matters. thanks, Karl (feel free to cc [EMAIL PROTECTED], as I'm on the digest) -- 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]
RE: [PHP] looping through database results
Right, fetch-array just adds extra results to fetch-row. Have you tried storing your results in an array that you can then loop over later? -Original Message- From: Karl Nelson [mailto:[EMAIL PROTECTED]] Sent: Sunday, September 30, 2001 6:33 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] looping through database results Thanks for your help, Andrew, but it didn't seem to work. As I read the manual (http://www.php.net/manual/en/function.mysql-fetch-array.php), mysql_fetch_array is much like mysql_fetch_row, except that it uses the field names instead of numbers as the array key. Somebody correct me if I'm wrong... Karl Andrew Elliston wrote: Try using: while ($event_row = mysql_fetch_row($events)) instead. mysql_fetch_row will grab one row of the result array at a time, until there are no more rows. This sounds like what you want. What you were doing was grabbing the entire result array and storing them in one variable. -- 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]
RE: [PHP] select based on time/date
select * from logged_in where date_add(time_in,interval 1 hour) = now() -jack -Original Message- From: Jason Dulberg [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 25, 2001 6:08 PM To: Sheridan Saint-Michel; [EMAIL PROTECTED] Subject: RE: [PHP] select based on time/date I tried basically what you have but I got an error: $sql=select * from logged_in where time_in + interval 1 hour = now(); $result = mysql_query($sql); If it will help, here's the table structure -- looks like my structure is bit different from what I orignally posted: CREATE TABLE logged_in ( id tinyint(4) DEFAULT '0' NOT NULL auto_increment, session varchar(100) DEFAULT '0' NOT NULL, time_in varchar(50) NOT NULL, KEY id (id) ); Thanks again. __ Jason Dulberg Extreme MTB http://extreme.nas.net The problem with this is curtime returns a number in HHMMSS format and your extract returns MM so you get HHMMSS - MM which is always going to be greater than 60 unless you are running your script in the first minute of the day (ie 37 - 49). Try this instead: select * from sessions where $timein + interval 1 hour = now(); - Original Message - From: Jason Dulberg [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, September 25, 2001 2:35 PM Subject: RE: [PHP] select based on time/date I had a look at the DATE_FORMAT info on the mysql doc page and its a bit easier to understand than the CONCATS. Would I want to use the CURTIME() function since I would want to select sessions based on the hour? How would I go about combining CURTIME with the rest of my query? Theoretically, here is what I understand, please let me know whether or not I am correct: select * from sessions where (CURTIME() - EXTRACT(MINUTE FROM $timein) = 60); //where 60 is the lifespan of the session -- 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]
RE: [PHP] speechmarks
Put a slash in front of it: don't = don\'t -jack -Original Message- From: Andrew Austin [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 25, 2001 7:08 PM To: '[EMAIL PROTECTED]' Subject: [PHP] speechmarks What is the method for mySQL to surround single speechmarks as in (don't) so it will be accepted in an SQL statement. thanks in advance Andrew -- 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] ucwords added functionality?
i could roll my own, and for now will just use a str_replace after ucwords, but would it be possible to add an optional parameter to ucwords which would be an array of words to skip? i would think this would be useful to many. any thoughts? -- 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] FW: Undelivered Mail Returned to Sender
and to whoever asked this a few weeks ago, yes i'm getting this too, and yes its annoying..any possibility of deleting it from the list? -Original Message- From: Mail Delivery System [mailto:[EMAIL PROTECTED]] Sent: Sunday, September 23, 2001 11:17 PM To: [EMAIL PROTECTED] Subject: Undelivered Mail Returned to Sender This is the Postfix program at host mail.aaz-netmarketing.com. I'm sorry to have to inform you that the message returned below could not be delivered to one or more destinations. For further assistance, please send mail to postmaster If you do so, please include this problem report. You can delete your own text from the message returned below. The Postfix program [EMAIL PROTECTED]: can't create user output file. Command output: procmail: Error while writing to /var/spool/mail/dtt Reporting-MTA: dns; mail.aaz-netmarketing.com Arrival-Date: Mon, 24 Sep 2001 05:16:39 +0200 (CEST) Final-Recipient: rfc822; [EMAIL PROTECTED] Action: failed Status: 5.0.0 Diagnostic-Code: X-Postfix; can't create user output file. Command output: procmail: Error while writing to /var/spool/mail/dtt i could roll my own, and for now will just use a str_replace after ucwords, but would it be possible to add an optional parameter to ucwords which would be an array of words to skip? i would think this would be useful to many. any thoughts? -- 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]
RE: [PHP] witing for a post
not sure i follow Gianluca...the script will stay there, its not going anywhere, so why does it need to wait? it'll process whatever info is sent to it -jack -Original Message- From: Gianluca Baldo [mailto:[EMAIL PROTECTED]] Sent: Saturday, September 22, 2001 2:06 PM To: [EMAIL PROTECTED] Subject: [PHP] witing for a post Hi all - i have set up a credit card gateway interface. The gateway sends an answer to a URL (i.e. http://www.domain.com/answer.php) I pass to it with the some other data. My bank documentation is poor and the support is worst. My question is: how do I make my script at http://www.domain.com/answer.php to wait for the answer? The gateway send its answer via POST to the URL I specify but I don't know how to stay there listening for the answer. Any idea? Thanks in advance Gianluca -- ALBASOFTWARE C/ Mallorca 186 - 3º 1ª 08036 Barcelona (Spain) Tel. +34 93454009 - +34 934549324 Fax. +34 934541979 [EMAIL PROTECTED] http://www.albasoftware.com http://www.phpauction.org http://www.gianlucabaldo.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] -- 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]
RE: [PHP] Is CRON'd PHP script already running?
i'm sure there are more elegant solutions, but you could control the running of your php script via a perl script called by cronin perl check to see if the process is already running, and if so exit, else start it jack -Original Message- From: Simon Kimber [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 1:13 PM To: [EMAIL PROTECTED] Subject: [PHP] Is CRON'd PHP script already running? Hi All, I have a PHP script that i want to run every few minutes (via cron) but I only want it to run if it isn't already running. Is there something in cron itself to solve this or is there a way within PHP to detect that another instance of the current script is running and if so exit the new instance before it does anything... eg. I could have a function to use like so: if (already_running($SCRIPT_NAME)) { exit(); } Thanks in advance! Simon -- 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]
RE: [PHP] importing text file
checkout http://php.net/manual/en/function.file.php -Original Message- From: Dominica Anderson [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 2:14 PM To: [EMAIL PROTECTED] Subject: [PHP] importing text file I have a text file that is formatted as such Something - SomethingElse 4 blank lines SomethingMore 4 blank lines Something - SomethingElse 4 blank lines SomethingMore 4 blank lines and so on Anyone have any ideas on what I would use to get this into seperate records that are $Something, $SomethingElse, $SomethingMore for displaying in php or even importing into mysql? I would even go for $Something and just $SomethingMore with $Something really being $Something-$SomethingElse. I don't know if that makes sense. Any help would be greatly appreciated. __ Terrorist Attacks on U.S. - How can you help? Donate cash, emergency relief information http://dailynews.yahoo.com/fc/US/Emergency_Information/ -- 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]
RE: [PHP] mysql_pconnect()
i agree...i wish things were more like microsoft where you could search for days and never find something, and i think bill gates should really stop being involved closely with the development...i mean, where else can you find that? i wonder if he could code a hello world script in C#.. -Original Message- From: Kurth Bemis [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 19, 2001 9:38 PM To: Rasmus Lerdorf; Christian Dechery Cc: [EMAIL PROTECTED] Subject: Re: [PHP] mysql_pconnect() its barley decent :-) ~kurth We have gone to some trouble to provide decent documentation for PHP. http://www.php.net/manual/en/features.persistent-connections.php -Rasmus On Thu, 13 Sep 2001, Christian Dechery wrote: what is the real advantage or use of mysql_pconnect() ?? can I do transactions between pages or something? Cuz other than that, I don't see the point of having a persistent connection... performance maybe? _ . Christian Dechery . . Gaita-L Owner / Web Developer . . http://www.webstyle.com.br . . http://www.tanamesa.com.br -- 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]
RE: [PHP] re: array question
perhaps i'm misunderstanding you, but why not use a for loop? for($i=0;$icount($array)-1;$i++){ echo $array[$i]; } jack -Original Message- From: Scott [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 18, 2001 10:11 PM To: [EMAIL PROTECTED] Subject: [PHP] re: array question Oh, that works wonders and for the first time in 24 hours I am smiling! One more thing to make it complete. Is there a way to loop through the display of that array? In other words, I now have an array called $new_data and can call each element in the array by doing $new_data[0], etc, but I need to loop through everything in the array to display the navigation. At 08:54 PM 9/18/2001 -0400, you wrote: so then that last line in the loop should be $new_data[] = $ln; During the loop, everytime it comes to this line, $ln is added to the array new_data. Eventually, you will be able to call on the array elements by $new_data[0], $new_data[1], etc -- 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]
RE: [PHP] Counting
why not use it in your sql? select count(*) from table where foo='bar'; -Original Message- From: Max Mouse [mailto:[EMAIL PROTECTED]] Sent: Monday, September 17, 2001 5:22 PM To: php forum Subject: [PHP] Counting I'm using php/mysql. I want to be able to count the number of records that match something. I've used mysql_num_rows() and it does work, but is there a better way? Something like COUNT(*)? I've tried to use it, but all I get is Resource ID #1 or something similar. Any ideas for the best way to do this? Max -- 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]
RE: [PHP] real simple regex
you actually don't need regex... if you take a few minutes you can do it all with strpos and substr, adn it'll be faster than regex. -Original Message- From: Christian Dechery [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 11, 2001 9:32 PM To: [EMAIL PROTECTED] Subject: [PHP] real simple regex I had to write my own mail() function cuz PHP's does not work in Windows very well.. But I suck at regex and I need to get the email address from the field from that can be something like: $from = Christian Dechery [EMAIL PROTECTED]; so what I want is: the string between '' and '' or the last 'word' of the 'sentence' (for something like \Christian Dechery\ [EMAIL PROTECTED]). thanks... p.s: meu novo email é [EMAIL PROTECTED] . Christian Dechery (lemming) . http://www.tanamesa.com.br . Gaita-L Owner / Web Developer -- 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]
RE: [PHP] PHP vs. PERL (Functional Comparison)??
hallelujah...first time i've seen someone else mention here docs, and being rasmus, not a bad person to make the mention ;-) -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Monday, September 17, 2001 12:17 AM To: speedboy Cc: [EMAIL PROTECTED] Subject: Re: [PHP] PHP vs. PERL (Functional Comparison)?? ie. don't necessarily use 1 file per block, create functions that are defined in a single file and call those instead of including a new file. How do you echo your html, do you put the html in your functions and escape the double quotes? There is some extra load there echoing all the html? echo HTML? I do this: ? php stuff..? HTML stuff ? more php stuff ? I drop out of PHP mode to display raw HTML. If I have a lot of HTML with a lot of PHP variables tossed in, I do: ? $test = 'test'; $one = 'one'; echo EOF This is a $test. And here is another $one. EOF; ..more php code... ? Or sometimes simply: HTML stuff ?=$variable? and some more HTML stuff. -Rasmus -- 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]
RE: [PHP] Compiling php like C
zend encoder (www.zend.com) and there's also an opensource project...can't recall the name or link, but you can find it if you search the archives jack -Original Message- From: Kunal Jhunjhunwala [mailto:[EMAIL PROTECTED]] Sent: Saturday, September 15, 2001 3:04 AM To: [EMAIL PROTECTED] Subject: [PHP] Compiling php like C Hi, Has anyone done this to date?? I was thinking of compiling my programs for better perfomance, and of course, protect the source code. Anyone have any ideas on this issue? Regards, Kunal Jhunjhunwala -- 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]
RE: [PHP] comparing
not exactly clear on what you want, but if you want to see what you have most, you could do a count(id) where product='cola' and compare that to a count(id) where product='cd' jack -Original Message- From: Teqila MAN [mailto:[EMAIL PROTECTED]] Sent: Saturday, September 15, 2001 3:13 AM To: [EMAIL PROTECTED] Subject: [PHP] comparing Hello, What is the simple mod to compare values for example. (we have a mysql tabl e) id -- product 1-cola 2 -cola 3 - cd 4 -cd 5 - cola How to make a mysql query that wokuld print me what products i have in most. Teqilaman -- 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]
RE: [PHP] Help a newbie?
what're you uploading it to? if you're using an IIS server for production scripts, then you'd obviously want to test on IISlikewise for apache.i prefer LAMP over msoft, but to each, his/her own.. -Original Message- From: Peter Gibson [mailto:[EMAIL PROTECTED]] Sent: Sunday, August 02, 1998 3:15 AM To: [EMAIL PROTECTED] Subject: [PHP] Help a newbie? Hi! Simple question... Should I use IIS (5.0) or apache for development of PHP before I upload it? -- 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]
RE: [PHP] Compiling php like C
yeah, i definitely agree with you, i can't/won't use it, as good as it is there was that one open source project that someone mentioned here, and i believe the developer said his results were about as good as zend...try the archives... jack -Original Message- From: Kunal Jhunjhunwala [mailto:[EMAIL PROTECTED]] Sent: Saturday, September 15, 2001 3:27 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Compiling php like C I know about zend, but are there any other alternatives to it?? And isnt really compiling code. Plus it costs a bundle. Regards, Kunal Jhunjhunwala Two brothers torn apart by Chaos, while the fortress endures, the great leader will succumb , The third big war will begin when the big city is burning - - Nostradamus 1654 - Original Message - From: Jack Dempsey [EMAIL PROTECTED] To: Kunal Jhunjhunwala [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Saturday, September 15, 2001 12:54 PM Subject: RE: [PHP] Compiling php like C zend encoder (www.zend.com) and there's also an opensource project...can't recall the name or link, but you can find it if you search the archives jack -Original Message- From: Kunal Jhunjhunwala [mailto:[EMAIL PROTECTED]] Sent: Saturday, September 15, 2001 3:04 AM To: [EMAIL PROTECTED] Subject: [PHP] Compiling php like C Hi, Has anyone done this to date?? I was thinking of compiling my programs for better perfomance, and of course, protect the source code. Anyone have any ideas on this issue? Regards, Kunal Jhunjhunwala -- 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 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]