logs archiveIRC Archive / Freenode / #php / 2006 / March / 28 / 1
zbq
does anyone have a magic way of stripping ALL of the MSWord garbage out of pasted in text? I have a series of steps I take to try to make my text clean but there always seems to be something new that pops in and hoses XML down the road. Any thoughts?
debiankid
boro_O funny
zbq
I would be happy stripping all text down to 7-bit ASCII
EvilGuru
what is the best way to loop through each line in a string?
mattmcc
Make it an array?
EvilGuru
is there a function to split by '\n'?
mattmcc
No, but there's a function to split by any character.
http://php.net/explode
EvilGuru
ah yes explode, then I have a loop to join em back up?
mattmcc
Or you could use http://php.net/implode
Also aliased by join()
         

debiankid
kso
EvilGuru
explode/implode combo seems by best bet, thanks
philip
and you may want "\n" instead of '\n'
enygma
(Action) plays more with the framework
Xsploit
ive got an old nokia here (step up from the 3310, black and white) anyone know how i can find the model number ?
ozzy
hello all
I have probably the most idiotic newbie question there is
kjaer
ozzy: Congrats.
Stormchaser
!tell Xsploit about fgi
ozzy
but when connecting to mysql from web based php code, should I maintain one connection open or should i keep opening a new connection everytime I need to query some data?
kjaer
ozzy: Keep one connection open
ozzy
kjaer: thanks, that's kinda what I was thinkingbut wanted to check
eighty
errr... has anyone performed HTTP authentication against IIS via php?
i did it with CURL, but the authenticated session doesn't follow the user into the site...
so (1) user enters login/pass... (2) i use curl to authenticate... (3) i setcookie() and forward response to site... (4) but user gets the HTTP authentication dialog box!
arg :\
;)
Skinkie
fumanchi, back here
nater
why would you use a heredoc instead of just assigning the value with = and .=?
philip
when i see code with 50 $foo .= ' '; i delete it immediatly :)
Dragnslcr
nater- because you don't have to escape quotation marks in heredoc
philip
heredoc has advantages, like not worrying about ' and "
itrebal
philip: whats teh point of that..?
philip
i was referring to the questiona bove
Shroom
php, even run standalone, on debian linux, is giving me a PHP Warning: mime_magic: type regex [stuff] invalid in Unknown on line 0 (see http://pastebin.com/625818 ) Google isn't helping so far, any thoughts?
         

philip
Shroom: php --version for example does this too?
Shroom
wow.. yes. o.o
Martyn
Afternoon everyone.
chisler
good night :)
Martyn
Stupid planet, with the sunside, darkside .. grrr. *heh*
chisler
:p
Martyn
So, someone was asking on Friday about the broken XML extension for PHP 5.
Anyone remember who it was? I think I found/fixed the bug.
ph8
If i wanted to store say, three names in a database field, what would be the best way to do it? Some sort of hashing function? or would i just use something like john smith; paul johnson; david jones ?
mattmcc
ph8: If you have any reason to access the names separately, you want them in different fields.
Dragnslcr
You'd have a separate table of names
Xyphoid
Don't Do It, but if you have to, a serialized array works
ph8
what if the number of names is variable?
mattmcc
Then you make a table for them.
ph8
ah
cunning
mattmcc
Normalization.
ph8
you mean Normalisation.
:)
Stormchaser
He ment cookies, but that's close enough.
Shroom
So does anyone have an idea of where to go from here? (see http://pastebin.com/625818 does this for --version too)
philip
so it works when disabling mime magic extension?
krookster
Jews Did WTC!!! http://www.jewsdidwtc.com
SUKI: New WORLD RELIGON http://www.sukireligion.org/
Jews Did WTC!!! http://www.jewsdidwtc.com
SUKI: New WORLD RELIGON http://www.sukireligion.org/
Bazzi
big spam night tonight
Stormchaser
sh*t. wrong nick :(
Tresnar_
Shroom: http://groups.google.com/group/linux.debian.bugs.dist/browse_thread/thread/4317bda4c8d4ac32/ab0f186dba8864f4%23ab0f186dba8864f4 seems interesting
Jymmm
TML: ^^^^^^^^^^^^^^^^^^
Shroom
philip Well, it is just a warning, is mime_magic in php.ini? Would packages that depend on it like drupal be at risk of breaking if it turn it off?
Tresnar_
In any case, disabling the mime_magick extension in php.ini would be a good diagnostic step.
xahlee
when uploading a file in a form, $_FILE[img][tmp_name] => /tmp/phpu8pNOL but /tmp is empty. What could be the prob?
philip
drupal should not use that deprecated extension
Shroom
uh... mime_magic isn't found in the ini.
itrebal
Jymmm: i thought tor was already well-banned?
philip
xahlee: it gets deleted, move it in your script before that happens
Shroom
maybe a different ini? Can I find out somehow which config file it is using?
Stormchaser
php -i
Ahroun
You ever find yourself wishing that if someone was going to spam you that they'd at least have the courtesy to have something worth viewing at their site besides a holding page or a 404 Error?
Jymmm
itrebal it was, got removed
philip
Shroom: httpd.conf
itrebal
Jymmm: by who?
Tresnar_
Shroom: Did you check out the google groups posting?
xahlee
philip: i have the move statement right there but is not in the dest dir neither...
Stormchaser
itrebal: Cleanup lady
itrebal
Stormchaser: gotchay
kuja
wazzaaap
philip
xahlee: move func returned what?
anything in [error]?
itrebal
good to know that "jews did WTC"
xahlee
philip: philip didn't put a check in move fuc... will do now
Tresnar_
Ahroun: Both were non-404 for me. The WTC one is by the GNAA, which is a well known Slashdot trolling gag group.
Ahroun
Tres: I got the suki one. It suk-ied alright. *snicker*
itrebal
"Word of caution: In it's deepest roots jewsdidwtc.com is not a hate site... it is a theorem based off many postulates and axioms. We do not wish to promote or condone violence or hate, but spread what believe is truth." directly off the jewsdidwtc.com
adggg
funny sh*t: jewsdidwtc.com
did you see the "loose change" documentary
download it from googlevideo
Shroom
Can I disable mime_magic in the ini? I have a precompiled debian package, so I can't use the compiler flags. Google isn't helping
Jymmm
adggg enough, please.
foukou
I keep getting a PDO/mysql error saying that "Table 'marco.syndicated_accounts' doesn't exist" even though It does and the table name has been backquoted in the code.. What might be causing this?
TML
itrebal: By me.
itrebal
TML: ok
philip
Shroom: look in php.ini for included .so files
Shroom
philip: only mysql.so and imap.so
philip
i don't believe debian would enable mime_magic by default, something is strange here
Toerkeium
hello
does anyone knows a free program to make program diagrams ?
Shroom
I agree. It started showing up in my logs about a day ago, after a package update. But.. Its a little over my head at this point.
bbtech
how do you lengthen the time a session is kept?
itrebal
Toerkeium: create_program_diagram(file)
TML
philip: mime_magic is on by default
bbtech
Toerkeium: uml pad is a nice simple one --> http://web.tiscali.it/ggbhome/umlpad/umlpad.htm
Toerkeium
thanks guys
a_me
hi
philip
debian enables a depreciated extension by default? that's unfortunate
a_me
is there any way to get all atributes' names from an object?
Shroom
It doesn't seem to hurt anything, it's just that the warnings are cloging logs and cron emails. :/
TML
philip: I don't believe it's deprecated in the version of PHP shipped with stable. :)
philip
heh
Shroom
(testing in my case, but probably similar)
philip
Shroom: does it find your mime file?
TML
Shroom: Last I checked, the build packages haven't been changed from stable yet
Shroom
Uh.. I would assume it would chuck another error if not?
Stormchaser
a_me: Um... var_dump()
xahlee
philip: apparently is_uplooaded_file is true but move_uploaded_file returned false. What should i check for errors?
a_me
I need them in an array or something
philip
Shroom: php.net/mime-magic for info on mime file location setup, but perhaps you are right... the error is strange though so i'd think this could be it
xahlee: check php.net/features.file-upload for an example use, and info
xahlee: be sure to use full paths everywhere
xahlee
philip: my code is pretty much based on that... yeah full path
Shroom
Hrmm.. It could be something upgraded a mime file it wasn't supposed to? Can I get a mime file to rub its face in? :P
philip
xahlee: so [error] is what?
permissions of new dir are okay?
xahlee
philip: could there be some server setting thing at all?
philip
it could be anything :)
endra
hey
philip
file upload questions are almost as bad as installation questions, and worse then session questions
lig
Morning
endra
I am running php on my home server (win32) and I want to limit php's file access to the htdocs folder only.. same with its exec() shell() and whatever other functions that can be used to run files or access files outside of its limits
how can I do so?
philip
endra: consider open_basedir or something like that
yep, that's the one :)
MarkR
endra: Enable safe mode, and fopen_basedir on that directory. Disable all functions which execute things.
Stormchaser
ew
kuja
safe_mode already does that.
MarkR
OR, don't enable safe mode, just set fopen_basedir and disable all the execution functions
Yes, btu safe mode sucks badly
Stormchaser
yes
endra
is there a certain list of all the execute functions?
« 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 26 27 28 29 30 31 32 next »