logs archiveIRC Archive / Freenode / #php / 2006 / April / 11 / 1
||cw
sonasks: no. nothing here is magic. the coder created the arya, and echo'd it in such a way that your browser refuses to wrap it
sonasks
ok, thanks for the help
winmutt
database > files 99% of the time
NRG88
thanks
swarmz
evening all
I have an interesting question!
Stormchaser
I have one too, but I'll let you go first.
swarmz
I need to turn off Strict Standards on a specific file (DB.php from PEAR). is there any way to do this?
Stormchaser
#pear
NRG88
thanx, i'll use a database then
         

swarmz
this is not a PEAR specific question
r0xoR
is it $PHPSELF or $PHP_SELF
mattmcc
swarmz: Um. You can change the error level before & after requiring the file, certainly. But that won't affect the error level when the code in that file is actually being used.
r0xoR
?
Stormchaser
'mkay. then error_reporintg (e_ALL);
*reporting
r0xoR
for use in forms for example
underscore? no underscore?
mattmcc
r0xoR: $_SERVER['PHP_SELF']
r0xoR
mattmcc, aight, isn't there a shorthand one? i'm pretty sure that reg-globals is turned on
mattmcc
Don't trust register_globals.
r0xoR
aight
||cw
r0xoR: i woulnd't count in reg globals
swarmz
Stormchaser: that won't work for errors that are evaluated at the compile time
r0xoR
k
bucky5
hey, i was just trying out this code in a book im reading, but php is giving me an error....the code is $hDB = pg_connect("pgsql stuff..."); (\n) or die("text"); ...it gives me an error on or die
r0xoR
yeh, good idea i suppose
||cw
r0xoR: it's very likely to be removed in a future php version
Stormchaser
swarmz: *blink*
!+error reporting
php-bot
Error reporting: Add <?php error_reporting(E_ALL); ini_set('display_errors', 'on'); ?> to the top of your PHP script to display all errors, or set the display_errors to 'on' in your php.ini and error_reporting to E_ALL in your php.ini
||cw
swarmz: then you are screwed.
fix pear
tst_
Hey
         

