php-general Digest 16 Feb 2001 21:24:00 -0000 Issue 516 Topics (messages 40120 through 40228): Re: Count columns in array 40120 by: Tim Ward Re: True || False ? 40121 by: Tim Ward 40122 by: Maxim Maletsky 40125 by: Robin Vickery Re: PHP Editors 40123 by: Richard Kirk 40169 by: Julian Wood 40170 by: Hoover, Josh 40172 by: John Vanderbeck 40175 by: Jeff Demel 40176 by: Brian V Bonini 40222 by: Dave Goodrich 40227 by: lou How to transfer "2.2864849511949E+190" to a normal-human-readable number? 40124 by: SED 40126 by: Ben Peter 40127 by: Todd MacPherson 40128 by: Phil Driscoll 40134 by: Ben Peter 40143 by: Phil Driscoll 40168 by: Christian Reiniger Re: PHP and cookies and/or headers 40129 by: Paul Grant 40141 by: Angela 40146 by: Angela 40209 by: Jeremy Gillies SQL statement in PHP 40130 by: Matt Davis 40132 by: William N. Zanatta Re: form variables showing blank but query shows non-blank ?? 40131 by: Tim Ward Re: Still can't talk to the Oracle 40133 by: Thies C. Arntzen Re: PWS & PHP 40135 by: B Satish , Gurgaon 40136 by: TV Karthick Kumar Re: Where is Regex List of Operators? 40137 by: Christian Reiniger 40190 by: Ted Goranson 40208 by: Christian Reiniger Re: regex 40138 by: Christian Reiniger Re: zend ide & debugger 40139 by: Hidayet Dogan 40161 by: James Moore Re: @ Scope 40140 by: Christian Reiniger displaying more than one result 40142 by: Matt Davis 40145 by: Joe Sheble (Wizaerd) 40213 by: Christopher Ostmo Re: [PHP-WIN] Bug in mktime-function ? 40144 by: Boget, Chris PHP compiler 40147 by: dmalcolm 40149 by: Chris Lee 40155 by: Jim Jagielski 40223 by: dmalcolm 40225 by: dmalcolm Re: Newbie User Def Function Question 40148 by: Jeff Oien How to make text BOLD 40150 by: Nguyen, David M 40151 by: Hoover, Josh 40152 by: Joe Sheble (Wizaerd) 40156 by: kaab kaoutar 40159 by: Nguyen, David M 40162 by: Brian V Bonini 40163 by: John Vanderbeck 40164 by: DanO 40165 by: DanO cache problem 40153 by: Jan Grafström 40154 by: Chris Lee validating an e-mail address entry 40157 by: Don 40158 by: Hoover, Josh 40160 by: Hoover, Josh 40166 by: Charlie Llewellin Re: How to make text BOLD (OFF: Netscape issues) 40167 by: Hoover, Josh Sending multiple files through ftp in telnet.... PHP files that is 40171 by: Brandon Orther 40177 by: Brian V Bonini PHP Job database 40173 by: Luc Javascript running on another page 40174 by: Liam Gibbs display mor than one result. 40178 by: Matt Davis 40179 by: Joe Sheble (Wizaerd) Does anyone have experience to customize the phorum 40180 by: Fang Li 40195 by: Brian V Bonini MySQL COUNT Won't Work 40181 by: Jeff Oien 40182 by: Jon Haworth 40185 by: Javier Muniz 40186 by: Jeff Oien 40188 by: Javier Muniz 40189 by: Joe Sheble (Wizaerd) 40192 by: Jeff Oien 40194 by: Javier Muniz 40207 by: Christian Reiniger 40217 by: php3.developersdesk.com 40218 by: Andrew Rush shopping cart classes 40183 by: Randall Perry unable to jump to row 1 on MySQL result 40184 by: Augusto Cesar Castoldi require() ??? 40187 by: Maamiin 40197 by: Brandon Orther 40206 by: Maamiin Exec issue 40191 by: excalibur.hub.org counting files 40193 by: Nicholas W. Miller 40198 by: Hoover, Josh 40216 by: Andrew Rush pgp text formatting 40196 by: Nicholas W. Miller Where is my directory on server..? 40199 by: Dhaval Desai 40200 by: Matt Williams Having a heck of a time installing 40201 by: David OBrien 40205 by: Chris Moewes undefined functions question 40202 by: Mark 40203 by: Matt Williams 40219 by: Toby Butzon session heads up 40204 by: Jon Rosenberg splitting up contents of a test box 40210 by: Don New Mod-gzip 40211 by: David VanHorn PHP Code Obfuscator? 40212 by: Tiger Quimpo 40215 by: Jim Jagielski Delete from cart 40214 by: Gary Re: PHP globals aren't really globals 40220 by: php3.developersdesk.com PHP Book Recommendations 40221 by: Brian V Bonini 40224 by: Egon Schmid (.vacation) Insert AS400 - We figured it out! 40226 by: Karl J. Stubsjoen cobalt raq3 php mysql 40228 by: Nicolae Mihalache Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] ----------------------------------------------------------------------
it's important to remember that what you have here is NOT a 2d array. $array is an array, each element of which can be any sort of variable ... e.g. $array[1] = "fred"; $array[2] = Array(); $array[3] = 1.245; ... but then try ... foreach ($array as $thisarray) echo(count($thisarray) . "<br>"); ... in this case count($array[2]) = 0 but count($array[1]) = 1 ... so be careful. Tim Ward Senior Systems Engineer Please refer to the following disclaimer in respect of this message: http://www.stivesdirect.com/e-mail-disclaimer.html > -----Original Message----- > From: Fabian Fabela [mailto:[EMAIL PROTECTED]] > Sent: 15 February 2001 18:33 > To: [EMAIL PROTECTED] > Subject: Count columns in array > > > Hello, > > I have the array $array[x][y]; > > if I want to know the x I use count($array); > > Now, How can I count the y?? > > Thank you. > > Fabian Fabela > [EMAIL PROTECTED] > www.vacagorda.com > >
to take this a step further, PHP doesn't seem to have types at all try ... echo 1 + true; // gives 2 echo 1 . true; // gives 11 true is a constant that seems to equate to 1, false is 0. Or is this just my interpretation? Tim Ward Senior Systems Engineer Please refer to the following disclaimer in respect of this message: http://www.stivesdirect.com/e-mail-disclaimer.html > -----Original Message----- > From: Toby Butzon [mailto:[EMAIL PROTECTED]] > Sent: 16 February 2001 04:49 > To: Jonathan Sharp > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] True || False ? > > > Yes, you can return false. > > As for "true booleans", PHP doesn't really have a boolean > type - it does > have a sense of "true" and "not true" though. You can return false (a > case-insensitive constant with the value 0) or true (whose value is > probably 1 but could really be anything other than 0 or the empty > string). > > You can of course evaluate a true/false value as a regular > condition... > if (someFunc()) { > // do something if someFunc returns true > } else { > // do something if someFunc returns false > } > > ..You get the idea. > > --toby > > Jonathan Sharp wrote: > > > > How does php handle true and false? Do they act as true booleans? > > > > Can I do? > > > > function foo() > > { > > return false; > > } > > > > Thanks, > > -Jonathan > > > > -- > > 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] >
You are absolutely right. True = 1 False = 0 make an if statement, or echo ... Cheers, Maxim Maletsky -----Original Message----- From: Tim Ward [mailto:[EMAIL PROTECTED]] Sent: Friday, February 16, 2001 6:41 PM To: 'Toby Butzon'; Jonathan Sharp Cc: [EMAIL PROTECTED] Subject: RE: [PHP] True || False ? to take this a step further, PHP doesn't seem to have types at all try ... echo 1 + true; // gives 2 echo 1 . true; // gives 11 true is a constant that seems to equate to 1, false is 0. Or is this just my interpretation? Tim Ward Senior Systems Engineer Please refer to the following disclaimer in respect of this message: http://www.stivesdirect.com/e-mail-disclaimer.html > -----Original Message----- > From: Toby Butzon [mailto:[EMAIL PROTECTED]] > Sent: 16 February 2001 04:49 > To: Jonathan Sharp > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] True || False ? > > > Yes, you can return false. > > As for "true booleans", PHP doesn't really have a boolean > type - it does > have a sense of "true" and "not true" though. You can return false (a > case-insensitive constant with the value 0) or true (whose value is > probably 1 but could really be anything other than 0 or the empty > string). > > You can of course evaluate a true/false value as a regular > condition... > if (someFunc()) { > // do something if someFunc returns true > } else { > // do something if someFunc returns false > } > > ..You get the idea. > > --toby > > Jonathan Sharp wrote: > > > > How does php handle true and false? Do they act as true booleans? > > > > Can I do? > > > > function foo() > > { > > return false; > > } > > > > Thanks, > > -Jonathan > > > > -- > > 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]
>>>>> "MM" == Maxim Maletsky <[EMAIL PROTECTED]> writes: > >>>>> Tim Ward writes: > > > > to take this a step further, PHP doesn't seem to have types at all > > try ... > > > > echo 1 + true; // gives 2 > > echo 1 . true; // gives 11 > > > > true is a constant that seems to equate to 1, false is 0. Or is > > this just my interpretation? > You are absolutely right. True = 1 False = 0 > make an if statement, or echo ... > Cheers, Maxim Maletsky Ummm... no, PHP does have types. You can see the difference between true and 1 if you use the === operator in your if statement rather than ==. In your examples you were implicitly converting from a boolean type to an integer or a string. Try this: print gettype(true) . "<br>\n"; print gettype(0 + true) . "<br>\n"; print gettype('' . true) . "<br>\n"; -robin -- Robin Vickery................................................. BlueCarrots, 14th Floor, 20 Eastbourne Terrace, London, W2 6LE
Whilst on this theme... it there a PHP syntax file available for textpad (.syn I think). I can't see any on the textpad website. Cheers > -----Original Message----- > From: Maxim Maletsky [mailto:[EMAIL PROTECTED]] > Sent: Friday, February 16, 2001 8:18 AM > To: 'Dallas Kropka'; 'Michael McGlothlin'; Matt DeLong > Cc: [EMAIL PROTECTED] > Subject: RE: [PHP] PHP Editors > > > I know, I was a TextPad fun too untill I found EditPlus ... > It is better, at least I though so. > > Try it, it's a good alternative to TextPad ... especially for > html/css work > ... > supports PHP as well and has VERY COOL RegEx replacement and > search in files > (whether opened or in folder) > > 0.2c > > > Cheers, > Maxim Maletsky > > > > > -----Original Message----- > From: Dallas Kropka [mailto:[EMAIL PROTECTED]] > Sent: Friday, February 16, 2001 5:20 PM > To: Maxim Maletsky; 'Michael McGlothlin'; Matt DeLong > Cc: [EMAIL PROTECTED] > Subject: RE: [PHP] PHP Editors > > > > www.textpad.com > > Wonderful app, highlighting, keeps your tabs.... lots of keyboard > shortcuts.... and lots of customization. > > This is what all my developers prefer. > > > Dallas K. > > -- > 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] > >
>From Allaire's (Homesite) web page: "When InternetWorld surveyed 136 professional design firms (iXL, USWeb, Modem Media, TVisions, Organic Online, etc.) in October 1999, HomeSite was the most popular HTML tool: Allaire HomeSite - 52.9% Bare Bones BBEdit (Mac) - 42.6% Microsoft FrontPage - 22.8% Microsoft Visual InterDev - 19.1% Sausage Software HotDog - 4.4%" Granted this is over 1 year ago, and probably not the most scientific of polls, how does BBEdit garner 42.6% of the share when the Mac has only a 3-5% share of the worldwide computer market? J
I think BBEdit can get that percentage because so many people doing web development use Macs. Even though the overall marketshare for Macs is small, there is a high concentration in the web/graphics development areas. Still, those numbers Allaire shows seem a bit out of whack to me too :) Josh Hoover KnowledgeStorm, Inc. Searching for a new IT solution for your company? Need to improve your product marketing? Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can simplify the process for you. KnowledgeStorm - Your IT Search Starts Here > how does BBEdit garner 42.6% of the share when the Mac > has only a > 3-5% share of the worldwide computer market? > > J
I have Allaire and use it for web development, but i'm not happy with it. I like the APP itself, but its such a resource hog, crashes all the time, and causes other problems. - John Vanderbeck - Admin, GameDesign ----- Original Message ----- From: "Hoover, Josh" <[EMAIL PROTECTED]> To: "'Julian Wood'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, February 16, 2001 11:51 AM Subject: RE: [PHP] PHP Editors > I think BBEdit can get that percentage because so many people doing web > development use Macs. Even though the overall marketshare for Macs is > small, there is a high concentration in the web/graphics development areas. > Still, those numbers Allaire shows seem a bit out of whack to me too :) > > Josh Hoover > KnowledgeStorm, Inc. > > Searching for a new IT solution for your company? Need to improve your > product marketing? > Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can simplify > the process for you. > KnowledgeStorm - Your IT Search Starts Here > > > how does BBEdit garner 42.6% of the share when the Mac > > has only a > > 3-5% share of the worldwide computer market? > > > > J >
Homesite's never crashed once on my box, and I've been using it as my main web development environment for two years. While you're right about it taking up a lot of resources, I can run all my apps at once with no problem. Generally, I have at least eight apps up at once when I'm developing - Outlook, IE, NS, Bulletproof FTP, Homesite, SQL Enterprise Manager, SQL Query Analyzer, and Sonique (gotta have tunes). Sometimes others too, depending on what I'm doing. Stuff like Fireworks, Dreamweaver, PCAnywhere, Pythonwin, InterDev, Word, Excel, Yahoo Messenger, Shomiti Surveyor, and stuff like that. Not a problem. I'm completely happy with Homesite, myself. -Jeff -----Original Message----- From: John Vanderbeck [mailto:[EMAIL PROTECTED]] Sent: Friday, February 16, 2001 10:53 AM To: Hoover, Josh; 'Julian Wood'; [EMAIL PROTECTED] Subject: Re: [PHP] PHP Editors I have Allaire and use it for web development, but i'm not happy with it. I like the APP itself, but its such a resource hog, crashes all the time, and causes other problems. - John Vanderbeck - Admin, GameDesign ----- Original Message ----- From: "Hoover, Josh" <[EMAIL PROTECTED]> To: "'Julian Wood'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, February 16, 2001 11:51 AM Subject: RE: [PHP] PHP Editors > I think BBEdit can get that percentage because so many people doing web > development use Macs. Even though the overall marketshare for Macs is > small, there is a high concentration in the web/graphics development areas. > Still, those numbers Allaire shows seem a bit out of whack to me too :) > > Josh Hoover > KnowledgeStorm, Inc. > > Searching for a new IT solution for your company? Need to improve your > product marketing? > Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can simplify > the process for you. > KnowledgeStorm - Your IT Search Starts Here > > > how does BBEdit garner 42.6% of the share when the Mac > > has only a > > 3-5% share of the worldwide computer market? > > > > 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]
Are you using 4.5.2? It runs much smoother then 4.5.1a. Haven't had a single crash since upgrading, even with Photoshop, Illustrator, & HS all runnning at the same time. The FTP integration works much better too, no hang time while opening remote files. -Brian > -----Original Message----- > From: John Vanderbeck [mailto:[EMAIL PROTECTED]] > Sent: Friday, February 16, 2001 11:53 AM > To: Hoover, Josh; 'Julian Wood'; [EMAIL PROTECTED] > Subject: Re: [PHP] PHP Editors > > > I have Allaire and use it for web development, but i'm not happy > with it. I > like the APP itself, but its such a resource hog, crashes all the > time, and > causes other problems. > > - John Vanderbeck > - Admin, GameDesign > > ----- Original Message ----- > From: "Hoover, Josh" <[EMAIL PROTECTED]> > To: "'Julian Wood'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Friday, February 16, 2001 11:51 AM > Subject: RE: [PHP] PHP Editors > > > > I think BBEdit can get that percentage because so many people doing web > > development use Macs. Even though the overall marketshare for Macs is > > small, there is a high concentration in the web/graphics development > areas. > > Still, those numbers Allaire shows seem a bit out of whack to me too :) > > > > Josh Hoover > > KnowledgeStorm, Inc. > > > > Searching for a new IT solution for your company? Need to improve your > > product marketing? > > Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can > simplify > > the process for you. > > KnowledgeStorm - Your IT Search Starts Here > > > > > how does BBEdit garner 42.6% of the share when the Mac > > > has only a > > > 3-5% share of the worldwide computer market? > > > > > > 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] > >
BBedit gets that share because I know people who use a Mac for development, just for BBedit. Regx, ftp, custom tags, volume wide search and replace, glossaries, scriptable and attachable, syntax checking, syntax coloring (html, css, js, php, c, c++, java) entity conversion (both ways), spell checking - multiple dictionary, preview, works across external mounted volumes, (I've had 80+ windows open at one time), project organization, built-in and customizable templates, stationary, diffs, site aware, dos-unix-mac line ending conversion, state aware (remembers window placement and individual page properties), etc, etc, etc. The only reason I have a Mac on my desk is for Bbedit. Hoping they port to OSX and allow it to run on my FBSD box. DAve -- Dave Goodrich Director of Interface Development Reality Based Learning Company 9521 NE Willows Road, Suite 100 Redmond, WA 98052 Toll Free 1-877-869-6603 ext. 237 Fax (425) 558-5655 [EMAIL PROTECTED] http://www.rblc.com > From: "Hoover, Josh" <[EMAIL PROTECTED]> > Date: Fri, 16 Feb 2001 11:51:16 -0500 > To: 'Julian Wood' <[EMAIL PROTECTED]>, [EMAIL PROTECTED] > Subject: RE: [PHP] PHP Editors > > I think BBEdit can get that percentage because so many people doing web > development use Macs. Even though the overall marketshare for Macs is > small, there is a high concentration in the web/graphics development > areas. > Still, those numbers Allaire shows seem a bit out of whack to me too :) > > Josh Hoover > KnowledgeStorm, Inc. > > Searching for a new IT solution for your company? Need to improve your > product marketing? > Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can > simplify > the process for you. > KnowledgeStorm - Your IT Search Starts Here > >> how does BBEdit garner 42.6% of the share when the Mac >> has only a >> 3-5% share of the worldwide computer market? >> >> J >
Also... Bbedit was bundled with dreamweaver for the longest time. Maybe still... > BBedit gets that share because I know people who use a Mac for development, > just for BBedit. > > Regx, ftp, custom tags, volume wide search and replace, glossaries, > scriptable and attachable, syntax checking, syntax coloring (html, css, js, > php, c, c++, java) entity conversion (both ways), spell checking - multiple > dictionary, preview, works across external mounted volumes, (I've had 80+ > windows open at one time), project organization, built-in and customizable > templates, stationary, diffs, site aware, dos-unix-mac line ending > conversion, state aware (remembers window placement and individual page > properties), etc, etc, etc. > > The only reason I have a Mac on my desk is for Bbedit. Hoping they port to > OSX and allow it to run on my FBSD box. > > DAve > > -- > Dave Goodrich > Director of Interface Development > Reality Based Learning Company > 9521 NE Willows Road, Suite 100 > Redmond, WA 98052 > Toll Free 1-877-869-6603 ext. 237 > Fax (425) 558-5655 > [EMAIL PROTECTED] > http://www.rblc.com > > >> From: "Hoover, Josh" <[EMAIL PROTECTED]> >> Date: Fri, 16 Feb 2001 11:51:16 -0500 >> To: 'Julian Wood' <[EMAIL PROTECTED]>, [EMAIL PROTECTED] >> Subject: RE: [PHP] PHP Editors >> >> I think BBEdit can get that percentage because so many people doing web >> development use Macs. Even though the overall marketshare for Macs is >> small, there is a high concentration in the web/graphics development >> areas. >> Still, those numbers Allaire shows seem a bit out of whack to me too :) >> >> Josh Hoover >> KnowledgeStorm, Inc. >> >> Searching for a new IT solution for your company? Need to improve your >> product marketing? >> Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can >> simplify >> the process for you. >> KnowledgeStorm - Your IT Search Starts Here >> >>> how does BBEdit garner 42.6% of the share when the Mac >>> has only a >>> 3-5% share of the worldwide computer market? >>> >>> J >> >
Hi, I'm multiplying floating numbers: $result = $foo * $boo; and the result is like this: echo "$result"; And the result is like this: 2.2864849511949E+190 How can I transfer this to normal-human-readable number? Regards, Sumarlidi Einar Dadason SED - Graphic Design ------------------------------------------ Phone: (+354) 4615501 Mobile: (+354) 8960376 Fax: (+354) 4615503 E-mail: [EMAIL PROTECTED] Homepage: www.sed.is <- New Homepage! ------------------------------------------
Hi, I tried <? $foo = 2.2864849511949E+190; settype($foo,"double"); printf("%d\n", $foo) ?> which gave me -2147483648 echo $foo gives 2.2864849511949E+190 - This looks like the number is too large for printf (the 'human readable form' printed by printf is abviously wrong). Does anybody know such of limits to sprintf? Ben SED wrote: > > Hi, > > I'm multiplying floating numbers: > > $result = $foo * $boo; and the result is like this: > > echo "$result"; > > And the result is like this: > > 2.2864849511949E+190 > > How can I transfer this to normal-human-readable number? > > Regards, > Sumarlidi Einar Dadason > > SED - Graphic Design > > ------------------------------------------ > Phone: (+354) 4615501 > Mobile: (+354) 8960376 > Fax: (+354) 4615503 > E-mail: [EMAIL PROTECTED] > Homepage: www.sed.is <- New Homepage! > ------------------------------------------ > > -- > 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]
$ result = Round($foo * $boo) Todd From: "SED" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: February 16, 2001 7:15 AM Subject: [PHP] How to transfer "2.2864849511949E+190" to a normal-human-readable number? > Hi, > > I'm multiplying floating numbers: > > $result = $foo * $boo; and the result is like this: > > echo "$result"; > > And the result is like this: > > 2.2864849511949E+190 > > How can I transfer this to normal-human-readable number? > > > Regards, > Sumarlidi Einar Dadason > > SED - Graphic Design > > ------------------------------------------ > Phone: (+354) 4615501 > Mobile: (+354) 8960376 > Fax: (+354) 4615503 > E-mail: [EMAIL PROTECTED] > Homepage: www.sed.is <- New Homepage! > ------------------------------------------ > > -- > 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] > >
You are working with VERY large numbers here. I would have said that the number is as good as you'll get in terms of human readability unless you want to see nearly 200 zeroes on the screen. That said, I'm not sure how much use such large numbers will be to you, as when represented as floating point, the inaccuracies are phenomenal - you can't really expect to do any useful calculations with the numbers, and you're not too far away from banging into numeric overflows. It would be interesting to know what you are doing! Cheers -- Phil Driscoll Dial Solutions +44 (0)113 294 5112 http://www.dialsolutions.com http://www.dtonline.org
Hi, have to correct that (thanks to Adam Whitehead for pointing out). It should be %f instead of %d. However: '<? $foo = 2.2864849511949E+190; settype($foo,"double"); printf("%f\n", $foo) ?>' | php -q 2286484951194899000000000000000000000000000000000000000000000000000000000000000 Segmentation fault (core dumped) [ben@home ben]$ This is PHP4.0.4pl1 Ben Ben Peter wrote: > > Hi, > > I tried > > <? $foo = 2.2864849511949E+190; settype($foo,"double"); printf("%d\n", > $foo) ?> > > which gave me > > -2147483648 > > echo $foo gives > > 2.2864849511949E+190 > > - This looks like the number is too large for printf (the 'human > readable form' printed by printf is abviously wrong). > > Does anybody know such of limits to sprintf? > > Ben > > SED wrote: > > > > Hi, > > > > I'm multiplying floating numbers: > > > > $result = $foo * $boo; and the result is like this: > > > > echo "$result"; > > > > And the result is like this: > > > > 2.2864849511949E+190 > > > > How can I transfer this to normal-human-readable number? > > > > Regards, > > Sumarlidi Einar Dadason > > > > SED - Graphic Design > > > > ------------------------------------------ > > Phone: (+354) 4615501 > > Mobile: (+354) 8960376 > > Fax: (+354) 4615503 > > E-mail: [EMAIL PROTECTED] > > Homepage: www.sed.is <- New Homepage! > > ------------------------------------------ > > > > -- > > 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]
Well, the numbers are a bit silly for doing this sort of thing, but the seg fault is clearly a bug! Can you report it please. (bugs.php.net) Thanks -- Phil Driscoll Dial Solutions +44 (0)113 294 5112 http://www.dialsolutions.com http://www.dtonline.org -----Original Message----- From: Ben Peter <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>; [EMAIL PROTECTED] <[EMAIL PROTECTED]> Date: Friday, February 16, 2001 12:34 PM Subject: Re: [PHP] How to transfer "2.2864849511949E+190" to a normal-human-readable number? >Hi, > >have to correct that (thanks to Adam Whitehead for pointing out). > >It should be %f instead of %d. However: > >'<? $foo = 2.2864849511949E+190; settype($foo,"double"); printf("%f\n", >$foo) ?>' | php -q >228648495119489900000000000000000000000000000000000000000000000000000000000 0000 >Segmentation fault (core dumped) >[ben@home ben]$ > >This is PHP4.0.4pl1 > >Ben > >Ben Peter wrote: >> >> Hi, >> >> I tried >> >> <? $foo = 2.2864849511949E+190; settype($foo,"double"); printf("%d\n", >> $foo) ?> >> >> which gave me >> >> -2147483648 >> >> echo $foo gives >> >> 2.2864849511949E+190 >> >> - This looks like the number is too large for printf (the 'human >> readable form' printed by printf is abviously wrong). >> >> Does anybody know such of limits to sprintf? >> >> Ben >> >> SED wrote: >> > >> > Hi, >> > >> > I'm multiplying floating numbers: >> > >> > $result = $foo * $boo; and the result is like this: >> > >> > echo "$result"; >> > >> > And the result is like this: >> > >> > 2.2864849511949E+190 >> > >> > How can I transfer this to normal-human-readable number? >> > >> > Regards, >> > Sumarlidi Einar Dadason >> > >> > SED - Graphic Design >> > >> > ------------------------------------------ >> > Phone: (+354) 4615501 >> > Mobile: (+354) 8960376 >> > Fax: (+354) 4615503 >> > E-mail: [EMAIL PROTECTED] >> > Homepage: www.sed.is <- New Homepage! >> > ------------------------------------------ >> > >> > -- >> > 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] > >
On Friday 16 February 2001 12:33, Ben Peter wrote: > It should be %f instead of %d. However: > > '<? $foo = 2.2864849511949E+190; settype($foo,"double"); printf("%f\n", > $foo) ?>' | php -q > 22864849511948990000000000000000000000000000000000000000000000000000000 >00000000 Segmentation fault (core dumped) Well, I *can* understand that printf () isn't prepared to handle numbers with 190 digits :) > > > 2.2864849511949E+190 > > > > > > How can I transfer this to normal-human-readable number? Well, I doubt that 2286484951194899000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 is more human-readable than 2.2864849511949E+190 Perhaps you want to change it to 2.2864849511949 * 10^190 But I'd say adding a note explaining the "E" notation is simpler... PS: The long number is, scientifically seen, also *less* correct than the 'E' form - the 'E' form states that it is a number with a precision of 16 digits, while the long one implies that it has a precision of 190 digits (which is definitely wrong). -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "World domination. Fast." (Linus Torvalds about Linux)
Jeremy, I think there might be a JavaScript solution rather than a PHP solution to your problem. Depending on which link, either www.english.com or www.francais.com, the users click from www.mainurl.com you can set a cookie with JavaScript. Of course this cookie will 'remember' the user's initial language choice not the language of the page they finished on, but if the users don't swapping over and back between languages this shouldn't be a problem. Also as JavaScript is a client-side scripting language, which can be switched off, it is not 100% reliable but then neither are cookies! Paul Grant > -----Original Message----- > From: Jeremy Gillies [SMTP:[EMAIL PROTECTED]] > Sent: 15 February 2001 21:54 > To: '[EMAIL PROTECTED]' > Subject: [PHP] PHP and cookies and/or headers > > Greetings, > > Is anyone REALLY familiar with PHP and cookies and/or headers-- I have a > tough nut to crack and it involves three URLs. > > Here is the situation, and I really want to avoid using our DB if I can. > > I have a main URL that everyone will probably hit - splash page. > www.mainurl.com > > From there, users go into either the french or english version of the site > with two unique URLs... > > www.english.com > www.francais.com > > I want it so that if users go back to the splash page, it will pick up > their > language preference (french or english) and send them to the index page of > either www.english.com or www.francais.com -- depending upon the last > argument set when they were last at the site. So, if they ended on an > english page, they would start at the english index page, but if the > finished on a french page, they would start on the french index page. > > The problem with cookies is the fixed URL from which they can be read. > Obviously www.mainurl.com cannot read a cookie set by www.francais.com -- > so > how can I over come this. > > I suppose I could do it via IP stored in a DB, but even then there is a > problem as people who hide behind one IP -- say a large business -- > would be stuck using each others' preferences depending upon who used the > site last. > > I also do not want the user to have to type in a code word so that the > IP is tagged with a special identifier. I suppose I could use a random > number generated from a time stamp... but I really want to avoid using a > DB! > -- mostly for speed and bloat of page size reasons. > > Thanks in advance! > Jeremy > > -- > 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] The information contained in this e-mail is confidential, may be privileged and is intended only for the use of the recipient named above. If you are not the intended recipient or a representative of the intended recipient, you have received this e-mail in error and must not copy, use or disclose the contents of this email to anybody else. If you have received this e-mail in error, please notify the sender immediately by return e-mail and permanently delete the copy you received. This email has been swept for computer viruses. However, you should carry out your own virus checks. Registered in Ireland, No. 205721. http://www.FINEOS.com
On your splash page, instead of having it send the user directly to either the english or french site, first have it send to another page on that domain along with a variable to tell it whether it's english or french. For example, the English button would be linked to "setcookie.php?Language=English" and the French button would be linked to "setcookie.php?Language=Francais". On the setcookie.php page, use an if statement to determine which language they chose, then inside of it set the cookie then redirect them to the language site of their choice. For example: <? if($Language=="English"){ setcookie("Language", "$Language"); header("location: http://www.english.com"); }else{ setcookie("Language", "$Language"); header("location: http://www.francais.com"); } ?> Then on your home page, you would have it check for these cookies: <? if($Language=="English"){ header("location: http://www.english.com"); }elseif($Language=="Francais"){ header("location: http://www.francais.com"); }else{ show_the_choice_page(); } ?> I think this would be the best solution. Let me know if anybody comes up with anything better. -Angela -- Angela Curtis Internet Programmer Innovative Business Consultants http://www.ibc2001.com
After reading through the setcookie page on php.net, I found out that for some reason it won't let you redirect to a different site after setting the cookie. So, as a fix, change the headers on the setcookie.php page to redirect to the index page, and let the index page take care of the redirecting. -Angela -------- Original Message -------- Subject: Re: PHP and cookies and/or headers Date: Fri, 16 Feb 2001 08:57:23 -0500 From: Angela <[EMAIL PROTECTED]> To: Jeremy Gillies <[EMAIL PROTECTED]>,[EMAIL PROTECTED] On your splash page, instead of having it send the user directly to either the english or french site, first have it send to another page on that domain along with a variable to tell it whether it's english or french. For example, the English button would be linked to "setcookie.php?Language=English" and the French button would be linked to "setcookie.php?Language=Francais". On the setcookie.php page, use an if statement to determine which language they chose, then inside of it set the cookie then redirect them to the language site of their choice. For example: <? if($Language=="English"){ setcookie("Language", "$Language"); header("location: http://www.english.com"); }else{ setcookie("Language", "$Language"); header("location: http://www.francais.com"); } ?> Then on your home page, you would have it check for these cookies: <? if($Language=="English"){ header("location: http://www.english.com"); }elseif($Language=="Francais"){ header("location: http://www.francais.com"); }else{ show_the_choice_page(); } ?> I think this would be the best solution. Let me know if anybody comes up with anything better. -Angela -- Angela Curtis Internet Programmer Innovative Business Consultants http://www.ibc2001.com
angela, this would work if people did not switch back and forth between langauges. We have many bilingual users who want print copies, for example, in french and english. Each time they click a little tab at the top, it will switch languages and sites too, BUT will remain with the corresponding text in the other language. thank you for your help so far, jeremy > -----Original Message----- > From: Angela [mailto:[EMAIL PROTECTED]] > Sent: Friday, February 16, 2001 8:57 AM > To: Jeremy Gillies; [EMAIL PROTECTED] > Subject: Re: PHP and cookies and/or headers > > > On your splash page, instead of having it send the user > directly to either the english or > french site, first have it send to another page on that > domain along with a variable to > tell it whether it's english or french. For example, the > English button would be linked > to "setcookie.php?Language=English" and the French button > would be linked to > "setcookie.php?Language=Francais". On the setcookie.php > page, use an if statement to > determine which language they chose, then inside of it set > the cookie then redirect them > to the language site of their choice. For example: > > <? > if($Language=="English"){ > setcookie("Language", "$Language"); > header("location: http://www.english.com"); > }else{ > setcookie("Language", "$Language"); > header("location: http://www.francais.com"); > } > ?> > > Then on your home page, you would have it check for these cookies: > > <? > if($Language=="English"){ > header("location: http://www.english.com"); > }elseif($Language=="Francais"){ > header("location: http://www.francais.com"); > }else{ > show_the_choice_page(); > } > ?> > > I think this would be the best solution. Let me know if > anybody comes up with anything > better. > -Angela > > -- > Angela Curtis > Internet Programmer > Innovative Business Consultants > http://www.ibc2001.com >
Can anybody help with this If I put the following statement in PHP my browser tells me that there is an error on the line. //create sql statement $sql = "select Business_Name,Trading_Details where Business_Type = "Consultancy" and Bassingbourn != "0" from Main"; If I remove where Business_Type = "Consultancy" and Bassingbourn != "0" It work fine, but no variation of the above line works. Am I missing something really obvious. Please help as I am very quickly becoming bald. Matt.
Matt, Maybe the mistake is at the quotes... Just replace the double quotes inside the select statement by single quotes... Try something like: <snip code> $sql = "select Business_Name,Trading_Details where Business_Type='Consultancy' and Bassingbourn != '0' from Main"; </snip code> ^ ^ ^ ^ Matt Davis wrote: > > Can anybody help with this > > If I put the following statement in PHP my browser tells me that there is an > error on the line. > > //create sql statement > $sql = "select Business_Name,Trading_Details where Business_Type = > "Consultancy" and Bassingbourn != "0" from Main"; > > If I remove > > where Business_Type = "Consultancy" and Bassingbourn != "0" > > It work fine, but no variation of the above line works. Am I missing > something really obvious. Please help as I am very quickly becoming bald. > > Matt.
I think we need to see the form. It sounds like something is going wrong there. Tim Ward Senior Systems Engineer Please refer to the following disclaimer in respect of this message: http://www.stivesdirect.com/e-mail-disclaimer.html > -----Original Message----- > From: Andre Bajew [mailto:[EMAIL PROTECTED]] > Sent: 16 February 2001 05:57 > To: [EMAIL PROTECTED] > Subject: form variables showing blank but query shows non-blank ?? > > > Hi, > > I have a form that has 4 variables, one, $pass_category, > being a select > list. The form posts a php script. Once inside the PHP script > if I have not > selected one of the select list variables the value should be > blank. If I > echo this out the value shows as blank. However, I later > check the value of > the passed select list variable and it passes a "if > "" > test which has me > baffled. I don't have this problem with my three other > variables that are > just form fields versus a select list. Am I missing something > basic or ?? > What I'm doing here is building a SQL statement based on form > variables. A > snippet of the script is below. > > I'd sincerely appreciate any help or guidance!! > Andre > <?php > > mysql_close; > > $pass_category = $HTTP_POST_VARS["form_cat"]; > > $pass_company = $HTTP_POST_VARS["form_company"]; > > $pass_contact = $HTTP_POST_VARS["form_contact"]; > > $pass_sort = $HTTP_POST_VARS["form_sort"]; > > if ($debug =="y") > > { > > echo "Pass_category=$pass_category<br>"; /* This shows as blank */ > > echo "Pass_company=$pass_company<br>"; > > echo "Pass_contact=$pass_contact<br>"; > > echo "Pass_sort=$pass_sort<br>"; > > } > > $db = mysql_pconnect("mysql1:katychamber.com", "katyc2", "katyc2"); > > ............... > > ............... > > if ($pass_category > "") $sql2 = $sql2 . " and cat = > '$pass_category' "; > /* this statement passes this test even though it appears to > be blank */ > > ............... > > > >
On Thu, Feb 15, 2001 at 06:43:41PM -0600, Richard Lynch wrote: > ----- Original Message ----- > From: Kristofer Widholm <[EMAIL PROTECTED]> > Newsgroups: php.general > Sent: Tuesday, February 13, 2001 5:29 PM > Subject: [PHP] Still can't talk to the Oracle > > > > I'm setting up a back end production system for a television show, > > and have been given space on a development server with PHP 4 and > > Oracle support compiled in (but not the OCI libraries). The Oracle > > admin have given me my user name (let's say ora_user), a TNS name > > (tns_name), and a password (ora_pass). > > > > So I write code as follows... > > You may need to set ORACLE_HOME etc in PHP's environment: > > SetEnv("ORACLE_HOME=/path/to/oracle/home/dir"); > SetEnv("ORACLE_GOD_KNOWS_WHAT_ELSE=/oracle/changes/it/every/release"); it is highly recommented to set _all_ oracle related env-vars _before_ you start apache and _not_ in you script! tc
Dear sir i am working on windows NT PC and i want to run PHP programs on that and i have Personal Web server in my Pc. to run PHP Applications what should i need to download? some sort of PHP compiler or intepreter to compile and execute. can you please suggest me the name of that and the url's . Thanks in advace > This has been extensively covered in a step by step process in the PHP > Manual Installation Chapter > > http://www.php.net/manual/en/install.iis.php > > follow the steps and you will have php working just fine with PWS > > best regards > > Ankur Verma > HCL Technologies > A1CD, Sec -16 > Noida, UP > India > > > ----- Original Message ----- > From: "kaab kaoutar" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Thursday, February 15, 2001 5:00 PM > Subject: [PHP] PWS & PHP > > > > > > Hi! > > How can i make my web server PWS parse html file into PHP? cause it > shows > > nothing when i include php in an html file.However it works when i put > it > in > > a php file ! > > Thanks > > > > > _________________________________________________________________________ > > Get Your Private, Free E-mail from MSN Hotmail at > http://www.hotmail.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]
Hi First you have to down the NT version of php from php.net and also configure it and make it work. Then if you want any database to be working with it, then you should also download mysql from mysql.com and start the server and try to connect to mysql from php. Then you are done and you can thereafter go ahead with your programming. Also look at tutorials and mail archives at: hotwired.com devshed.com mysql.com php.net phpbuilder.com marc.theaimsgroup.com webmonkey.com zdnet.com and many more.. Hope this helps. ~ Karthick ----- Original Message ----- From: B Satish , Gurgaon <[EMAIL PROTECTED]> To: Ankur Verma <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, February 16, 2001 12:52 PM Subject: RE: [PHP] PWS & PHP > > > > Dear sir > > i am working on windows NT PC and i want to run PHP programs on that > and i have Personal Web server in my Pc. > to run PHP Applications what should i need to download? > some sort of PHP compiler or intepreter to compile and execute. > can you please suggest me the name of that and the url's . > > > Thanks in advace > > This has been extensively covered in a step by step process in the PHP > > Manual Installation Chapter > > > > http://www.php.net/manual/en/install.iis.php > > > > follow the steps and you will have php working just fine with PWS > > > > best regards > > > > Ankur Verma > > HCL Technologies > > A1CD, Sec -16 > > Noida, UP > > India > > > > > > ----- Original Message ----- > > From: "kaab kaoutar" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Cc: <[EMAIL PROTECTED]> > > Sent: Thursday, February 15, 2001 5:00 PM > > Subject: [PHP] PWS & PHP > > > > > > > > > > Hi! > > > How can i make my web server PWS parse html file into PHP? cause it > > shows > > > nothing when i include php in an html file.However it works when i put > > it > > in > > > a php file ! > > > Thanks > > > > > > > > _________________________________________________________________________ > > > Get Your Private, Free E-mail from MSN Hotmail at > > http://www.hotmail.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] > >
On Friday 16 February 2001 07:17, Ted Goranson wrote: > >If it's not possible to use PCREs, the above links (particularly the > > first) whould contain details for just about anything you may need to > > do with POSIX REs. > > Christopher-- > > Thanks so much for the URLs but they are hardly complete and not at > all succinct. I supposed the POSIX REs because that's what I thought > the PHP docs said. PCREs are good too? Sure seems like the PHP docs > would include this don't you think? They do. See "Regular expression functions (Perl compatible)". -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) What luck for the rulers that men do not think. - Adolf Hitler
>On Friday 16 February 2001 07:17, Ted Goranson wrote: > > > >If it's not possible to use PCREs, the above links (particularly the > > > first) whould contain details for just about anything you may need to > > > do with POSIX REs. > > > > Christopher-- > > > > Thanks so much for the URLs but they are hardly complete and not at > > all succinct. I supposed the POSIX REs because that's what I thought > > the PHP docs said. PCREs are good too? Sure seems like the PHP docs > > would include this don't you think? > >They do. See "Regular expression functions (Perl compatible)". Let me rephrase: --I interpreted the PHP manual to suggest POSIX over Perl. Minor comment. --I believe the PHP docs should include a comprehensive, succinct list of regex expressions. Major comment. It was about this that I was saying "Sure seems like the PHP docs would include this don't you think?" Sorry for the confusion. Best, Ted _____________ Ted Goranson Fusecap and Sirius-Beta, Virginia Beach USA 757/426-6704 [EMAIL PROTECTED] Symmetry Conference: http://www.isis-s.unsw.edu.au
On Friday 16 February 2001 18:48, Ted Goranson wrote: > > > Thanks so much for the URLs but they are hardly complete and not > > > at all succinct. I supposed the POSIX REs because that's what I > > > thought the PHP docs said. PCREs are good too? Sure seems like the > > > PHP docs would include this don't you think? > > > >They do. See "Regular expression functions (Perl compatible)". > Let me rephrase: > > --I interpreted the PHP manual to suggest POSIX over Perl. Minor > comment. Hmm. Minor comment on this from me: I don't see any preference in the manual. > --I believe the PHP docs should include a comprehensive, succinct > list of regex expressions. Major comment. It was about this that I > was saying "Sure seems like the PHP docs would include this don't you > think?" Well, What I meant was: In the Perl-regexp section of the manual there is a detailed document on the Perl regexp syntax. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Nothing is more dangerous than an idea if it's the only one you have. - Emil-Auguste Chartier, "Propos sur la religion", 1938
On Thursday 15 February 2001 22:43, Jerry Lake wrote: > is there a way I can make a regex to add a comma > to the beginning of every line of a comma delimited > file ? $NewContent = preg_replace ('/^(.)/m', ',\\1', $OldContent); -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) What luck for the rulers that men do not think. - Adolf Hitler
PHPEd now supports debugger and still free :) > 1-month commercial license ($90). > > Download wasn't too bad. I haven't had a chance to check out the Zend > LaunchPad. The installation (Apache Linux PHP 4.04pl1+patches) took me about > 30 minutes for client and server which included the wait on the license key. > It took us another day to put up because there is no mention that the > debugger doesn't work with the optimizer on. Zend customer service fixed > that though. > > The IDE is pretty nice. Startup (Windows version through Samba) takes a > long time and there are still some crashing issues. It's nowhere near as > spry as PHPEd but we're talking about a integrated debugger. The interface > is Swing-based as near as I can tell and my main gripe besides the speed is > I can't use the scroll wheel. It still crashes a bunch (not sure if it's the > debugger or what). I passed it off to an engineer so I can't comment > further. (He's having trouble getting it to recognize the include files. > Anyone have a tip?) > > BTW, the debugger has a browser mode, it sends off some codes in a the > get string of the URL. I didn't test it. > > Some people like source level debuggers and I think it's a good tool > especially considering all the headaches Nexidion Designer gave us a while > back. Personally, the last time I used a debugger, I was making a calculator > using an 80186 (the debugger was a hardware one the size of two coffee table > books stacked next to each other) so obviously I never got used to them. If > you come from the Boreland C/Visual Studio world, I suppose you might find > the IDE essential. If my engineers ever use it, I'll get the company to > spring for a license or 5. > > Take care, > > terry > > -- > terry chay, Director of Engineering, <http://www.QIXO.com/> > QIXO /kick.so/ - Integrating Many Travel Web Sites Into One > W: 1.408.394-8102 F:1.408.516.9090 M: 1.408.314.0717 > E-Mail: <mailto:[EMAIL PROTECTED]> ICQ: 16069322 > PGP Fingerprint: 6DCF 1634 547C 935D 4912 2A44 A4A2 79AB DFFF F110 > > > -- > 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] >
> > > > The IDE is pretty nice. Startup (Windows version through > Samba) takes a > > long time and there are still some crashing issues. Have you reported these if the happen consistenly Im sure the Zend folk would love to hear about them so that they can fix them.. > > It's nowhere near as > > spry as PHPEd but we're talking about a integrated debugger. We are talking about Java and C/C++ or whatever phped is written in, Java will be slower but then you can use it on nearly any platform. > > I can't use the scroll wheel. Java does not support this very well yet at all but maybe the Zend folks will sort this for a future version the 1.4 JRE should support this... > > I passed it off to an engineer so I can't comment > > further. (He's having trouble getting it to recognize the include files. > > Anyone have a tip?) Include files must be on the webserver in the same dir as dummy.php or your include path, personally this is slightly annonying but maybe we will see this fixed in a future version.. James
On Friday 16 February 2001 04:19, Maxim Maletsky wrote: > It will escape the error ... or better say you force the function to > always return true. [...] > $where = @where($user); > > this will always return true no matter what happen Bullshit (sorry. I just *had* to say this :). From the manual: When prepended to an expression in PHP, any error messages that might be generated by that expression will be ignored. It talks about error "messages". The return value isn't affected in any way. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) What luck for the rulers that men do not think. - Adolf Hitler
I have a php script which runs a query and then outputs the results in to html. The html should repeat itself depending on the number of results. i.e to produce search results. I know that my current query should return 5 results however it is only show the last one. Is there something I need to do to show all my results. Matt.
it's be a bit more helpful if we can see the code you're using to display your results... At 02:15 PM 2/16/01 +0000, Matt Davis wrote: >I have a php script which runs a query and then outputs the results in to >html. The html should repeat itself depending on the number of results. i.e >to produce search results. > >I know that my current query should return 5 results however it is only show >the last one. Is there something I need to do to show all my results. > >Matt. > > >-- >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]
Matt Davis pressed the little lettered thingies in this order... > I have a php script which runs a query and then outputs the results in to > html. The html should repeat itself depending on the number of results. i.e > to produce search results. > > I know that my current query should return 5 results however it is only > show the last one. Is there something I need to do to show all my results. > It sounds like you're ending your loop too soon. Something like: $result=mysql("DB","query"); while ($row = mysql_fetch_row($result)) { $var = $row[0]; } echo $var; This causes the while() loop to perform and on each loop (each result), the value of $var gets replaced with the next value. When you do this and you cause the loop to exit, you will only see the last value of $var (the last result from the query). Try placing the "echo $var;" portion within the curly braces. This will cause the value of $var to be echoed for each result. If I'm wrong, you'll need to send the code you are trying to use for anyone to be of much help. Good luck... Christopher Ostmo a.k.a. [EMAIL PROTECTED] AppIdeas.com For a good time, http://www.AppIdeas.com/
> This is the output I get running 4.0.4pl1 or 3.0.17 on Win98/Apache > Using 3/9/1935 > Unix timestamp for this date is -1 This is what I get: Using 3/9/1935 Unix timestamp for this date is -1098727200 Reconverting... March 09, 1935 > Warning: unexpected error in date() in on line 13 > Reconverting... > What platform r u using? Unix/Apache. Right now, we are using PHP Version 4.0.3pl1, but this code worked even as far back as version 3.0.5 (which is what we were using before we upgraded to 4.x). Chris
Is there such a thing as a PHP compiler? Linux based? Windoze based? Thanks in advance. DM
Zend Technologies has an encoder, might be what your looking for, might not. why do you want to compile your code, you havent mentioned ? -- Chris Lee Mediawaveonline.com em. [EMAIL PROTECTED] ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 "dmalcolm" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > Is there such a thing as a PHP compiler? Linux based? Windoze based? > > Thanks in advance. > > DM > > > > > -- > 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] >
At 9:10 AM -0600 2/16/01, dmalcolm wrote: >Is there such a thing as a PHP compiler? Linux based? Windoze based? > >Thanks in advance. > Depends on what you mean by a compiler. If you mean a "package" that turns your PHP script into a 100% stand-alone binary executable then No, there isn't. If you mean a package that allows you to turn your text-based source into something that you can distribute and have people run, without giving out the source, then the Zend Encoder will fit the bill. Recall that it's the Zend Engine that (internally) does the compilation into an executable form in PHP 4, so to create a standalone binary, you would need the full PHP 4 and Zend Engine "binary" functionality in the final executable as well :) -- Jim Jagielski <[EMAIL PROTECTED]> CTO and PHP Evangelist, Zend Technologies - http://www.zend.com/ [V: +1 410-420-0140 | F: +1 410-803-2258 | M: +1 443-324-8390] Visit the Zend Store at http://www.zend.com/store/
Chris Lee wrote: > Zend Technologies has an encoder, might be what your looking for, might not. > why do you want to compile your code, you havent mentioned ? > > -- > > Chris Lee > Mediawaveonline.com > > em. [EMAIL PROTECTED] > > ph. 250.377.1095 > ph. 250.376.2690 > fx. 250.554.1120 > > "dmalcolm" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > > > Is there such a thing as a PHP compiler? Linux based? Windoze based? > > > > Thanks in advance. > > > > DM > > > > > > > > > > -- > > 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] No special reason, really. I asked the question to know more about PHP. I also thought maybe, just maybe it would generate a small performance boost. However, for what I need PHP as is, performs just fine. Thanks DM
Jim Jagielski wrote: > At 9:10 AM -0600 2/16/01, dmalcolm wrote: > >Is there such a thing as a PHP compiler? Linux based? Windoze based? > > > >Thanks in advance. > > > > Depends on what you mean by a compiler. If you mean a "package" > that turns your PHP script into a 100% stand-alone binary executable > then No, there isn't. If you mean a package that allows you > to turn your text-based source into something that you can distribute > and have people run, without giving out the source, then the Zend > Encoder will fit the bill. > > Recall that it's the Zend Engine that (internally) does the > compilation into an executable form in PHP 4, so to create a > standalone binary, you would need the full PHP 4 and Zend Engine > "binary" functionality in the final executable as well :) > -- > Jim Jagielski <[EMAIL PROTECTED]> > CTO and PHP Evangelist, Zend Technologies - http://www.zend.com/ > [V: +1 410-420-0140 | F: +1 410-803-2258 | M: +1 443-324-8390] > Visit the Zend Store at http://www.zend.com/store/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] I understand about the full PHP4 and Zend Engine functionality, although that could be arranged as a unix shared object or Microsoft DLL. As I mentioned in another post though I really am trying to learn more about the limitations of PHP. Thanks. DMJim Jagielski wrote: > At 9:10 AM -0600 2/16/01, dmalcolm wrote: > >Is there such a thing as a PHP compiler? Linux based? Windoze based? > > > >Thanks in advance. > > > > Depends on what you mean by a compiler. If you mean a "package" > that turns your PHP script into a 100% stand-alone binary executable > then No, there isn't. If you mean a package that allows you > to turn your text-based source into something that you can distribute > and have people run, without giving out the source, then the Zend > Encoder will fit the bill. > > Recall that it's the Zend Engine that (internally) does the > compilation into an executable form in PHP 4, so to create a > standalone binary, you would need the full PHP 4 and Zend Engine > "binary" functionality in the final executable as well :) > -- > Jim Jagielski <[EMAIL PROTECTED]> > CTO and PHP Evangelist, Zend Technologies - http://www.zend.com/ > [V: +1 410-420-0140 | F: +1 410-803-2258 | M: +1 443-324-8390] > Visit the Zend Store at http://www.zend.com/store/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED]
I found the possible problem and a solution. I was putting the function below the function call. This is how it worked with Perl and I was trying to do it the same way. I couldn't figure out how to put this function earlier in the script so I put the code I wanted to re-use in a separate script and called it with include. This worked very well. I'm tackling a sheet music database for my wife which might be a little over my head as a newbie but I'm learning a lot from it. Jeff Oien > I'm not getting any errors but the function display isn't > doing anything. Thanks. > Jeff Oien > > > <?php > > > > function someFunction($var) > > { > > echo $var; > > } > > > > // Your script > > > > someFunction("Foobar!"); > > ?> > > > > if you're creating an instance of a class object.... > > > > <?php > > class someClass > > { > > function someFunction($var) > > { > > echo $var; > > } > > > > } > > > > $someClass = new someClass; > > > > $someClass->someFunction("Foobar!"); > > > > ?> > > > > Cheers, > > -Jonathan Sharp > > > > > -----Original Message----- > > > From: Jeff Oien [mailto:[EMAIL PROTECTED]] > > > Sent: Thursday, February 15, 2001 8:01 PM > > > To: PHP > > > Subject: [PHP] Newbie User Def Function Question > > > > > > > > > Could anyone give me the correct syntax for calling a function. > > > > > > I have a block of code I want to reuse. How do I name this > > > code block and how do I call it? Having a hard time finding an > > > answer looking through docs. It's so basic I can't find > > > an explanation. :) > > > Jeff Oien > > > > > > -- > > > 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] > >
I want to make my text BOLD using either <STRONG></STRONG> or <B></B> but it did not work with PHP. Can someone please advise why not or if there is another way to do it. Thanks, David
Could you send an example of how you're using the bold/strong tags in your PHP code? If we see it, we can probably help you out better :) Josh Hoover KnowledgeStorm, Inc. Searching for a new IT solution for your company? Need to improve your product marketing? Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can simplify the process for you. KnowledgeStorm - Your IT Search Starts Here > I want to make my text BOLD using either <STRONG></STRONG> or > <B></B> but it > did not work with PHP. Can someone please advise why not or > if there is > another way to do it. > > Thanks, > David
what exactly do you mean by it doesn't work... print( "<B>some test</B>" ); it's always worked for me... At 09:31 AM 2/16/01 -0600, Nguyen, David M wrote: >I want to make my text BOLD using either <STRONG></STRONG> or <B></B> but it >did not work with PHP. Can someone please advise why not or if there is >another way to do it. > >Thanks, >David > >-- >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]
hi! u mean u're using a php file ? not html file that includes php syntax? try this one : echo " <strong> hi</strong>" it works for me ! cheers >From: "Nguyen, David M" <[EMAIL PROTECTED]> >To: [EMAIL PROTECTED] >Subject: [PHP] How to make text BOLD >Date: Fri, 16 Feb 2001 09:31:33 -0600 > >I want to make my text BOLD using either <STRONG></STRONG> or <B></B> but >it >did not work with PHP. Can someone please advise why not or if there is >another way to do it. > >Thanks, >David > >-- >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] > _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Below is my script and the output I got, I want DATE and EQUIPMENT TO BE BOLD: $message = "The following Webpage is added or updated:\n\n<B>Date:</B> $date\n<B>Equipment:</B> $equipment\nTopic: $topic\nURL: $url"; mail( $to, $subject, $message, $mail_header ) or print "Could not send mail"; print ("<HTML>\n"); print ("<HEAD>\n"); print ("<TITLE>$title</TITLE>\n"); print ("</HEAD>\n"); print ("<BODY BACKGROUND=\"images/bkgrnd.jpg\" bgcolor=\"#FFFFFF\">\n"); ****SEE what I got from output: <B>Date:</B> Fri, February 2001 - 09:50:38 <B>Equipment:</B> General Please advise how to fix it. Thanks, David -----Original Message----- From: Hoover, Josh [mailto:[EMAIL PROTECTED]] Sent: Friday, February 16, 2001 9:35 AM To: Nguyen, David M; [EMAIL PROTECTED] Subject: RE: [PHP] How to make text BOLD Could you send an example of how you're using the bold/strong tags in your PHP code? If we see it, we can probably help you out better :) Josh Hoover KnowledgeStorm, Inc. Searching for a new IT solution for your company? Need to improve your product marketing? Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can simplify the process for you. KnowledgeStorm - Your IT Search Starts Here > I want to make my text BOLD using either <STRONG></STRONG> or > <B></B> but it > did not work with PHP. Can someone please advise why not or > if there is > another way to do it. > > Thanks, > David
How about: <STYLE type="text/css"> li.bold {font-weight: bold;} </STYLE> <p> The following Webpage is added or updated: <ul> <li class="bold">DATE: <?= $date ?></li> <li class="bold">Equipment: <?= $equipment ?></li> <li>Topic: <?= $topic ?></li> <li>URL: <?= $url ?></li> </ul> </p> or <p> The following Webpage is added or updated: <ul> <li><b>DATE:</b> <?= $date ?></li> <li><b>Equipment:</b> <?= $equipment ?></li> <li>Topic: <?= $topic ?></li> <li>URL: <?= $url ?></li> </ul> </p> > -----Original Message----- > From: Nguyen, David M [mailto:[EMAIL PROTECTED]] > Sent: Friday, February 16, 2001 10:55 AM > To: [EMAIL PROTECTED] > Subject: RE: [PHP] How to make text BOLD > > > Below is my script and the output I got, I want DATE and EQUIPMENT TO BE > BOLD: > > $message = "The following Webpage is added or updated:\n\n<B>Date:</B> > $date\n<B>Equipment:</B> $equipment\nTopic: $topic\nURL: $url"; > mail( $to, $subject, $message, $mail_header ) or print "Could not send > mail"; > > > print ("<HTML>\n"); > > print ("<HEAD>\n"); > > print ("<TITLE>$title</TITLE>\n"); > > print ("</HEAD>\n"); > > print ("<BODY BACKGROUND=\"images/bkgrnd.jpg\" > bgcolor=\"#FFFFFF\">\n"); > > > ****SEE what I got from output: > > <B>Date:</B> Fri, February 2001 - 09:50:38 > <B>Equipment:</B> General > > > Please advise how to fix it. > > Thanks, > David > > -----Original Message----- > From: Hoover, Josh [mailto:[EMAIL PROTECTED]] > Sent: Friday, February 16, 2001 9:35 AM > To: Nguyen, David M; [EMAIL PROTECTED] > Subject: RE: [PHP] How to make text BOLD > > > Could you send an example of how you're using the bold/strong tags in your > PHP code? If we see it, we can probably help you out better :) > > Josh Hoover > KnowledgeStorm, Inc. > > Searching for a new IT solution for your company? Need to improve your > product marketing? > Visit KnowledgeStorm at www.knowledgestorm.com to learn how we > can simplify > the process for you. > KnowledgeStorm - Your IT Search Starts Here > > > I want to make my text BOLD using either <STRONG></STRONG> or > > <B></B> but it > > did not work with PHP. Can someone please advise why not or > > if there is > > another way to do it. > > > > Thanks, > > David > > -- > 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] > >
All my output scripts use stylesheets, that way they can be easily customized. - John Vanderbeck - Admin, GameDesign ----- Original Message ----- From: "Brian V Bonini" <[EMAIL PROTECTED]> To: "Nguyen, David M" <[EMAIL PROTECTED]> Cc: "PHP Lists" <[EMAIL PROTECTED]> Sent: Friday, February 16, 2001 11:23 AM Subject: RE: [PHP] How to make text BOLD > How about: > > <STYLE type="text/css"> > li.bold {font-weight: bold;} > </STYLE> > <p> > The following Webpage is added or updated: > <ul> > <li class="bold">DATE: <?= $date ?></li> > <li class="bold">Equipment: <?= $equipment ?></li> > <li>Topic: <?= $topic ?></li> > <li>URL: <?= $url ?></li> > </ul> > </p> > > or > > <p> > The following Webpage is added or updated: > <ul> > <li><b>DATE:</b> <?= $date ?></li> > <li><b>Equipment:</b> <?= $equipment ?></li> > <li>Topic: <?= $topic ?></li> > <li>URL: <?= $url ?></li> > </ul> > </p> > > > -----Original Message----- > > From: Nguyen, David M [mailto:[EMAIL PROTECTED]] > > Sent: Friday, February 16, 2001 10:55 AM > > To: [EMAIL PROTECTED] > > Subject: RE: [PHP] How to make text BOLD > > > > > > Below is my script and the output I got, I want DATE and EQUIPMENT TO BE > > BOLD: > > > > $message = "The following Webpage is added or updated:\n\n<B>Date:</B> > > $date\n<B>Equipment:</B> $equipment\nTopic: $topic\nURL: $url"; > > mail( $to, $subject, $message, $mail_header ) or print "Could not send > > mail"; > > > > > > print ("<HTML>\n"); > > > > print ("<HEAD>\n"); > > > > print ("<TITLE>$title</TITLE>\n"); > > > > print ("</HEAD>\n"); > > > > print ("<BODY BACKGROUND=\"images/bkgrnd.jpg\" > > bgcolor=\"#FFFFFF\">\n"); > > > > > > ****SEE what I got from output: > > > > <B>Date:</B> Fri, February 2001 - 09:50:38 > > <B>Equipment:</B> General > > > > > > Please advise how to fix it. > > > > Thanks, > > David > > > > -----Original Message----- > > From: Hoover, Josh [mailto:[EMAIL PROTECTED]] > > Sent: Friday, February 16, 2001 9:35 AM > > To: Nguyen, David M; [EMAIL PROTECTED] > > Subject: RE: [PHP] How to make text BOLD > > > > > > Could you send an example of how you're using the bold/strong tags in your > > PHP code? If we see it, we can probably help you out better :) > > > > Josh Hoover > > KnowledgeStorm, Inc. > > > > Searching for a new IT solution for your company? Need to improve your > > product marketing? > > Visit KnowledgeStorm at www.knowledgestorm.com to learn how we > > can simplify > > the process for you. > > KnowledgeStorm - Your IT Search Starts Here > > > > > I want to make my text BOLD using either <STRONG></STRONG> or > > > <B></B> but it > > > did not work with PHP. Can someone please advise why not or > > > if there is > > > another way to do it. > > > > > > Thanks, > > > David > > > > -- > > 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] >
the problem is obvious: you are trying to send HTML in a plain text email. see : http://www.php.net/manual/en/function.mail.php i would actually recommend that you DO NOT send HTML email and leave it in plain text. DanO -----Original Message----- From: Nguyen, David M [mailto:[EMAIL PROTECTED]] Sent: Friday, February 16, 2001 7:55 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] How to make text BOLD Below is my script and the output I got, I want DATE and EQUIPMENT TO BE BOLD: $message = "The following Webpage is added or updated:\n\n<B>Date:</B> $date\n<B>Equipment:</B> $equipment\nTopic: $topic\nURL: $url"; mail( $to, $subject, $message, $mail_header ) or print "Could not send mail"; print ("<HTML>\n"); print ("<HEAD>\n"); print ("<TITLE>$title</TITLE>\n"); print ("</HEAD>\n"); print ("<BODY BACKGROUND=\"images/bkgrnd.jpg\" bgcolor=\"#FFFFFF\">\n"); ****SEE what I got from output: <B>Date:</B> Fri, February 2001 - 09:50:38 <B>Equipment:</B> General Please advise how to fix it. Thanks, David -----Original Message----- From: Hoover, Josh [mailto:[EMAIL PROTECTED]] Sent: Friday, February 16, 2001 9:35 AM To: Nguyen, David M; [EMAIL PROTECTED] Subject: RE: [PHP] How to make text BOLD Could you send an example of how you're using the bold/strong tags in your PHP code? If we see it, we can probably help you out better :) Josh Hoover KnowledgeStorm, Inc. Searching for a new IT solution for your company? Need to improve your product marketing? Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can simplify the process for you. KnowledgeStorm - Your IT Search Starts Here > I want to make my text BOLD using either <STRONG></STRONG> or > <B></B> but it > did not work with PHP. Can someone please advise why not or > if there is > another way to do it. > > Thanks, > David -- 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]
a tip: you'll have to apply the style to both <ul> and <li> to make it work in microscape. DanO -----Original Message----- From: Brian V Bonini [mailto:[EMAIL PROTECTED]] Sent: Friday, February 16, 2001 8:23 AM To: Nguyen, David M Cc: PHP Lists Subject: RE: [PHP] How to make text BOLD How about: <STYLE type="text/css"> li.bold {font-weight: bold;} </STYLE> <p> The following Webpage is added or updated: <ul> <li class="bold">DATE: <?= $date ?></li> <li class="bold">Equipment: <?= $equipment ?></li> <li>Topic: <?= $topic ?></li> <li>URL: <?= $url ?></li> </ul> </p> or <p> The following Webpage is added or updated: <ul> <li><b>DATE:</b> <?= $date ?></li> <li><b>Equipment:</b> <?= $equipment ?></li> <li>Topic: <?= $topic ?></li> <li>URL: <?= $url ?></li> </ul> </p> > -----Original Message----- > From: Nguyen, David M [mailto:[EMAIL PROTECTED]] > Sent: Friday, February 16, 2001 10:55 AM > To: [EMAIL PROTECTED] > Subject: RE: [PHP] How to make text BOLD > > > Below is my script and the output I got, I want DATE and EQUIPMENT TO BE > BOLD: > > $message = "The following Webpage is added or updated:\n\n<B>Date:</B> > $date\n<B>Equipment:</B> $equipment\nTopic: $topic\nURL: $url"; > mail( $to, $subject, $message, $mail_header ) or print "Could not send > mail"; > > > print ("<HTML>\n"); > > print ("<HEAD>\n"); > > print ("<TITLE>$title</TITLE>\n"); > > print ("</HEAD>\n"); > > print ("<BODY BACKGROUND=\"images/bkgrnd.jpg\" > bgcolor=\"#FFFFFF\">\n"); > > > ****SEE what I got from output: > > <B>Date:</B> Fri, February 2001 - 09:50:38 > <B>Equipment:</B> General > > > Please advise how to fix it. > > Thanks, > David > > -----Original Message----- > From: Hoover, Josh [mailto:[EMAIL PROTECTED]] > Sent: Friday, February 16, 2001 9:35 AM > To: Nguyen, David M; [EMAIL PROTECTED] > Subject: RE: [PHP] How to make text BOLD > > > Could you send an example of how you're using the bold/strong tags in your > PHP code? If we see it, we can probably help you out better :) > > Josh Hoover > KnowledgeStorm, Inc. > > Searching for a new IT solution for your company? Need to improve your > product marketing? > Visit KnowledgeStorm at www.knowledgestorm.com to learn how we > can simplify > the process for you. > KnowledgeStorm - Your IT Search Starts Here > > > I want to make my text BOLD using either <STRONG></STRONG> or > > <B></B> but it > > did not work with PHP. Can someone please advise why not or > > if there is > > another way to do it. > > > > Thanks, > > David > > -- > 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]
Hi! I have this php answer on the request sent from flash5 to serverside php-file: records=8&score0=14&name0=janna&med0=hej4&date0=16:11:32&score1=13&name1=janna&med1=hej3&date1=16:06:52&score2=12&name2=janna&med2=hej2&date2=16:06:42&score3=11&name3=janna&med3=hej&date3=16:06:31&score4=10&name4=Janna&med4=hej anton&date4=10:24:00&score5=9&name5=Anton&med5=8&date5=23:31:26&score6=8&name6=Anton&med6=7&date6=23:31:21&reply=Thanks! Updated&updated=1& My problem is that IE5.5 cache this file. Anybody know if it`s possible to set some code in the php-file to prevent this. I have tried with metatags on both the php and the html in which the swf resides with no result. Thanks Jan
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Cache-Control: no-cache, must-revalidate'); header('Pragma: no-cache'); -- Chris Lee Mediawaveonline.com em. [EMAIL PROTECTED] ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 "Jan Grafström" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi! I have this php answer on the request sent from flash5 to serverside > php-file: > > records=8&score0=14&name0=janna&med0=hej4&date0=16:11:32&score1=13&name1=jan na&med1=hej3&date1=16:06:52&score2=12&name2=janna&med2=hej2&date2=16:06:42&s core3=11&name3=janna&med3=hej&date3=16:06:31&score4=10&name4=Janna&med4=hej > anton&date4=10:24:00&score5=9&name5=Anton&med5=8&date5=23:31:26&score6=8&nam e6=Anton&med6=7&date6=23:31:21&reply=Thanks! > Updated&updated=1& > > My problem is that IE5.5 cache this file. > Anybody know if it`s possible to set some code in the php-file to > prevent this. > I have tried with metatags on both the php and the html in which the swf > resides with no result. > Thanks > Jan > > > -- > 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] >
Does anyone know of a way to validate an e-mail address that was entered and submitted from a form? I would like to trap invalid syntax. Perhaps there exists a script that does just that? I assume valid syntax is the following: One or more characters before the @ sign, followed by an optional '[', then any number of letters, numbers, dashes or periods (valid domain/IP characters) ending in a period and then 2 or 3 letters (for domain suffixes) or 1 to 3 numbers (for IP addresses). An ending bracket is also allowed as it is valid syntax to have an email address like: user@[255.255.255.0]. Thanks, Don
Hi Don, Saw this on the PHP list archive: > -----Original Message----- > From: Don [mailto:[EMAIL PROTECTED]] > Sent: Friday, February 16, 2001 10:51 AM > To: php list > Subject: [PHP] validating an e-mail address entry > > > Does anyone know of a way to validate an e-mail address that > was entered > and submitted from a form? I would like to trap invalid syntax. > Perhaps there exists a script that does just that? > > I assume valid syntax is the following: > > One or more characters before the @ sign, followed by an optional '[', > then any number of letters, numbers, dashes or periods > (valid domain/IP > characters) ending in a period and then 2 or 3 letters (for domain > suffixes) or 1 to 3 numbers (for IP addresses). An ending bracket is > also allowed as it is valid syntax to have an email address like: > user@[255.255.255.0]. > > Thanks, > Don > > > > -- > 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] >
Sorry about that last E-mail! Here is what I meant: if (preg_match ("/(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/", $emailaddress) || preg_match ("/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/",$emailaddr ess)) { print "That is a valid e-mail.<BR>\n"; } else { print "Not a valid e-mail.<BR>\n"; } The PHP archive can be found at: http://marc.theaimsgroup.com/?l=php-general&r=1&w=2 Josh Hoover KnowledgeStorm, Inc. Searching for a new IT solution for your company? Need to improve your product marketing? Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can simplify the process for you. KnowledgeStorm - Your IT Search Starts Here > Does anyone know of a way to validate an e-mail address that > was entered > and submitted from a form? I would like to trap invalid syntax. > Perhaps there exists a script that does just that? > > I assume valid syntax is the following: > > One or more characters before the @ sign, followed by an optional '[', > then any number of letters, numbers, dashes or periods > (valid domain/IP > characters) ending in a period and then 2 or 3 letters (for domain > suffixes) or 1 to 3 numbers (for IP addresses). An ending bracket is > also allowed as it is valid syntax to have an email address like: > user@[255.255.255.0]. > > Thanks, > Don
Or ,as has been mentioned before, use the Manuel Lemos email validation class which will attempt to verify that the address can recieve mail. ----- Original Message ----- From: "Don" <[EMAIL PROTECTED]> To: "php list" <[EMAIL PROTECTED]> Sent: Friday, February 16, 2001 9:50 AM Subject: [PHP] validating an e-mail address entry > Does anyone know of a way to validate an e-mail address that was entered > and submitted from a form? I would like to trap invalid syntax. > Perhaps there exists a script that does just that? > > I assume valid syntax is the following: > > One or more characters before the @ sign, followed by an optional '[', > then any number of letters, numbers, dashes or periods (valid domain/IP > characters) ending in a period and then 2 or 3 letters (for domain > suffixes) or 1 to 3 numbers (for IP addresses). An ending bracket is > also allowed as it is valid syntax to have an email address like: > user@[255.255.255.0]. > > Thanks, > Don > > > > -- > 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] >
Speaking of stylesheets, has anyone had problems with Netscape 4.x, stylesheets, and javascript breaking HTML tags every 4K characters? It seems like Netscape 4.x puts a newline character after 4K characters when using stylesheets and javascript. Has anyone else seen this behavior? An example of the problem would be something like this: <HTML> <HEAD> <TITLE>test</TITLE> <BODY> <B>This is a test right here. Let's assume 4K characters have been sent </ B> The bold tag in this case gets broken up. It seems like it happens every 4K characters when using CSS and Javascript on Netscape 4.x. It's a crazy problem because it will break a page in so many different places since PHP pages are typically very dynamic and the length changes quite often. Anyone else seen this behavior? Thanks, Josh Hoover KnowledgeStorm, Inc. Searching for a new IT solution for your company? Need to improve your product marketing? Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can simplify the process for you. KnowledgeStorm - Your IT Search Starts Here > All my output scripts use stylesheets, that way they can be easily > customized. > > - John Vanderbeck > - Admin, GameDesign
Hello, I have a huge folder for php files that I want to send from one server to another. Is there a way to ftp *.php using ftp instead of having to send each individual file? Does anyone have a ftp script that does this? Thank you, -------------------------------------------- Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com --------------------------------------------
Ummm, Turn off interactive prompting, make sure you in ASCII mode then, ftp>mput *.php -Brian ********** > -----Original Message----- > From: Brandon Orther [mailto:[EMAIL PROTECTED]] > Sent: Friday, February 16, 2001 11:58 AM > To: PHP User Group > Subject: [PHP] Sending multiple files through ftp in telnet.... PHP > files that is > > > Hello, > > I have a huge folder for php files that I want to send from one server to > another. Is there a way to ftp *.php using ftp instead of having to send > each individual file? Does anyone have a ftp script that does this? > > Thank you, > > -------------------------------------------- > Brandon Orther > WebIntellects Design/Development Manager > [EMAIL PROTECTED] > 800-994-6364 > www.webintellects.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] > >
This is a free service for the PHP Community. Job seekers can search the latest PHP related positions. Companies can post their Jobs with EASE for FREE! http://www.phpcareer.com
I'm fiddling around with the fopen function, using it on urls. I now need to know how to run a JavaScript on another page by using PHP. I know I'll be able to do it from the url if only there's a way to run JavaScript from the url (just by using an fopen). Is there a way to run a JavaScript function from a url, or from PHP? For example: Would I be able to type something like: http://www.someurl.com/filename/javascript:javascriptname?parameterlist=valuelist& or is there a way PHP can do this?? Thanks. Liam
Can Anybody help with this code it is currently only listing the very last entry record in my db however i want it to list however many the query finds can anybody see what I am doing wrong. thanks Matt. <?php //connect $connection = mysql_connect("localhost","*******","*******") or die ("Couldn't connect to server."); //select db $db = mysql_select_db ("business", $connection) or die ("Couldn't select database."); //create sql statement $sql = "select Business_Name,Address_Line_1,Address_Line_2,Address_Line_3,Address_Line_4,Ad dress_Line_5,Address_Line_6,Contact_Person,Telephone,Fax,Mobile,E_Mail,Link, URL,Trading_Details from Main"; //execute sql query and get results $sql_result = mysql_query($sql) or die ("Couldn't execute query."); ?> <HEAD> <TITLE> Business Search </TITLE> </HEAD> <BODY LEFTMARGIN="0" TOPMARGIN="0" ALINK="#b567fb" LINK="#000000" VLINK="#c0c0c0"> <?php /*results variables for data to be displayed*/ while ($row = mysql_fetch_array($sql_result)) { $businessname = $row["Business_Name"]; $addressline1 = $row["Address_Line_1"]; $addressline2 = $row["Address_Line_2"]; $addressline3 = $row["Address_Line_3"]; $addressline4 = $row["Address_Line_4"]; $addressline5 = $row["Address_Line_5"]; $addressline6 = $row["Address_Line_6"]; $contactperson = $row["Contact_Person"]; $telephone = $row["Telephone"]; $fax = $row["Fax"]; $mobile = $row["Mobile"]; $email = $row["E_Mail"]; $link = $row["Link"]; $url = $row["URL"]; $tradingdetails = $row["Trading_Details"]; } //deal with website if ($url != '') { $me="<A HREF=\"http://".$url."\" TARGET='_blank'><IMG BORDER=\"0\" SRC=\"website.gif\"></A>"; } else { $me=" "; } // end of deal website ?> <CENTER> <TABLE BACKGROUND="../../images/misc/ryw_background_top.gif" BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%"> <TR> <TD ALIGN="center"> <FONT COLOR="#ffffff" FACE="verdana, arial, century gothic" SIZE="1"> </FONT> </TD> </TR> </TABLE> <BR> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="500"> <TR> <TD ALIGN="center"> <FONT FACE="verdana" SIZE="1" COLOR="#000000"> <FONT SIZE="2"> <B> Business Search Results </B> </FONT> <BR> <B> You Searched for <FONT COLOR="#ff9933"> Consultancy </FONT> in <FONT COLOR="#ff9933"> Bassingbourn </FONT>, here are the results... </B> </FONT> </TD> </TR> </TABLE> <BR> <!--start of search results--> <TABLE BACKGROUND='ryw_background_top.gif' BORDER='0' CELLPADDING='1' CELLSPACING='0' WIDTH='100%'> <TR> <TD ALIGN='center'> <FONT COLOR='#ffffff' FACE='verdana, arial, century gothic' SIZE='2'> <B> <? echo "$businessname" ?> </B> </FONT> </TD> </TR> </TABLE> <BR> <TABLE BORDER='0' CELLPADDING='0' CELLSPACING='0' WIDTH='500'> <TR> <TD ALIGN='center' VALIGN='top'> <FONT COLOR='#000000' FACE='verdana, arial, century gothic' SIZE='1'> <B> <? echo "$tradingdetails" ?> </B> </FONT> </TD> </TR> </TABLE> <BR> <TABLE BORDER='0' CELLPADDING='0' CELLSPACING='0' WIDTH='500'> <TR> <TD ALIGN='center' VALIGN='top' WIDTH='34%'> <FONT COLOR='#000000' FACE='verdana, arial, century gothic' SIZE='1'> <B> Address </B> <BR> <? echo "$addressline1" ?> <BR> <? echo "$addressline2" ?> <BR> <? echo "$addressline3" ?> <BR> <? echo "$addressline4" ?> <BR> <? echo "$addressline5" ?> <BR> <? echo "$addressline6" ?> <BR> </FONT> </TD> <TD ALIGN='center' VALIGN='top' WIDTH='33%'> <FONT COLOR='#000000' FACE='verdana, arial, century gothic' SIZE='1'> <B> Contact Details </B> <BR> <? echo "$contactperson" ?> <BR> TEL: <? echo "$telephone" ?> <BR> MOB: <? echo "$mobile" ?> <BR> FAX: <? echo "$fax" ?> <BR> E-mail: <A HREF="mailto:<? echo "$email" ?>"><? echo "$email" ?></A> <BR> </FONT> </TD> <TD ALIGN='center' VALIGN='top' WIDTH='33%'> <FONT COLOR='#000000' FACE='verdana, arial, century gothic' SIZE='1'> <B> Links </B> </FONT> <?echo "$me" ?> </TD> </TR> </TABLE> <BR> <!--end of search results--> <BR> <TABLE BACKGROUND="ryw_background_top.gif" BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%"> </TABLE> <TABLE BORDER="0" CELLPADDIN="0" CELLSPACING="0" WIDTH="500"> <TR> <TD ALIGN="center"> <FONT FACE="verdana, arial, century gothic" COLOR="#000000" SIZE="1"> This service was brought to you by </FONT> <A HREF="http://www.roundyourway.com" TARGET="_blank"> <FONT FACE="verdana, arial, century gothic" COLOR="#000000" SIZE="1"> Round Your Way </FONT> </A> </TD> </TR> </TABLE> <BR> </CENTER> <?PHP //close connection mysql_free_result ($sql_result); mysql_close ($connection); ?> </BODY> </HTML>
you're looping through the all database records, assigning the values to variables, but then you never output the variables until after you exit your while() loop. This is incorrect. Time to read up on database handling in PHP... // psuedo-code $queryResults = mysql_query( $query, $db ); while( $row = mysql_fetch_array( $queryResults )) { $someVar1 = $row["FieldOne"]; $someVar2 = $row["FieldTwo"]; $someVar3 = $row["FieldThree"]; print( $someVar1 . " - " . $someVar2 . " - " . someVar3 . "<BR>" ); } At 05:18 PM 2/16/01 +0000, Matt Davis wrote: >Can Anybody help with this code it is currently only listing the very last >entry record in my db however i want it to list however many the query finds >can anybody see what I am doing wrong. > >thanks > >Matt. > > > > ><?php > //connect > $connection = mysql_connect("localhost","*******","*******") or die >("Couldn't connect to server."); > > //select db > $db = mysql_select_db ("business", $connection) or die ("Couldn't >select database."); > > //create sql statement > $sql = "select >Business_Name,Address_Line_1,Address_Line_2,Address_Line_3,Address_Line_4,Ad >dress_Line_5,Address_Line_6,Contact_Person,Telephone,Fax,Mobile,E_Mail,Link, >URL,Trading_Details from Main"; > > //execute sql query and get results > $sql_result = mysql_query($sql) or die ("Couldn't execute query."); > >?> > > <HEAD> > <TITLE> > Business Search > </TITLE> > > </HEAD> > > <BODY LEFTMARGIN="0" TOPMARGIN="0" ALINK="#b567fb" LINK="#000000" >VLINK="#c0c0c0"> > ><?php > > /*results > variables for data to be displayed*/ > >while ($row = mysql_fetch_array($sql_result)) { > $businessname = $row["Business_Name"]; > $addressline1 = $row["Address_Line_1"]; > $addressline2 = $row["Address_Line_2"]; > $addressline3 = $row["Address_Line_3"]; > $addressline4 = $row["Address_Line_4"]; > $addressline5 = $row["Address_Line_5"]; > $addressline6 = $row["Address_Line_6"]; > $contactperson = $row["Contact_Person"]; > $telephone = $row["Telephone"]; > $fax = $row["Fax"]; > $mobile = $row["Mobile"]; > $email = $row["E_Mail"]; > $link = $row["Link"]; > $url = $row["URL"]; > $tradingdetails = $row["Trading_Details"]; >} > > //deal with website > > if ($url != '') { > $me="<A HREF=\"http://".$url."\" TARGET='_blank'><IMG >BORDER=\"0\" SRC=\"website.gif\"></A>"; > } else { > $me=" "; > } > // end of deal website >?> > > <CENTER> > <TABLE BACKGROUND="../../images/misc/ryw_background_top.gif" >BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%"> > <TR> > <TD ALIGN="center"> > <FONT COLOR="#ffffff" FACE="verdana, arial, century gothic" >SIZE="1"> > </FONT> > </TD> > </TR> > </TABLE> > <BR> > <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="500"> > <TR> > <TD ALIGN="center"> > <FONT FACE="verdana" SIZE="1" COLOR="#000000"> > <FONT SIZE="2"> > <B> > Business Search Results > </B> > </FONT> > <BR> > <B> > You Searched for > <FONT COLOR="#ff9933"> > Consultancy > </FONT> > in > <FONT COLOR="#ff9933"> > Bassingbourn > </FONT>, > here are the results... > </B> > </FONT> > </TD> > </TR> > </TABLE> > <BR> > ><!--start of search results--> > > ><TABLE BACKGROUND='ryw_background_top.gif' BORDER='0' CELLPADDING='1' >CELLSPACING='0' WIDTH='100%'> > <TR> > <TD ALIGN='center'> > <FONT COLOR='#ffffff' FACE='verdana, arial, century gothic' >SIZE='2'> > <B> > <? echo "$businessname" ?> > </B> > </FONT> > </TD> > </TR> > </TABLE> > <BR> > <TABLE BORDER='0' CELLPADDING='0' CELLSPACING='0' WIDTH='500'> > <TR> > <TD ALIGN='center' VALIGN='top'> > <FONT COLOR='#000000' FACE='verdana, arial, century gothic' >SIZE='1'> > <B> > <? echo "$tradingdetails" ?> > </B> > </FONT> > </TD> > </TR> > </TABLE> > <BR> > <TABLE BORDER='0' CELLPADDING='0' CELLSPACING='0' WIDTH='500'> > <TR> > <TD ALIGN='center' VALIGN='top' WIDTH='34%'> > <FONT COLOR='#000000' FACE='verdana, arial, century gothic' >SIZE='1'> > <B> > Address > </B> > <BR> > <? echo "$addressline1" ?> > <BR> > <? echo "$addressline2" ?> > <BR> > <? echo "$addressline3" ?> > <BR> > <? echo "$addressline4" ?> > <BR> > <? echo "$addressline5" ?> > <BR> > <? echo "$addressline6" ?> > <BR> > </FONT> > </TD> > <TD ALIGN='center' VALIGN='top' WIDTH='33%'> > <FONT COLOR='#000000' FACE='verdana, arial, century gothic' >SIZE='1'> > <B> > Contact Details > </B> > <BR> > <? echo "$contactperson" ?> > <BR> > TEL: <? echo "$telephone" ?> > <BR> > MOB: <? echo "$mobile" ?> > <BR> > FAX: <? echo "$fax" ?> > <BR> > E-mail: <A HREF="mailto:<? echo "$email" ?>"><? echo "$email" >?></A> > <BR> > </FONT> > </TD> > <TD ALIGN='center' VALIGN='top' WIDTH='33%'> > <FONT COLOR='#000000' FACE='verdana, arial, century gothic' >SIZE='1'> > <B> > Links > </B> > </FONT> > <?echo "$me" ?> > </TD> > </TR> > </TABLE> > > <BR> > ><!--end of search results--> > > <BR> > <TABLE BACKGROUND="ryw_background_top.gif" BORDER="0" CELLPADDING="0" >CELLSPACING="0" WIDTH="100%"> > </TABLE> > <TABLE BORDER="0" CELLPADDIN="0" CELLSPACING="0" WIDTH="500"> > <TR> > <TD ALIGN="center"> > <FONT FACE="verdana, arial, century gothic" COLOR="#000000" >SIZE="1"> > This service was brought to you by > </FONT> > <A HREF="http://www.roundyourway.com" TARGET="_blank"> > <FONT FACE="verdana, arial, century gothic" COLOR="#000000" >SIZE="1"> > Round Your Way > </FONT> > </A> > </TD> > </TR> > </TABLE> > <BR> > </CENTER> > ><?PHP > > //close connection > mysql_free_result ($sql_result); > mysql_close ($connection); > >?> > > </BODY> ></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]
Hello All, Would anyone give me any advice to customize the phorum which provided in the www.phorum.org? Thanks a lot! Fang
What do you want to do to it? > -----Original Message----- > From: Fang Li [mailto:[EMAIL PROTECTED]] > Sent: Friday, February 16, 2001 12:26 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Does anyone have experience to customize the phorum > > > Hello All, > > Would anyone give me any advice to customize the phorum which provided in > the www.phorum.org? > > Thanks a lot! > > Fang > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
I'm totally stuck on this code. I get the error "Couldn't execute query." so I know where it's failing but can't figure out what's wrong. I have a database with 'title' as one of the fields. Based on code in PHP Fast and Easy. Jeff Oien <?php $db_name = "Music"; $table_name = "music"; $connection = mysql_connect("localhost", "xxxx", "xxxx") or die("Couldn't connect."); $db = mysql_select_db($db_name, $connection) or die("Couldn't select database."); $sql = "SELECT COUNT (title) FROM music"; $result = mysql_query($sql,$connection) or die("Couldn't execute query."); //<<error from here $count = mysql_result($result,0,"count(title)"); echo "$count"; ?>
Shouldn't that be $result = mysql_query($sql,$db) or die("Couldn't execute query."); So you're querying the database, and not the connection? HTH Jon -----Original Message----- From: Jeff Oien [mailto:[EMAIL PROTECTED]] Sent: 16 February 2001 17:27 To: PHP Subject: [PHP] MySQL COUNT Won't Work I'm totally stuck on this code. I get the error "Couldn't execute query." so I know where it's failing but can't figure out what's wrong. I have a database with 'title' as one of the fields. Based on code in PHP Fast and Easy. Jeff Oien <?php $db_name = "Music"; $table_name = "music"; $connection = mysql_connect("localhost", "xxxx", "xxxx") or die("Couldn't connect."); $db = mysql_select_db($db_name, $connection) or die("Couldn't select database."); $sql = "SELECT COUNT (title) FROM music"; $result = mysql_query($sql,$connection) or die("Couldn't execute query."); //<<error from here $count = mysql_result($result,0,"count(title)"); echo "$count"; ?> -- 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]
Nope, with php the second argument of mysql_query is indeed the connection identifier. What happens when you run the query via the mysql client? -jm -----Original Message----- From: Jon Haworth [mailto:[EMAIL PROTECTED]] Sent: Friday, February 16, 2001 9:32 AM To: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]' Subject: RE: [PHP] MySQL COUNT Won't Work Shouldn't that be $result = mysql_query($sql,$db) or die("Couldn't execute query."); So you're querying the database, and not the connection? HTH Jon -----Original Message----- From: Jeff Oien [mailto:[EMAIL PROTECTED]] Sent: 16 February 2001 17:27 To: PHP Subject: [PHP] MySQL COUNT Won't Work I'm totally stuck on this code. I get the error "Couldn't execute query." so I know where it's failing but can't figure out what's wrong. I have a database with 'title' as one of the fields. Based on code in PHP Fast and Easy. Jeff Oien <?php $db_name = "Music"; $table_name = "music"; $connection = mysql_connect("localhost", "xxxx", "xxxx") or die("Couldn't connect."); $db = mysql_select_db($db_name, $connection) or die("Couldn't select database."); $sql = "SELECT COUNT (title) FROM music"; $result = mysql_query($sql,$connection) or die("Couldn't execute query."); //<<error from here $count = mysql_result($result,0,"count(title)"); echo "$count"; ?> -- 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]
That's not it. Get: Warning: Supplied argument is not a valid MySQL-Link resource in count.php3 on line 14 Jeff Oien > Shouldn't that be > > $result = mysql_query($sql,$db) > or die("Couldn't execute query."); > > So you're querying the database, and not the connection? > > > HTH > Jon > > > -----Original Message----- > From: Jeff Oien [mailto:[EMAIL PROTECTED]] > Sent: 16 February 2001 17:27 > To: PHP > Subject: [PHP] MySQL COUNT Won't Work > > > I'm totally stuck on this code. I get the error > "Couldn't execute query." so I know where it's > failing but can't figure out what's wrong. I have > a database with 'title' as one of the fields. Based > on code in PHP Fast and Easy. > Jeff Oien > > <?php > $db_name = "Music"; > $table_name = "music"; > > $connection = mysql_connect("localhost", "xxxx", "xxxx") > or die("Couldn't connect."); > > $db = mysql_select_db($db_name, $connection) > or die("Couldn't select database."); > > $sql = "SELECT COUNT (title) FROM music"; > > $result = mysql_query($sql,$connection) > or die("Couldn't execute query."); //<<error from here > > $count = mysql_result($result,0,"count(title)"); > > echo "$count"; > ?> > > -- > 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] >
Are you using 3.23.33? If so try removing the space between the COUNT and the open paren. It looks like there may be a bug in the latest release (seeing this problem on the mysql list for MAX, probably exists for COUNT as well). -jm -----Original Message----- From: Jeff Oien [mailto:[EMAIL PROTECTED]] Sent: Friday, February 16, 2001 9:37 AM To: PHP Subject: RE: [PHP] MySQL COUNT Won't Work That's not it. Get: Warning: Supplied argument is not a valid MySQL-Link resource in count.php3 on line 14 Jeff Oien > Shouldn't that be > > $result = mysql_query($sql,$db) > or die("Couldn't execute query."); > > So you're querying the database, and not the connection? > > > HTH > Jon > > > -----Original Message----- > From: Jeff Oien [mailto:[EMAIL PROTECTED]] > Sent: 16 February 2001 17:27 > To: PHP > Subject: [PHP] MySQL COUNT Won't Work > > > I'm totally stuck on this code. I get the error > "Couldn't execute query." so I know where it's > failing but can't figure out what's wrong. I have > a database with 'title' as one of the fields. Based > on code in PHP Fast and Easy. > Jeff Oien > > <?php > $db_name = "Music"; > $table_name = "music"; > > $connection = mysql_connect("localhost", "xxxx", "xxxx") > or die("Couldn't connect."); > > $db = mysql_select_db($db_name, $connection) > or die("Couldn't select database."); > > $sql = "SELECT COUNT (title) FROM music"; > > $result = mysql_query($sql,$connection) > or die("Couldn't execute query."); //<<error from here > > $count = mysql_result($result,0,"count(title)"); > > echo "$count"; > ?> > > -- > 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]
I do lots and lots of count()'s in PHP and have never had any problems... of course, I do it a bit differently than you did.. // I always have these in a top level include $UserName = "noneYa"; $Password = "yeahRight"; $myDatabase = "uhhuh"; $dbConn = mysql_connect( "localhost", $UserName, $Password ) or die( "Cannot Connect To Database Server" ); mysql_select_db( $myDatabase ) or die( "Unable To Connect To Database: " . $myDatabase ); // up to here // then I always make sure the file is included at the top of my page, and then call this query like this... $qQuery = "SELECT Count(*) as nTotal FROM someDB"; $rQuery = mysql_query( $qQuery, $dbConn ); $qrQuery = mysql_fetch_array( $rQuery ); print( $qrQuery["nTotal"] ); At 11:37 AM 2/16/01 -0600, Jeff Oien wrote: >That's not it. Get: >Warning: Supplied argument is not a valid MySQL-Link resource in >count.php3 on line 14 >Jeff Oien > > > Shouldn't that be > > > > $result = mysql_query($sql,$db) > > or die("Couldn't execute query."); > > > > So you're querying the database, and not the connection? > > > > > > HTH > > Jon > > > > > > -----Original Message----- > > From: Jeff Oien [mailto:[EMAIL PROTECTED]] > > Sent: 16 February 2001 17:27 > > To: PHP > > Subject: [PHP] MySQL COUNT Won't Work > > > > > > I'm totally stuck on this code. I get the error > > "Couldn't execute query." so I know where it's > > failing but can't figure out what's wrong. I have > > a database with 'title' as one of the fields. Based > > on code in PHP Fast and Easy. > > Jeff Oien > > > > <?php > > $db_name = "Music"; > > $table_name = "music"; > > > > $connection = mysql_connect("localhost", "xxxx", "xxxx") > > or die("Couldn't connect."); > > > > $db = mysql_select_db($db_name, $connection) > > or die("Couldn't select database."); > > > > $sql = "SELECT COUNT (title) FROM music"; > > > > $result = mysql_query($sql,$connection) > > or die("Couldn't execute query."); //<<error from here > > > > $count = mysql_result($result,0,"count(title)"); > > > > echo "$count"; > > ?> > > > > -- > > 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]
Yes! That was it. Thank you very much. Jeff Oien > Are you using 3.23.33? If so try removing the space between the COUNT and > the open paren. It looks like there may be a bug in the latest release > (seeing this problem on the mysql list for MAX, probably exists for COUNT as > well). > > -jm > > That's not it. Get: > Warning: Supplied argument is not a valid MySQL-Link resource in > count.php3 on line 14 > Jeff Oien > > > Shouldn't that be > > > > $result = mysql_query($sql,$db) > > or die("Couldn't execute query."); > > > > So you're querying the database, and not the connection? > > > > > > HTH > > Jon > > > > > > -----Original Message----- > > From: Jeff Oien [mailto:[EMAIL PROTECTED]] > > Sent: 16 February 2001 17:27 > > To: PHP > > Subject: [PHP] MySQL COUNT Won't Work > > > > > > I'm totally stuck on this code. I get the error > > "Couldn't execute query." so I know where it's > > failing but can't figure out what's wrong. I have > > a database with 'title' as one of the fields. Based > > on code in PHP Fast and Easy. > > Jeff Oien > > > > <?php > > $db_name = "Music"; > > $table_name = "music"; > > > > $connection = mysql_connect("localhost", "xxxx", "xxxx") > > or die("Couldn't connect."); > > > > $db = mysql_select_db($db_name, $connection) > > or die("Couldn't select database."); > > > > $sql = "SELECT COUNT (title) FROM music"; > > > > $result = mysql_query($sql,$connection) > > or die("Couldn't execute query."); //<<error from here > > > > $count = mysql_result($result,0,"count(title)"); > > > > echo "$count"; > > ?> > > > > -- > > 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] >
You should use fieldnames in your selects... I'd imagine count(*) would be slower just as select * is slower. -jm -----Original Message----- From: Joe Sheble (Wizaerd) [mailto:[EMAIL PROTECTED]] Sent: Friday, February 16, 2001 9:46 AM To: PHP Subject: RE: [PHP] MySQL COUNT Won't Work I do lots and lots of count()'s in PHP and have never had any problems... of course, I do it a bit differently than you did.. // I always have these in a top level include $UserName = "noneYa"; $Password = "yeahRight"; $myDatabase = "uhhuh"; $dbConn = mysql_connect( "localhost", $UserName, $Password ) or die( "Cannot Connect To Database Server" ); mysql_select_db( $myDatabase ) or die( "Unable To Connect To Database: " . $myDatabase ); // up to here // then I always make sure the file is included at the top of my page, and then call this query like this... $qQuery = "SELECT Count(*) as nTotal FROM someDB"; $rQuery = mysql_query( $qQuery, $dbConn ); $qrQuery = mysql_fetch_array( $rQuery ); print( $qrQuery["nTotal"] ); At 11:37 AM 2/16/01 -0600, Jeff Oien wrote: >That's not it. Get: >Warning: Supplied argument is not a valid MySQL-Link resource in >count.php3 on line 14 >Jeff Oien > > > Shouldn't that be > > > > $result = mysql_query($sql,$db) > > or die("Couldn't execute query."); > > > > So you're querying the database, and not the connection? > > > > > > HTH > > Jon > > > > > > -----Original Message----- > > From: Jeff Oien [mailto:[EMAIL PROTECTED]] > > Sent: 16 February 2001 17:27 > > To: PHP > > Subject: [PHP] MySQL COUNT Won't Work > > > > > > I'm totally stuck on this code. I get the error > > "Couldn't execute query." so I know where it's > > failing but can't figure out what's wrong. I have > > a database with 'title' as one of the fields. Based > > on code in PHP Fast and Easy. > > Jeff Oien > > > > <?php > > $db_name = "Music"; > > $table_name = "music"; > > > > $connection = mysql_connect("localhost", "xxxx", "xxxx") > > or die("Couldn't connect."); > > > > $db = mysql_select_db($db_name, $connection) > > or die("Couldn't select database."); > > > > $sql = "SELECT COUNT (title) FROM music"; > > > > $result = mysql_query($sql,$connection) > > or die("Couldn't execute query."); //<<error from here > > > > $count = mysql_result($result,0,"count(title)"); > > > > echo "$count"; > > ?> > > > > -- > > 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]
On Friday 16 February 2001 18:27, Jeff Oien wrote: > I'm totally stuck on this code. I get the error > "Couldn't execute query." so I know where it's > failing but can't figure out what's wrong. I have > a database with 'title' as one of the fields. Based > on code in PHP Fast and Easy. > $sql = "SELECT COUNT (title) FROM music"; I found that often MySQL doesn't like if there's a space between the function name and the opening bracket, i.e. try writing "COUNT(title)" instead of "COUNT (title)". -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "World domination. Fast." (Linus Torvalds about Linux)
Addressed to: Javier Muniz <[EMAIL PROTECTED]> Joe Sheble (Wizaerd) [mailto:[EMAIL PROTECTED]] [EMAIL PROTECTED] ** Reply to note from Javier Muniz <[EMAIL PROTECTED]> Fri, 16 Feb 2001 10:14:29 -0800 > > You should use fieldnames in your selects... I'd imagine count(*) > would be slower just as select * is slower. I agree, SELECT should always specify only the fields you want returned, but COUNT(*) is an optimization. From the MySQL manual: http://www.mysql.com/doc/G/r/Group_by_functions.html COUNT(*) is somewhat different in that it returns a count of the number of rows retrieved, whether or not they contain NULL values. COUNT(*) is optimized to return very quickly if the SELECT retrieves from one table, no other columns are retrieved, and there is no WHERE clause. For example SELECT COUNT(*) FROM TableName will not even look at the table, it can get the number of entries from the index, and return it almost instantly. If you used SELECT COUNT(SomeField) FROM TableName MySQL would have to scan the table to make sure none of the SomeField values were NULL, which would not be included in the count. This can take quite a bit more time. Rick Widmer Internet Marketing Specialists http://www.developersdesk.com
On Friday, February 16, 2001, at 09:27 AM, Jeff Oien wrote: > $result = mysql_query($sql,$connection) > or die("Couldn't execute query."); //<<error from here you die argument is next to worthless. change it to: die("ERROR ".mysql_errno().": ".mysql_error()."<pre>$query</pre"); this should tell you everything you need to know about why your query failed. :: Andrew Rush :: Lead Systems Developer :: MaineToday.com :: :************************************************************************** "Crippled :but free, blind all the time, i was learning to see" - J. Garcia / R. Hunter :************************************************************************** The :views expressed herein are not necessarily those of my employer, but they let me :have them anyway.
I've checked out the shopping cart packages available for PHP and am not thrilled by any of them. Was wondering if there are a set of classes available that could be used to support a shopping cart. I'm interested in the 'back end' -- working with the actual data, rather than the front end -- the user interface. Want to build it with php + mySQL or PostgreSQL. I want complete freedom to build the interface but don't want to reinvent the wheel for credit card validation, online credit card processing, shipping calculation, etc. I've built a simple shopping cart for a site currently under construction. This uses a combination of javascript and php, and doesn't use database (less than 1 dozen items). You can see an example (excuse the mess) by going to: http://www.bhagavati.com/trial/mainframe.htm and clicking the 'order' link in the navbar frame at the top. HINT: close movie window as soon as it opens. Randy Perry sysTame Mac Consulting/Sales
Warning: Unable to jump to row 1 on MySQL result index 5 in admrelatoriowap.php3 on line 23 Warning: Unable to jump to row 1 on MySQL result index 5 in admrelatoriowap.php3 on line 24 Warning: Unable to jump to row 2 on MySQL result index 6 in admrelatoriowap.php3 on line 23 Warning: Unable to jump to row 2 on MySQL result index 6 in admrelatoriowap.php3 on line 24 Why should this happen? thanks,. Augusto Cesar Castoldi
How can I use this function to load files from subfolders? when i try this on apache (Linux+PHP3) require('cls/mysql.cl.php3'); from log I can read then: [error] PHP3 Fatal error: Failed opening required 'cls/mysql.cl.php3' in 'index.php3' on line 6 I already tried full-path, but nothing! Only when i copied file in to same folder, then it works! But I dont want do this! Any other ideas are welcome! R.K.
Hello, Can you give me the full path to where the php script is and the full path to where the script is you want require(''); I use this all the time and should be able to figure it out. Thank you, -------------------------------------------- Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com -------------------------------------------- -----Original Message----- From: Maamiin [mailto:[EMAIL PROTECTED]] Sent: Friday, February 16, 2001 9:38 AM To: PHP General Newslist Subject: [PHP] require() ??? How can I use this function to load files from subfolders? when i try this on apache (Linux+PHP3) require('cls/mysql.cl.php3'); from log I can read then: [error] PHP3 Fatal error: Failed opening required 'cls/mysql.cl.php3' in 'index.php3' on line 6 I already tried full-path, but nothing! Only when i copied file in to same folder, then it works! But I dont want do this! Any other ideas are welcome! R.K. -- 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]
main script: /home/www/public_html/YL/index.php3 (rw-rw-rw-) root and second script: /home/www/public_html/YL/cls/mysql.cl.php3 (rw-rw-rw-) root First page intranet web-address is http://MyServer/www/YL/index.php3 Thnx || -----Original Message----- || From: Brandon Orther [mailto:[EMAIL PROTECTED]] || Sent: Friday, February 16, 2001 8:30 PM || To: PHP User Group || Subject: RE: [PHP] require() ??? || || || Hello, || || Can you give me the full path to where the php script is and the || full path || to where the script is you want require(''); || || I use this all the time and should be able to figure it out. || || Thank you, || || -------------------------------------------- || Brandon Orther || WebIntellects Design/Development Manager || [EMAIL PROTECTED] || 800-994-6364 || www.webintellects.com || -------------------------------------------- || || -----Original Message----- || From: Maamiin [mailto:[EMAIL PROTECTED]] || Sent: Friday, February 16, 2001 9:38 AM || To: PHP General Newslist || Subject: [PHP] require() ??? || || || How can I use this function to load files from subfolders? || when i try this on apache (Linux+PHP3) || || require('cls/mysql.cl.php3'); || || from log I can read then: || || [error] PHP3 Fatal error: Failed opening required 'cls/mysql.cl.php3' in || 'index.php3' on line 6 || || I already tried full-path, but nothing! Only when i copied file || in to same || folder, then it works! But I dont want do this! || || Any other ideas are welcome! || || || R.K. || || || -- || 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] ||
I have been having some problems getting exec to run a 'find /var/spool/mail/ -mindepth 3 -type d' command. She just wont execute it and give me a result, however she will run 'ls'....
I have a web page that displays an image. I would like to randomize which image it displays when the page loads. Every possible image will be the same dimensions and file format. Each image will be named a consecutive number begining with 1. The code I am using is: $number = rand(1, 10); $file = $number . "." . "gif"; echo"<img src = 'random_images/$file'>"; I'm wondering if there is a way to count how many files are in the random_images directory, so I can dynamically set the range of my rand(). This way I can add images to the random_images directory without having to increase the range in the php code. Thanks! Nick
Try this bit of code and see if it works. (I don't know if there's a less taxing (on the server) way to get a count of files in a directory or not.) $myDirectory = dir("yourdirectory"); while($entry=$myDirectory->read()) { $filecount++; } $myDirectory->close(); $number = rand(1, $filecount); $file = $number . "." . "gif"; echo"<img src = 'random_images/$file'>"; Josh Hoover KnowledgeStorm, Inc. Searching for a new IT solution for your company? Need to improve your product marketing? Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can simplify the process for you. KnowledgeStorm - Your IT Search Starts Here > I have a web page that displays an image. I would like to randomize > which image it displays when the page loads. Every possible > image will > be the same dimensions and file format. Each image will be named a > consecutive number begining with 1. > > The code I am using is: > > $number = rand(1, 10); > > $file = $number . "." . "gif"; > > echo"<img src = 'random_images/$file'>"; > > I'm wondering if there is a way to count how many files are in the > random_images directory, so I can dynamically set the range of my > rand(). This way I can add images to the random_images directory > without having to increase the range in the php code. > > Thanks! > > Nick
On Friday, February 16, 2001, at 10:31 AM, Hoover, Josh wrote: > Try this bit of code and see if it works. (I don't know if there's a less > taxing (on the server) way to get a count of files in a directory or not.) this code snippet won't work as a standalone. you are referencing an object that does not exist. > $myDirectory = dir("yourdirectory"); > while($entry=$myDirectory->read()) > { > $filecount++; > } > $myDirectory->close(); > you are on the right track though. if you are sure that everything in the directory $d=opendir("path/to/my/directory"); $i=0; while($found=readdir($d)) { if($found != "." && $found != "..") { $i++; } } print("there were $i files found."); :: Andrew Rush :: Lead Systems Developer :: MaineToday.com :: :************************************************************************** "Crippled :but free, blind all the time, i was learning to see" - J. Garcia / R. Hunter :************************************************************************** The :views expressed herein are not necessarily those of my employer, but they let me :have them anyway.
I sent this off a couple days ago, but did not see it on the list ... please excuse the traffic if you are seeing this for a second time. I am writing some code (PHP3/4 on Apache) that encrypts some text using PGP and writes it to a log_file. I am having problems getting the line breaks to remain intact from the original unencrypted version to the final decrypted version. Here's my code: // first I setup a variable with the message to be encrypted, // note the line breaks $msg = " * * * * * * * * * * BILL TO: $type_of_card $card_number $users_name ($expiration_date) $b_first_name $b_last_name $b_address_1 $b_address_2 $b_city, $b_state $b_zip $b_day_phone $b_night_phone $b_email * * * * * * * * * * "; // next I set the environment variable for PGPPATH putenv("PGPPATH=/.pgp"); // then I place the message that is to be encrypted in a file $fp = fopen("plaintxt", "w+"); fputs($fp, $msg); fclose($fp); // fyi ... if at this point, if I were to open the file plaintxt // all of my line breaks would still be there // next I encrypt the data and write it to a file called crypted system("/usr/local/bin/pgpe -r [EMAIL PROTECTED] -o crypted -a plaintxt"); unlink("plaintxt"); // now ... if at this point I were to open the file crypted and decrypt it // I would get my message in a long line with squares where every break should be // here's the method I use to get this crypted data added to my log file $fd = fopen("crypted", "r"); $msg_crypted = fread($fd, filesize("crypted")); fclose($fd); unlink("crypted"); $order_log = fopen("order_log", "a"); fwrite($order_log, $msg_crypted); fclose($order_log); So, if anyone can help me figure out a way to keep these line breaks in place all the way through to decryption, I would be VERY appreciative. I know this is possible ... because, if I take the same message from my code and place it in a text editor ... encrypt and decrypt it using my desktop PGP software ... all of the line breaks remain intact. Please help! Thanks, Nick
Hi! I need some help with this one. See When I upload a file to a server to my directory..I connect to the server using Wsftp_pro. Now I want to find out exactly what is the path to my directory on the server... Actually I will be uploading files to the server using php from the web browser... Is there a php function to find out the path to my directory..or is there any other way..? Thanx a lot! Dhaval Desai __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/
> > Is there a php function to find out the path to my > directory..or is there any other way..? Have a look here http://www.php.net/manual/en/language.variables.predefined.php $PATH_TRANSLATED I think gives you the full path to your script. If not one of these will M@
I just build a new redhat 6.2 server (intel) to install php4 and apache on I'm trying to compile php as an dso module. Apache compiled and installed just great. WHen I try to build php4 woth the following ./configure --with-apxs=/www/bin/apxs --with-imap --with-gd --with-jpeg=/usr/lib --with-xpm-dir=/usr/X11R6/lib --with-png=dir=/usr/lib I get the follow when I configure: checking whether to enable truetype string function in gd... no checking for libjpeg (needed by gd-1.8+)... no configure: warning: If configure fails try --with-jpeg-dir=<DIR> checking for libXpm (needed by gd-1.8+)... yes checking for XpmFreeXpmImage in -lXpm... (cached) no no checking whether to include GD support... yes (static) checking for gdImageString16 in -lgd... (cached) no checking for gdImagePaletteCopy in -lgd... (cached) no checking for gdImageColorClosestHWB in -lgd... (cached) no checking for compress in -lz... (cached) no checking for png_info_init in -lpng... (cached) no checking for gdImageColorResolve in -lgd... (cached) no checking for gdImageCreateFromPng in -lgd... (cached) no checking for gdImageCreateFromGif in -lgd... (cached) no checking for gdImageWBMP in -lgd... (cached) no checking for gdImageCreateFromJpeg in -lgd... (cached) no checking for gdImageCreateFromXpm in -lgd... (cached) no checking whether to include FreeType 1.x support... yes checking for T1lib support... no I get this when I compile: /usr/bin/ld: cannot find -lgd collect2: ld returned 1 exit status make[1]: *** [libphp4.la] Error 1 make[1]: Leaving directory `/tmp/apache/Apachetoolbox-1.5.2/src/php-4.0.4pl1' make: *** [all-recursive] Error 1 these dirs are where the libs live. I can't see whats wrong. I added the above dirs to the path also -Dave
One thing to take a look at is ApacheToolBox, a simple text based script that installs apache/mysql/php mod_perl and others (individually selectable). http://www.apachetoolbox.com/ On 16 Feb 2001 13:57:09 -0500, David OBrien wrote: > I just build a new redhat 6.2 server (intel) to install php4 and apache on > > I'm trying to compile php as an dso module. > > Apache compiled and installed just great. WHen I try to build php4 woth the > following > > ./configure --with-apxs=/www/bin/apxs --with-imap --with-gd > --with-jpeg=/usr/lib --with-xpm-dir=/usr/X11R6/lib --with-png=dir=/usr/lib > > I get the follow when I configure: > checking whether to enable truetype string function in gd... no > checking for libjpeg (needed by gd-1.8+)... no > configure: warning: If configure fails try --with-jpeg-dir=<DIR> > checking for libXpm (needed by gd-1.8+)... yes > checking for XpmFreeXpmImage in -lXpm... (cached) no > no > checking whether to include GD support... yes (static) > checking for gdImageString16 in -lgd... (cached) no > checking for gdImagePaletteCopy in -lgd... (cached) no > checking for gdImageColorClosestHWB in -lgd... (cached) no > checking for compress in -lz... (cached) no > checking for png_info_init in -lpng... (cached) no > checking for gdImageColorResolve in -lgd... (cached) no > checking for gdImageCreateFromPng in -lgd... (cached) no > checking for gdImageCreateFromGif in -lgd... (cached) no > checking for gdImageWBMP in -lgd... (cached) no > checking for gdImageCreateFromJpeg in -lgd... (cached) no > checking for gdImageCreateFromXpm in -lgd... (cached) no > checking whether to include FreeType 1.x support... yes > checking for T1lib support... no > > > I get this when I compile: > > /usr/bin/ld: cannot find -lgd > collect2: ld returned 1 exit status > make[1]: *** [libphp4.la] Error 1 > make[1]: Leaving directory `/tmp/apache/Apachetoolbox-1.5.2/src/php-4.0.4pl1' > make: *** [all-recursive] Error 1 > > these dirs are where the libs live. I can't see whats wrong. I added the > above dirs to the path also > -Dave > > > -- > 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] > > -- Christopher R Moewes-Bystrom Front-End Engineer FanBuzz.com [EMAIL PROTECTED] (952) 852-8806
This has been an ongoing problem, when I include a file which contains a call to a function I get undefined function errors but when I try to include the file containing the function I get cannot redeclare function error messages, I can't win how do I make sure my functions are available to any script whether included or whatever. -Mark
> > This has been an ongoing problem, when I include a file which contains a > call to a function I get undefined function errors but when I try > to include > the file containing the function I get cannot redeclare function error > messages, I can't win how do I make sure my functions are available to any > script whether included or whatever. > is the function declared before file is included? I'm not sure but this may cause a problem. As for getting the redeclare error, are you sure the function is not declared in the page or any other file that is included. Sorry if this seems a little obvious.. Regards M@
Try include_once() for your includes instead of simply include(). --toby Matt Williams wrote: > > > > > This has been an ongoing problem, when I include a file which contains a > > call to a function I get undefined function errors but when I try > > to include > > the file containing the function I get cannot redeclare function error > > messages, I can't win how do I make sure my functions are available to any > > script whether included or whatever. > > > is the function declared before file is included? > I'm not sure but this may cause a problem. > > As for getting the redeclare error, are you sure the function is not > declared in the page or any other file that is included. > > Sorry if this seems a little obvious.. > > Regards > > M@ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED]
I just spent about 5 hours trying everything i could think of to get sessions to work....ends up it was a simple problem that I should have realized before i even started. So, learn my oversight, save yourself 5 hours of going nuts. I have several scripts that all pass vars between themselves....ONE of those scripts is on www.domain.com all the rest are on subdomain.domain.com well, all the scripts that are forms have the form action set as action=http://www.domain.com/script.php nevertheless, I couldn't grasp what was wrong...the problem is that the session information is trying to be passed among more than one domain (www and subdomain)...coookies don't like this and weren't releasing the info to the subdomain that was created in the www domain. So, heads up to anyone else...keep all your scripts in the same domain when using sessions/cookies. By moving hte one script to the subdomain as well, all the problems went away and PHP is once again my favorite we language :) jon
Hi, I have a form that contains a scrolling text box. When I display the contents of the text box, say in variable $form[mytextbox], it displays all on one line (or wraps at end of line). As the ending character of each line will vary, does anyone know of away to split the lines up so that I can display the text box contents line by line? Thanks, Don
There's a new mod_gzip out that does work with PHP output. Have a look at www.dvanhorn.org All the pages are PHP generated, with nothing special in the PHP code. -- Dave's Engineering Page: http://www.dvanhorn.org Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9
On Fri, 16 Feb 2001, Joe Sheble aka Wizaerd wrote: > Is there anything that evaluates PHP code and checks for optimization? Not > like the Zend Optimizer, but one that checks for things such as variables > that were defined but never used, repeated variables, unnecessary > statements or constructs? Basically a code cleaner such as C, C++, Java, > etc all have? And, on a related (but maybe not really) note. Is there anything like a PHP code obfuscator sort of like the old C shroud? I'm looking at something that reads a PHP script, looks at all include files it depends on, and then goes through them all and changes function names, class names (if any... i still write only functions... despite java and C++ experience, getting conservative in my old age), parameters and local variables? I could go with the Zend tools, I suppose. but there isn't enough money here for that yet (third-world... who can afford software that costs the same as the salaries of 8 to 10 programmers?). someday... in the meantime, well, i'd rather use someone else's tool than spend a month or so hacking out my own. i'm aware that such a tool would not work as simplistically as i've said above. that's just an example :). of course i'm aware that the thing would have to go through my entire codebase and use a common symbol table/translation table for all files in the codebase :). tiger -- Gerald Timothy Quimpo [EMAIL PROTECTED] http://members.xoom.com/TigerQuimpo entia non sunt multiplicanda veritas liberabit vos praetere necessitatem mene sakhet ur-seveh
At 3:30 AM +0800 2/17/01, Tiger Quimpo wrote: > >I could go with the Zend tools, I suppose. but there isn't enough >money here for that yet (third-world... who can afford software that >costs the same as the salaries of 8 to 10 programmers?). someday... > Even with the new Developer's Suite and reduced Encoder pricing? -- Jim Jagielski <[EMAIL PROTECTED]> CTO and PHP Evangelist, Zend Technologies - http://www.zend.com/ [V: +1 410-420-0140 | F: +1 410-803-2258 | M: +1 443-324-8390] Visit the Zend Store at http://www.zend.com/store/
Hi All, It is Friday afternoon here and I don't want to have to reinvent the wheel. What would be the easiest way to delete an item from a shopping cart? I know what is required for Mysql but I am stumped on how to implement it. TIA Gary
Addressed to: Maxim Maletsky <[EMAIL PROTECTED]> [EMAIL PROTECTED] Christian Dechery [mailto:[EMAIL PROTECTED]] ** Reply to note from Maxim Maletsky <[EMAIL PROTECTED]> Fri, 16 Feb 2001 12:18:27 +0900 > > I never used 50 of them, but I think there's such a thing as 'register > globals' wchich makes all if the globals become available inside your > funcs...... no idea how to use it ... I feel like I've seen it in = > someone > else's code ... > > correct me if I am wrong ... Consider your self corrected... :) register_globals is about placing GET/PUT/COOKIE/ENVIRONMENT variables into the global scope. It has nothing to do with functions. Rasmus explained why you need to declare variables as global in EVERY function that uses them here: http://marc.theaimsgroup.com/?l=php-general&m=97984136422910&w=2 and here: http://marc.theaimsgroup.com/?l=php-general&m=97717866712033&w=2 You may as well get used to it, it isn't going to change any time soon... Rick Widmer Internet Marketing Specialists http://www.developersdesk.com
Can I get some recommendations on some good PHP books. Something broad but with good novice concepts........
Brian V Bonini wrote: > > Can I get some recommendations on some good PHP > books. Something broad but with good novice > concepts........ There are many at http://php.net/books.php. Maybe Leon Atkinsons Core PHP (second edition) or Sterling Hughes Developer's Cookbook. -Egon -- SIX Offene Systeme GmbH · Stuttgart - Berlin Sielminger Straße 63 · D-70771 Leinfelden-Echterdingen Fon +49 711 9909164 · Fax +49 711 9909199 http://www.six.de Besuchen Sie uns auf der CeBIT 2001, Halle 6, Stand F62/4
Hello All, Sometime later today, I will share with all of you how to perform inserts from PHP using the DB2 Universal Connection into an AS400 Table. Yes, we figured it out! Look for my post by end of day (Friday). Karl
Hello! Has anyone succeded installing php4 on a cobalt raq3 server? I have the following problem: If I compile php with mysql included in php distribution, it can't connect to database. For example phpMyAdmin gives me this error(it seems that mysql_error() return nothing): Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/sites/site17/web/phpMyAdmin/lib.inc.php on line 255 Error MySQL said: Back If I compile it with option with-mysql=/usr the apache server don't start(gives a lot of SEGV). I use mysql-3.23.33, installed from rpms from www.mysql.com. Otherwise mysql works very good(ie from command line). thanks for any help, mache