logs archiveIRC Archive / Freenode / #php / 2006 / May / 29 / 1
Monkey_b
howecome I lose my session inside an iframe?
alta
romans5n1: how do I perform a backreference?
SubOne
can i use array_push to onto a multidimensional array?
alta
yes
SubOne
array_push($arr[0][0], $val)
like so?
romans5n1
like 2006-05-28T3:58:38-06:00 ... or other common ways of representing dates online... I'd love to have a ready made list of format strings ( such as "F d, Y" ) that I could just throw into the date function, instead of having to remember each time, ok do I need an m, n or M here?
alta
Monkey_b: page loaded before you set session vars in the other page? cookies disabled?
SubOne: correct
SubOne
what if the element is not an array
errr
setuid_w00t: what you have works for me to get the value.. (sorry about the request/get I havent used it much so I didnt know about it) http://michaelrice.org/tmp/test.phps
         

SubOne
like if its the first element i add
will it still work?
alta
$arr needs to be an array
SkareCrow
does anyone here know anything about cookies?
romans5n1
alta... inside something like ereg_replace() you could reference the first set of parenthesis as "\\1" in the replace with paremeter... with something like ereg() you can store the matches via the matches paremeter i.e. ereg("match me",$based_on_this_string,$store_matches_here);
alta
could you give me an example i.e. using the text I provided please?
nphase
Monkey_b: can you show me an example
alta
SkareCrow: I know enough. Ask your question and you'll find out what people know.
romans5n1
the preg functions have similar methods... just read the manual (php.net/ereg , php.net/ereg_replace, php.net/preg_match , php.net/preg_match_all, php.net/preg_replace )
SkareCrow
alta, i have asked the question
http://pastebin.com/743572 Why is it that these cookies aint being set to null when i request them. the only one that actually sets the value to null is the if ($_POST['userLogout'] != "") and that will log you out. but all the other ones will not work correctly...
if you look at lines 35 + 36 you will see im trying to set the values to null but it isnt doing anything... but.. if you look at line 50 that one works just fine...
romans5n1
preg_match("/how do I get (.*?) from this string/", "how do I get THIS from this string?", $matches); .... $matches[1] == 'THIS'
alta
thankyou very much :)
SkareCrow: are you sure the setcookie line is being executed?
SkareCrow
yes
i think..
its the same exact line as line 50
and i have stuck in a small echo
to see if it goes inside that small block
alta
the one that works changes the page location which is required for the values to update. Are you checking if the cookie has been set without a browser page reload first?
SkareCrow
hld on
i dont know why that would matter...
it is unsetting the cookie
that cookie shouldnt expire unless someoen tells it to
so redirecting it wont unset that cookie value
alta
the php script doesn't treat the cookie's value as changed until the next page request
SkareCrow
if i redirect that one it tells me that the server is incountering problems redirecting
in firefox
nphase
anyone know of a parser thatll translate xml into variables in php4?
SkareCrow
meaning the script is redirecting over and over
the script goes into a loop cause its not unsetting the value
setcookie("warpedUser", null, time() - 7200, "/", "", "0");
header("Location: scripts.php");
its not setting it to null
setcookie("warpedUser", null, time() - 7200, "/", "", "0");
echo $_COOKIE['warpedUser'];
this will echo out the value of warpedUser
whitch is what i set it to by hand
a9s8df <-- thats what it echoed out
warpedUser=a9s8df <-- thats my cookie
alta
that's because the value of $_COOKIE['warpedUser'] doesn't change until a page reload!
try setting FALSE or '' as the value
rather than null
SkareCrow
but alta...
grr
you dont understand
         

