im reading sources y and l of implementation of parse_ini_file and there seem to be no escape character implemented
basically its a remote file downloader for a specific site
Al
parse_ini_file()
?
he's not using ini files, dexen - he wants to search through HTML
yeah
ah
although that does look like a cool function to use somewhere else though…hmmm
Wtf is an Undefined offset?
Undefined offset: 2 in /home/phpbot/godbot/phpbot.php(46) : eval()'d code on line 7
ewwww eval
AlexC_, I use eval to parse the while loop on my bot.
Means I can change the entire script without closing the program.
And my perfect uptime is ruined! Noo!
0, 1 user, load average: 0.10, 0.03,
Before it was:
eval() should be renamed to evil()
4, 1 user, load average: 0.00, 0.00,
AlexC_, why?
!tell Maxdamantus about eval
AlexC_ is it complicated?
Damn noob bot, using PMs.
!tell sesstreets about eval
was on the phone, hold on
If eval() is the answer, you're almost certainly asking the wrong question. — Rasmus Lerdorf, BDFL of PHP
What should I use then?
no rush dude, its 625, i shouldn't even be awake
I'm not sure what you're wanting, Maxdamantus - all I know is eval is evil
I'm not sure what you're wanting, Maxdamantus - all I know is eval is evil
Not for my uses.
Sesstreets, evaluates code at runtime.
eval is always evil
AlexC_, you're just uptight.
besides the evil part
What if I want to inject code?
Or store the whole loop actions in a variable, for easy use of changing.
for loop + ifs?
preg_replace( '/(file=")(.*?)(\'/', $string $matches ); I _think_ - I only know a small amount of reg-ex
foreach($raw_n as &$raw){
eval($core);
}
nasty
wow…
thats…
how do i use this with the variable $content?
I take it you didn't read the docs that I linked you to …
woops
preg_match() that is suppose to be
Heh. Should get my PHP BNC working tomorrow.
i think I need to be talking in here, this is what im trying to do http://tiffanybbrown.com/2003/12/22/creating_clean_uris_with_php
and also missing a , after $string
With minimal functionality.
PHP BNC?
Yes sir.
what is BNC?
It's an IRC server, which you connect to, which connects to an proper IRC server.
cool
So you keep your connection, while you're disconnected.
would I be correct in thinking that this; //$entry=explode("/article111.php/", $_SERVER['REQUEST_URI']); - goes into the code on my article111 page?
Based on this class I made, which looks like dog.. crap: http://paste.maxdamantus.uni.cc/29
Works though. :d
yes, rick111
AlexC_, Im seriously reading the doc, but I still don't ge tit
get it*
what don't you get?
Array ) - that's wrong, correct?
'Night
night
I see sorta how it works
but where to i put the variable im searching in?
Also, how efficient is socket_select
Would it lag a bit if it was watching for an array of 1000 something sockets?
I'll give you a hint - look under the Parameters heading
Doubt I'll use my class for 1000 sockets, but just wondering if anyone's tried.
Only making it for my BNC, which will run on my seperate box, for private use.
Only making it for my BNC, which will run on my seperate box, for private host use.
this is what I have so far on article111.php http://rafb.net/p/MrjNXk12.html
you had it ass $string
has*
and?
does that make you incapable of reading the docs?
i just read them
thanks
all that regex scared me
line 4 in my code should give me something, right?
rick111, …
You're trying to explode an array.
hi all!
hey
not a good idea eh, it says so on here tho http://tiffanybbrown.com/2003/12/22/creating_clean_uris_with_php
rick111, you can't explode an array.
Explode takes a string, and returns an array.
ok, is there an obvious next step?
should line 3 of my code not give me a result then?
ok alex
one more thing before i go to sleep i think
not exploding it there, just trying a little echo
"echo "a href=" $content "/a;" this is so wrong isn't it?
yes
really badly huh?
pretty much
v_v
no need for the quotes around the echo, and also use single quotes for the start and end of the echo
there aren't quotes around the echo
i just did that to highlight what it said
I see,
echo "a href=" $content "/a;
thats it
any developers here, intrested in designing a new project?
use sinqle quotes around the echo instead of double - then do href="'.$content.'" … ;
I don't mean around around, I mean echo ' ….. ';
right ok, what's the export command, or any command so I can see all the 'strings?' stored in $entry?
var_dump()?
eth01 yes, always
ohhhh nice
also \print_r(), rick111
AlexC_ echo ' a href="'.$content.'"Link/a; ?
you're missing a single quoet
s/qouet/quote
at the end?
ok well
It ran the script
barely
i'm very very confused! i'm using php v 5.2.1, apache 2.2.3 on Ubuntu Edgy. now i'm using cakephp framework and trying to validate form data: $upload_error = isset($this-params['form']['Filedata']['error']) ? $this-params['form']['Filedata']['error'] :
null; WHY if $this-params['form']['Filedata'] is a STRING, $this-params['form']['Filedata']['error'] is a string too!? it's not an array when i dump it!
it either does or it doesn't, Sesstreets
and somehow, it managed to display the entire website
AlexC_ then it failed miserably
ok brand new code, hot off the press http://rafb.net/p/V2zdKj55.html - how come id_art is NULL? spooky no?
$entry[1] does not exist,
http://thingswecanchange.com/youlicenseripper.php
top of your code add error_reporting( E_ALL ); ini_set( 'display_errors', 'on' ); and you'll see
whatcha think alex?
Looks hilarous
pastebin the code, Sesstreets
thanks AlexC_ interesting
any ideas?
i'm reading sources (.y and .l) of implementation of parse_ini_file() and there seem to be no escape character implemented, is it possible, or am i just overlookin' somthing?
I'm not sure then dexen, was just a guess really - maybe you can't escape them then
whoops
PEBKAC
Sesstreets tripped on wifi wireless wire
dude totally
i have such a hard time seeing that stupid thing
im sucha cluts…
AlexC_ is it the regex thats the problem? or what…
pastebin the code, Sesstreets
i didn't?
oh, didn't see the link ^^
to (\')
also, echo ' a href="'.$content.'"Link/a'; wtf?
that will insert the contents of that website into href of the A element
yeah
i just fixed that
wait
oh shit
no wonder it wasn't working
….
now its linking me to a thing called array…
WHY!
http://pastebin.ca/642872 returns a href="Array"Link/a
AlexC_, what is up with that
preg_match returns an array - not an array element. you should use foreach
see: http://pastebin.ca/642877
that displays nothing…
the array is empty…
than is the array empty?
i dont know why it is… it shouldn't be.
http://pastebin.parentnode.org/19953. Its an class that resizes and generates thumbnails of images and outputs the new image to a file. The resizing function works great, but generateThumb is strange. It works, but there is big black edges in
the picture.
put " print_r($matches); " after preg_match
i tried that
If you could locate the problem ? never used the image functions before
and? empty?
prints out Array ( )
you see, the array's empty
i do see that
$content is not empty?
nope
trust me
it has the entire webpage
then the regex is wrong
v_v
any masters of regex up this early?
#regex ?
ohhh im starting to get somehwere over here
im scared to go in there
…
'/(file(.*?)(\')/' : there is no " after File=*
that's what he said he wanted
…
still empty
wait…
explain exactly what you want to match, Sesstreets
"
do you want match "File=http://s3.amazonaws.com/YouLicense/128305175769124926__.mp3'"?
starting from the h of http
now we know
Any help with this code? http://pastebin.parentnode.org/19953. class for manipulating pictures . generateThumb puts biiig black edges on the picture.
'/(File(.*?)(\')/' Sesstreets
..
h/o
h/o ?
"hold on"
right…
it was the freaking capital F that caused this?
no, you told me the wrong thing to match
this http://pastebin.ca/642884
no, Sesstreets
…
var_dump( $matches ); and have a look
god i need to take courses in college for php
it displays nothing doesn't it?
displays an array here,
pah who needs any college degrees
I have 0 for php or any programming
what the f**K
ok…
actually, Sesstreets change the regex to
'/File=(.*?)\'/'
ok now it really doesn't work
http://thingswecanchange.com/youlicenseripper.php
works here
how did you print it?
echo $matches[1];
do you have a for loop in yours?
nope
F**CKING YES
language, Sesstreets
damning yes
"pretend your 8yo niece is here" she would be sleeping at the moment
here it is 1 in the middle of the day
3
im in ny
wow
Its amazing how the world is so small, yet so big at the same time.
Here we are on irc talking to each other as if we were in the same room, but I'm at least 1000 miles away from finpingvin and AlexC_ is about the same in the other direction.
cool
^^ magic
basically
I'm not done with this script at all
AlexC_ interested in helping me with my annoying problem ? =p going nuts for so small code
but at least the base is done.
what is it, finpingvin?
finpingvin, ask your question.
I gotta figure out how to do forms now..
http://pastebin.parentnode.org/19953. Its an class that resizes and generates thumbnails of images and outputs the new image to a file. The resizing function works great, but generateThumb is strange. It works, but there is big black edges in
the picture.
got an example image, finpingvin?
ill make one, moment
pfft
google image searc
http://img.alibaba.com/photo/11383379/Ceramics_Random_Packing_Ring.jpg
random picture
$GLOBALS['var'] = "0"; Is that the equivalent to setting it to null?
no, "0" does not equal NULL
only NULL === NULL
but 0 equals
I have a wierd situation where a function that is supposed to always set a variable, sets it to null, or doesnt set it.
null
damn server is down any good uploading site ?
its just not identical
yes, 0 == null, but 0 !== null
Nevermind. How the hell did I miss that 8|
"0" is a string however
"0" == null to
you know a good page for uploading images? cant upload example since the server host is down
use unset Noparse
imageshack?
AlexC_ umm…
how do you get $_POST["songid"]; into a variable with text in it?
just like anything else, $foo = $bar;
http://www.Photo-Host.org/view/82104701110_treesnakeonbranch_1280×800_tmb.jpg
there it is
no, '0' != null
OK. Fixed that bug and found another.
$url = "http://….com/.mp3 $_POST["songid"]
"0" == null '0' != null
http://pastebin.parentnode.org/19953 code again
At least Rebuild 5 (current) is a damn site more stabler than any previous version.
how do you get the post into that variable
huh?
you want to append $_POST['songid'] to $url?
oh i see
yeah
no, AlexC_
with a "+"?
$url = "http://www…..com/{$_POST['songid']}.mp3";
oh ok
'0' != null && "0" != null, AlexC_
alex@alex-ubuntu:~$ php -r "if ( "0" == null ) { echo 'foo'; }"
foo
That code is extremely unsecure and you should consider sanitizing it first. Never trust user input.
theres nothing they can do with it
ive done that too AlexC_, i dont get the same result
what version?
i
get the opposite
weird O_o
5.2.3 i think
I would still recommend it. Even if you think they can't. If its a number, run a is_numerical on it first.
5.2.0 AlexC_
I'm on 5.2.1
or just (int) ?
when you compare int with string - PHP casts the string to int … so … var_dump(0 == "lalalala"); // returns true ?
…ill use my .2.3 version
Christ! Who ever thought making a Blackjack Dealer AI would be so hard?
GOD
its not working again
but (int) should cast the string to 0 if it is a string, right ?
var_dump(is_null(0)) //false ?
$content=file_get_contents($url);
is taht right?
yes
I'm using 5.2.1 as well: same result: [berry@freebsd~]$ php webhosting -r "var_dump ( 0 == null );" //result: bool(true)
yes/no?
thats why you actually do: var_dump(0 == 0) ?
and PHP returns true
Yes.
berry__
no
yes it's correct
wait
then what the hell
ThinkMedical, yes.
string 0, not int 0
oh..
v_v
i get "0", '0' != null
OMG
DUR DE DUR
nor should they
wanna help me out with the image script ? http://www.Photo-Host.org/view/82104701110_treesnakeonbranch_1280×800_tmb.jpg, example image
right, that's right, '0' != null. 0 == null however
berry__ I get "0" == null, but '0' != null now
0 == null, yes
0 == null - thats NOT true, I can't stress thats enough
yes it is
Ok then what if $GLOBALS['var'] = "0"; — Does 0 == "0" ?
0 !== null, but 0 == null.
headache.
hi all
Does 0 == "0" ?
ffs
can I do something like (condition==true?istruedothis:iffalsedothis)
is_null doesnt cast?
[dev]Viper: there is a big difference between == and ===
0 == null, yes
[dev]Viper: 0 == null, 0 !=== null
[dev]Viper: yes! 0 == null, but 0 !== null
Okay who wants to help me now?
if it did is_string would be true for ints [dev]Viper
Does 0 == "0"?
Noparse, yes, 0 == "0".
kk
…
[dev]Viper: is_null() checks type as well, so it's the same as ===
Then "0" != 0 ?
* !==
AlexC_, the host name of my site is getting prepended to the output in the a href
[dev]Viper: therefor, is_null( 0 ) and 0 === null will both return false
yes, but NULL is different then 0
[dev]Viper: it's a different _type_ yes, hence why 0 !== null but 0 == null
we're not talking about that [dev]Viper
we're talking about what it will cast to
only null === null
AlexC_, http://pastebin.ca/642897
hii evry one
AlexC_, that's what they would call legacy burden
can I do something like (condition==true?istruedothis:iffalsedothis)
no berry__?
deadeyez, yeah
thanks
( condition ) ? true : false;
yeah
null *should* === nul only berry__
look … in this expression: 0 == null , null is casted to int, so you actually get 0 == 0 and PHP returns true, but that doesnt mean that 0 is equal to NULL in PHP
deadeyez, http://www.tizag.com/phpT/if.php
yes it does, [dev]Viper… it doesnt mean it is *identically* equal to
[dev]Viper: 0 == null 0 !== null
ThinkMedical, that's what I'm saying. But the way I'd like it is for 0 != null too That's what I meant.
[dev]Viper: do you know the difference between == and === ?
0 is what null outputs
or…
Wow. I just converted a 1,150-line non-working bulky piece of crap into a 430-line OO Masterpiece
wait
yes I know that === check the variable type
my brain just exploded
then what is the problem?
then you'd have to have strong/static typing and explicit casting
PLEASE! You are all right. Just shut up.
I agree with Noparse, I'm letting go
http://pastebin.com/m4986225e
this is the file where i am reading the contents of the file
0 == null - you tell him that 0 is the same as NULL … and they are different things, thats why I went through this .. nvm
the contents of file is
name:penguin
place:blore
[dev]Viper: not going to go over it again,
ye, same here
AlexC_, http://pastebin.ca/642897 why the hell is it outputting my hostname before the link?
i need to read from the form and write it back into the file
what is in $_POST['songid'], Sesstreets?
a few numbers
can you confirm that?
like maybe 4231
well
i can make it say anything
but it'll only work if its 3 or 4 numbers
check what it is, Sesstreets
any one for me also
http://thingswecanchange.com/youlicenseripper.html put 1234 in the box
the link has my url to my set prepended
I don't care what I put in the box, I want you to check what is in $_POST['songid']
…
http://thingswecanchange.com/youlicenseripper.php
its right on the page
var_dump( $_POST['songid'] );
if i put 1234 in the box before then the link displays http://thingswecanchange.com/http%3a%2f%2fs3.amazonaws.com%2fYouLicense%2fnicolette_128267221986473295_Here_to_please_you.mp3
also … what box?
http://thingswecanchange.com/youlicenseripper.html
that one
its a form
$tekst .= "You can create " . ($maximumaantalploegen-$aantalp loegen) . " team" . ($maximumaantalploegen-$aantalploegen==1 ? $tekst.="s" : $tekst.="" . "";
OMFG. If my router deletes my virtual servers one more goddamn time I am going tear the bitch out by the ethernet cable and throw it out the goddamn window…
but it does not work
huh … it's getting converted like y htmlspecialchars()
sigh, all the "s
s/y/by
….
look at the html, Sesstreets
your scaring me AlexC_
why is it doing "http%3a%2f%2fs3" instead of http://?
I have no idea
thats even scarier
foutrelis, you got an idea?
hey foutrelis
$tekst .= 'You can create ' . ($maximumaantalploegen-$aantalploegen) . (($maximumaantalploegen-$aantalploegen)==1) ? 'teams' : 'team' . '';
hey AlexC_ ^^
how are you?
About what?
this stupid http%3a%2f%2fs3 thing
fine, I guess
great
and why my hostname url is getting prepended for no apparent reason…
^^
he's only just joined
oh
here i am thinking hes a php god
v_v
so alex if you don't know… who could possibly?
him over there
anyone know a good place to find a cheap dedicated host about $60-80
oo
i know
google, omarxsw?
Sesstreets, is your code pasted anywhere?
omwhere
$tekst .= 'You can create ' . ($maximumaantalploegen-$aantalploegen) . ((($maximumaantalploegen-$aantalploegen)==1) ? 'team' : 'teams'). '';
hold on
anyone can use google, but i would like a reference
http://pastebin.ca/642930
there berry__
#web maybe
omarxsw,
i would recommend
damn
i gotta find them again
ahh
http://www.mediatemple.net/
!tell Sesstreets about enter
thank you
I have add dude, I don't think full sentatnces
then don't press enter while you are 'thinking'
thats the spazz part of mne
coming out
put a space before team/s, ' team'
berry__, anyidea?
lol wtf
ring ring ring
?
thats the ultra op isn't ?
banana phooooooooooooooooooooooooneeeeee
no idea, never seen it before
LOL
Sesstreets, yup.
dup dubi dubi dub
TML MikeSeth -
hello operated man, may i please have srn?
Let me ask you guys a question. I am seriously considering a career in PHP. Is it worth it? Or should I learn something like Java or C*?
PHP FTW
berry__, what did you change?
urldecode, obviously
but why is it encoding it, berry__?
cause its gay like that
PHP's average salary is almost half that of something like Java.
and c++ people don't get payed that much either