||cw
bucky5: the hell is "; (\n)"
tst_
if I get a "Maximum execution time of 30 seconds exceeded in" from my script a various lines, can I be sure that it is a server issue?
phos
if i have a date say 4/11/06 how to i turn it into the ticks number
Stormchaser
||cw: ninja on a stick.
||cw
tst_: no, it's probably a code issue
bucky5
that was just to indicate that the or die part was on the next line..its not actually in the code
mattmcc
tst_: No, it could be an infinite loop.
swarmz
tst_: it's an issue of your script taking to long to complete
phos
how do i turn 4/11/06 into time()
mattmcc
phos: http://php.net/strtotime
phos
k
tst_
swarmz and mattmcc, but it times out a line 182 then 316 then sometimes another line, etc. but always around a script
sorry, always around a query
||cw
bucky5: k, "or" needs soemthing to the left (a newline will be ignored) but a ; is not valid
tst_: then several parts are taking a long time, but different amounts of time on different data
excelblue
does mcrypt come preinstalled with most php distros?
* most php setups
||cw
tst_: if ti really needs that long, increase the max exec time
Crell42
Greetings. If I have a unix timestamp, how would I get the timestamp of "the same time next Tuesday"?
tst_
||cw, it's the same page... the same data it should be processing
Crell42
Can strtotime() handle "next Tuesday at $time"?
||cw
Crell42: strtotim("next tuesday", $time);
mattmcc
The manual page references information on supported formats.
tst_
||cw, yeah.. I think I'll have to do that, I just wanted to see if there were other possiblities as to why it might be timing out
||cw
tst_: is it shared hosting?
Crell42
||cw: No, that gives me midnight on next tuesday.
I just spent several hours discovering that the hard way. :(
tst_
||cw, yes
||cw
Crell42: ok, combine that with mktime()
Crell42
hm.
||cw
tst_: ah, so sometimes you are getting fewer cpu timeslices
Crell42
Which one on the inside?
||cw
Crell42: use the next tues for the date parts and the old time for the time parts
Crell42
hrm. So get the timestamp for next tuesday, break it out with getdate(), then feed that back into mktime()?
T_V
hello all. i do have a problem with php and image functions. i want to add a watermark on an image. That works, but the watermark image (png) has to be transparant. it contains a small image and the rest of the image is white. when i try to make it transparant (imagegetcolor($watermark, 255, 255, 255);) it wont get transparant. does anybody has got an idea what i am doing wrong ?
||cw
Crell42: yeah
TML
T_V: You have to use truecolor images all the way through
||cw
T_V: imagegetcolor isn't a php function
Crell42
Sounds over-complicated, but if it works I'll take it. :-) Thanks.
T_V
||cw: true. its a function to get the color (from php.net ;) )
||cw
T_V: yeah, not there
T_V
TML: so i have to use for example a jpg that has true color and a white background
||cw: created myself
||cw
T_V: imagecreatetruecolor is not format specific
T_V
well the problem should be somewhere with truecolor
thanks
Storkme
hi, can anyone help me? i need to somehow transform '[article=Article_Name]' into '<a href=viewArticle.php?articleName=Article_Name>Article_Name</a>'
Stormchaser
Storkme: um.. explode()?
Storkme
explode what? the = ?
archivist
and a bit of concatination afterwards
TML
Storkme: Why not use normal BBcode and the PEAR BBcode parser?
Storkme
TML, the pear bbcode parser is a mess
TML
Storkme: BBcode is a mess
I fail to grasp your point
Storkme
lol
Stormchaser
Storkme: you can always fix it.
Storkme
i'm using the punbb bbcode parser
Stormchaser, i'm really inept at php
excelblue
what's the fastest way I can encrypt something?
swarmz
md5()
excelblue
I plan to make a file-based forum, but am not so sure if I should encrypt all the posts, etc just to be safe
TML
swarmz: That's not encryption
Stormchaser
Storkme: So... Um.. Learn it?
excelblue
md5 is a hash though
TML
excelblue: mcrypt
swarmz
woops sorry
Storkme
Stormchaser, :(
excelblue
ah, how fast can that go for encoding maybe 10kb of data?
TML
excelblue: 17
joeyjones
does anyone know how to install the gd library into php?
Stormchaser
Storkme: what? If you want to do something, LEARN!
winmutt
why is $_REQUEST=unserialize($_REQUEST['oldRequest']); not valid?
excelblue
TML: can it encrypt fast enough that some forums won't take forever to load?
TML
joeyjones: Yes, including the PHP manual.
excelblue: Encrypting forum posts is probably a bad idea
joeyjones
TML: you mean read the manual, right?
mattmcc
winmutt: Well, it is syntactically valid, albiet weird.
TML
joeyjones: I do indeed
excelblue
ah... so I should just leave them in plain text?
and depend on stuff like .htaccess for security?
winmutt
mattmcc: yes but $_REQUEST=null then
excelblue
or what's the best way to secure such stuff?
joeyjones
excelblue: for it to be true encryption it's jsut 1 way encription...
excelblue
it's not true encryption if it's one way
Storkme
Stormchaser, yeah, that's one option :|
mattmcc
winmutt: So the value of $_REQUEST['oldRequest'] was not a properly serialized value.
excelblue
since encryption must be reversable
TML
excelblue: I don't understand what you're trying to do. Is this some forum for drug lords or arms dealers?
Storkme
one way encryption is called a 'hashing'
excelblue
no... it's just a gaming forum
Stormchaser
Storkme: ss/one/only.
excelblue
though there are some conversations that I'd prefer that nobody leak out on the forums
eg. strategy, etc.
joeyjones
cause if it can be unencrypted it aint secure
TML
excelblue: Then moderate posts
Storkme
excelblue, and moderate users
excelblue
the thing is, there's going to be posts for only a few select people
TML
joeyjones: WTF are you talking about?
Storkme
joeyjones, lol.
winmutt
magic quotes came from somewhere :(
excelblue
I'm afraid that someone would like barge into the system using some exploit in the httpd
Storkme
excelblue, as long as you have a decent httpd...
joeyjones
with php it's hard to unencrypt something securely
Storkme
like lighttpd or apache
Xyphoid
yeah, i encrypted my novel with a hash algorithm, now it's totally safe
Storkme
Xyphoid, :P
excelblue
should I just use .htaccess and some stuff to cover the posts up?
winmutt
excelblue: dont use mysql's aes if you want your data to be secure
Stormchaser
excelblue: aren't the posts publicly viewable?
excelblue
I plan to leave mysql out of this completely
Storkme
excelblue, just make it so that the posts aren't publicly viewable...
excelblue
Stormchaser: only some are to be publicly viewable
winmutt
there is a sploit in mysql_aes_encrypt
excelblue
but the private forums better function fast too
Storkme
excelblue, you're overreacting.
excelblue
I just need as much security as plain password-based mysql encryption would do
winmutt
?
« 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 33 next »