logs archiveIRC Archive / Freenode / #php / 2006 / April / 7 / 1
zimnyx
Ahroun: i need this before i send body.. so i can modify headers
but dunno if i can cancel one.
FenixRF
I have a question. Is there a simple way that I can append a jscript snippet at the end of all .php|ht?l files without modifying every single page?
I'm looking at putting the jscript snippet at the end of each </body> tag
Ahroun
zimnyx: no, you can't cancel a header. lra_ might be right about being able to override one though. Why in the word are you sending a header you're going to cancel though?
ks
looks like this doesn remove white space: '@([\r\n])[\s]+@'
should I just use \S ?
nexact-
hey, is money_format(); broken? money_format('%+#2.2i',$row[4]) and it still display (#2.2i) .. I want -#2.2i
zimnyx
Ahroun: whole system using nocache as session_cache_limiter, but there is a but in IE which can be fixed only be changing it to cacheable. i'd like to use session_cache_limiter('') but it can;t be called again after session_start() was called. So only way is to menualy set header('Cache-control: ....') to overrride already set nocache header..
Ahroun
zimnyx: Sounds fishy to me in the sense that it sounds like you should be approaching it differently. Precisely how I can't really say, and unfortunately I need to get ready to head home from work.
nater
how would you get 2 mondays ago using strtotime?
zimnyx
Ahroun: sure.. it's easy, i just need to call session_start() a bit later:)
Ahroun: but i got dozen of classes here, i need to talk about it with other guy.
         

FenixRF
nater, 2 weeks = 1,209,600 seconds
Jymmm
!+60*60*24*14
php-bot
1209600
Jymmm
php-bot botsnack
php-bot
Jymmm: :)
FenixRF
I just said that ;)
Ahroun
zimnyx: Heh. Then I really can't help ya'. I hate the use of classes with a passion. ;) Anyways, good luck to you guy. I'm out.
nater
fenix: the reason i'm asking is i've run across some code using strtotime("last Monday") and it for some reason works...
kennebel
86,400 seconds in a day, good to remember, then you just have to multiply by number of days. :)
FenixRF
nater, that's cus it's a part of strtotime
pyxl
of course, there are 2 days a year where that's not entirely true.
FenixRF
you could also use strototime(-2 weeks)
Jymmm
FenixRF and your point is?
FenixRF
that I'm not as fancy as you
pyxl
...in some parts of the world.
sci
Ahroun, it didn't work with the stream functions, but there are ncurses-bindings for PHP that works great
nexact-
money_format(); is BROKEN
Stormchaser
no, your CPU is BROKEN.
nexact-
test it by yourself: echo money_format('%=*+#10.2n','-5.36');
it's supposed to give -*********5.36 but it's giving (*********5.36)
FenixRF
nexact-, that's cus money_format encloses negative values in ( )
which is the way the financial world defines negative values in accounting
         