itrebal
?
SkareCrow
it isnt setting it i have reloaded the page after doing that
and the script keeps redirecting
over and over and over and over
nphase
no one?
SkareCrow
because the cookie's value hasnt changed
itrebal
dont use null
alta
maybe that's because you're using the value null
and why I said try FALSE or ''
SkareCrow
null works just fine for the bottom one...
nphase
itrebal: know of a parser thatll translate xml into variables in php4?
Sven_vB
moin
oh, hi
itrebal
nphase: no
sorry
nphase
hmm
i wonder if i can find an html tree parser
itrebal
DOM, maybe - with some work
SkareCrow
setcookie("warpedUser", "", time() - 7200, "/", "", "0");
header("Location: scripts.php");
still goes into the loop
keeps redriecting over and over cause the value hasnt changed
setcookie("warpedUser", null, time() - 7200, "/", "", "0");
header("Location: index.php");
but that one works fine
itrebal
your trying to *unset* the cookie there
nphase
itrebal: all i want is like <this><that>value</this></that> to be $xml['this']['that'] == "value";
itrebal
nphase: simpleXML?
nphase
itrebal: php4
itrebal
oh, i dunno
SkareCrow
itrebal. i know this
itrebal
alright
SkareCrow
i doesnt even execute this unless warpedUser is set
if (isset($_COOKIE['warpedUser'])) {
PseudoPlacebo
Hi, I'm (really) new to PHP. I want my script to only repeat a request a set number of times (5). But I'm not sure how to do it.
My source is here: http://truth.pastebin.com/743652
SkareCrow
it shouldnt even enter this block after i redirect it
itrebal
SkareCrow: whats your error reporting?
SkareCrow
there is no errors
alta
do you have error reporting on though?
itrebal
whats it set to
SkareCrow
look at my script itrebal
lol
itrebal
i didn't see the pastebin
alta
it's set in php.ini
SkareCrow
one works just fine the other one just the same doesnt work
itrebal
PseudoPlacebo: what do you want limited? the foreach?
SkareCrow
http://pastebin.com/743572
PseudoPlacebo
itrebal: Yeah, i guess.
I just only want it to do the thing five times.
But I'm not sure if it'll just do the same query five times.
Which would show up five of the same thing.
Ya know?
itrebal
PseudoPlacebo: theres an operator to increment a number by one, its ++ - so $count = 0; $count++; $count now == 1, using that and an if() block, how could you solve this?
SkareCrow
and yes alta error reporting is on
PseudoPlacebo
I know about that stuff, itrebal.
itrebal
PseudoPlacebo: then impliment it
PseudoPlacebo
But wouldn't it query the same thing five times?
Turning up the same photo five times?
itrebal
depends where you use it
PseudoPlacebo
=\
errr
PseudoPlacebo: for($i=0;$i<5;$i++) { do_function();}
MengZhuo
hi, i want to use one of the many MVC frameworks for PHP(5), but don't know which one to pick, can someone suggest one?
itrebal
AcidReign, alindeman, BigE, caffinated, Davey, enygma, EvilWalrus, HolyGoat,jmkg, Jymmm, MarkL, mattmcc, newbienetwork, philip, piera, Pollita, [RainMkr], snipe, Stormchaser, TML, Wolfpaws - if any of you are around (sorry who arn't for the highlight), SinnerG needs to be voiced
alta
SkareCrow: stick around, I'm trying the script on my server
SkareCrow
alright ima go smoke
just private message me so i dont have to scroll every wherel ookinga round
SinnerG2
pff
stupid Tor 'blocking' :p
well, I'm trying to create a contest 'system' but its not going that well.. any advice ? :p
Wolfpaws
SinnerG: Ther's a topic part for tor user for a reason...
alta
SkareCrow: works fine for me even with null. must be an include problem or with the mysql query
SkareCrow
alta.... im telling you this. it works fine. if you change the value yourself it wont unset it
line 50 works just the way it should work
SinnerG2
woflspaws..
I didnt get a voice...
SkareCrow
just not line 35
SinnerG2
I asked ok??
No-one is online :(
or active
Wolfpaws
SinnerG: ask an op who is around?
SinnerG2
I asked all?
Wolfpaws
I didn't get anything
SinnerG2
itrebal even asked for me on the chan
SkareCrow
line 35's block checks to see if you alterd the cookie. if your IP in your cookie doesnt equal the same as your real IP then it should usnet the value of the cookie
SinnerG2
<itrebal> AcidReign, alindeman, BigE, caffinated, Davey, enygma, EvilWalrus, HolyGoat,jmkg, Jymmm, MarkL, mattmcc, newbienetwork, philip, piera, Pollita, [RainMkr], snipe, Stormchaser, TML, Wolfpaws - if any of you are around (sorry who arn't for the highlight), SinnerG needs to be voiced
SkareCrow
the IP in the cookie is username:md5x2-ip:md5x2-password and its all base64'd
alta
I see that from the code
SinnerG2
so can my SinnerG get a +v ?
SkareCrow
did you try changing your cookie"
SinnerG2
so I can drop this connection
praseodym
shouldn't bin2hex be the same as dechex(bindec( ?
SkareCrow
change the cookie to warpedUser=asdf
« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 next »