GarethAdams
FenixRF: not according to the manual, you have to explicitely ask for ()
nexact-
FenixRF, yes but I've supplied + in the format, it's not supposed to encloses it in ( )
GarethAdams
"If ( is used, negative amounts are enclosed in parenthesis. If no specification is given, the default is +."
nexact-
even if I don't supply it, it's enclose it
GarethAdams, you think it's a bug ?
FenixRF
nexact-, I took your code just as you typed it
GarethAdams
The function says locale settings affect it, but that's only the currency symbol
FenixRF
http://cleanup.rdfleming.com/test.php
Stormchaser
nexact: Which PHP version?
nexact-
my phpinfo(); http://nexact.mindkind.org/test.php
5.1.2
FenixRF, what I typed: http://nexact.mindkind.org/test2.php
FenixRF
I'm using PHP 4
Stormchaser
5.0.5 works fine
nexact-
rhmm weird.
Stormchaser
nexact: Type it in your CLI
snoyes
Using PHPUnit2 v. 2.3.5, I have the same issue as in PEAR::Bug #5053. The bug is listed as fixed. Do I still need the CVS version of PHPUnit2, or should I open another bug report?
Stormchaser
snoyes: We don't support phpunnit nor #pear
!+pear
php-bot
[PEAR] PHP Extension and Application Repository, a framework and distribution system for reusable PHP components. ##PHP does not support PEAR, please see http://pear.php.net/support.php.
snoyes
thanks, I'll try #pear.
FenixRF
test.rdfleming.com :: PHP 5.1.2
err test.rdfleming.com/test.php
shows -**********5.36
Andy298
how can i auto fill a select box with date and select the current date (then another select one for months)
FenixRF
default="<? date(?) ?>"
something like that
Stormchaser
Aaaargh!
FenixRF
no... value=
Stormchaser
!+short tags
php-bot
Short tags are <? or <%, and should never be used. They are scheduled for removal from PHP6, and are configuration dependant. Use <?php, period.
FenixRF
Stormchaser, that is my bad... I never use short tags...
Andy298
FenixRF: must need a loop to loop around the avaiulable dates / months
Jaywalker
Hey, i fell asleep last night before i could get an answer
PHP is yelling at me about a file called lex
FenixRF
Andy298, create yourself an array
Jaywalker
any idea what to do?
FenixRF
then loop that array
when filling in your values
nexact-
Stormchaser, I've just typed it and it output exactly the same thing
(*********5.36)
(in my CLI)
kennebel
Any cURL savvy folks here? Specifically, i am trying to perform multiple execs in one 'session', success with that? (php 5.1.2)
Questutis
why can I get this error ? i do not get it ? "Warning Error: (array_search(): Wrong datatype for second argument) in file siteMain.php on line 81" ? my Array is $theSite['url']['file'][0]; ?
nexact-
I havent tried that but cURL is really nice :)
Stormchaser
kennebel: Can you try that nexact's command? echo money_format('%=*+#10.2n','-5.36'); in your CLI. We're pondering if it's a bug or not.
kennebel
Stormchaser: Sure.
AcidReign
Questutis: maybe you passed it the wrong data type for the second argument ?
Questutis
AcidReign: how to understan wronf datatype ?
it is an array with values :/
AcidReign
!+func array_search
php-bot
mixed array_search(mixed needle, array haystack [, bool strict]): Searches the array for a given value and returns the corresponding key if successful
Stormchaser
Questutis: is it? Have you checked it?
AcidReign
Questutis: you need to pass an array of strings or numbers as the second argument
Questutis
print_r() gives - [0] => Array
(
[0] =>
[1] => main
[2] => about
...
AcidReign
Do not flood.
Questutis
sorry :(
Stormchaser
*blink*
FenixRF
Hey, is there any way to append a snippet of jscript after the closing body tag, besides doing a sitewide search/replace?
AcidReign
Questutis: $ php -r "print_r( array_search( 'foo', array( 'bar','foo','baz' ) ) );"
1
kennebel
Stormchaser: I cannot test it, apparently the function is undefined in WIndows, my linux box isn't up right now with php (have to reinstall)
AcidReign
FenixRF: auto_append_file ?
Stormchaser
kennebel: money_format should NOT be platform-dependant.
nexact-
I'll test it on my other boxes
AcidReign
FenixRF: it'll only work on files run through PHP
FenixRF
AcidReign, I was thinking that... but I'm not so sure where it'll append to...
Questutis
yes AcidReign the function works, but I do not know why it gives this warning above.
AcidReign
kennebel: I'm sure apache has an option, most free hosts use that
FenixRF: the end
FenixRF
yeah... the end is too far :)
needs to be between </body> and </html>
AcidReign
FenixRF: well than you have to insert it yourself
or do some complicated trickery that is not guaranteed to work
mattmcc
Erm. Nothing should be between </body> and </html>.
AcidReign
then there's that
FenixRF
yeah... I have over a thousand pages to change (easy with search/replace) ... but the code won't be in any new pages
kennebel
Stormchaser: http://us3.php.net/manual/en/function.money-format.php Read the "note" section.
FenixRF
mattmcc, tell Google Analytics that
mattmcc
FenixRF: Google isn't known for its markup validity interests.
FenixRF
yeah. corporate wants google analytics... google wants their jscript immediately following </body>
mattmcc
That's a shame.
snoyes
we put the google analytics jscript just before the </body>. Seems to work fine.
kennebel
Stormchaser: http://kennebel.com/mon_test.php (on linux/apache/php 5.0.4)
-*********5.36
nexact-
Stormchaser, I've just tested it on 5.0.5 it work fine too.
Laban
Hello
Is it likely that the <?= -short-tag will be deprecated/removed?
<? should be and <?php should be used more... But <?= is very handy.
FenixRF
ah well
thanks
gotta go
night all
nexact-
Stormchaser, It seems the problem is only happening on my FreeBSD 5.4... should I report it ?
ks
is this valid expression ?$image_name='@gallery_([0-9]).png@;
$img=preg_match($image_name,$template)
it looks in <img src="/assets/gallery_5.png"
walrusnip
which do you prefer $_ENV or getenv()
as for myself, i find that $_ENV is spotty and doesn't actually fetch the environment on some systems.
Pooky
walrusnip: I've had the same experience
kennebel
Well, that's a work day for me. ttyl
S^Gerbitz
okay yall I have a stupid question, I want to insert html code inside of a text area box, how would I do that?
like <text area> html code </textarea>
walrusnip
Pooky: thank goodness. i though i was going CRAZY!
Pooky
walrusnip: I used to check for the user running the script using the env variables, now I have to do $processUser = posix_getpwuid(posix_geteuid());
AcidReign
S^Gerbitz: Err... you mean, you want to have formatting in a textarea? You can't.
walrusnip
Pooky: the env user would be the one who started apache though.
Pooky
walrusnip: I have some php shell scripts :)
walrusnip: for table maintenance and such
S^Gerbitz
AcidReign - I mean like I want to show html code inside of a text area box. like this <text area> <img src="pic"> </textarea>
like that
« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 next »