@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 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



Comments:

<0> pianoboy3333: yeah, or write the code once (even though it's just a one-line if statement) and include() it at the beginning of each of the .php files.
<1> nano
<2> Pollita: black or white?
<1> black
<2> they're pretty :)
<3> b1n0ry: how is it a one line statement?
<4> i've read up on charsets but i'm still a little lost as to how they are handled by php/mysql/etc.
<1> Are there filename limitations (e.g. no spaces)?
<3> ok, I see
<2> i dont think so, give it a shot, and if doesnt work, try removing the spaces
<0> pianoboy3333: if(!isset($_SESSION['p***']) || $_SESSION['p***'] !== true) header('location: notfirefox.html');
<4> I've got an HTML page that has a META declaration for a Latin 1 charset... and when I submit data via POST, and print it back out, it looks fine. But when I change the charset of the meta tag to UTF-8, and I print out the resulting POSTed data, it looks like PHP is printing out 3 characters for the one special character I typed in... and I understand this is expected behavior b/c of the way PHP handles unicode...
<3> b1n0ry: can the checklogin.php only have a <?php?> tag? does it have to have html and body tags?
<1> It's because PHP (currently) *doesn't* handle unicode
<1> It just sees a binary sequence
<1> PHP6 fixes this



<1> In the mean time you can use iconv() to manually convert those to local code page data
<0> pianoboy3333: for compliancy purposes, any page that will be sending output to the browser (or occupy the browser's url field) should generate properly-formatted html.
<3> ok
<0> pianoboy3333: besides, you can't confirm for sure that your browser is going to redirect automatically, so you'd probably want to provide some sort of link.
<0> pianoboy3333: in all honesty, i'd probably make it something like notfirefox.php and post it right back to itself. let it do its own form processing.
<3> hmm...
<3> Not a bad idea
<4> Pollita: Well, long story short: I inserted a bunch of this data (unicode) into mysql, and now i have a ton of this data stored. Are you saying that I could just convert it back to Latin 1 when I pull it out of mysql?
<0> just do something like if(isset($_POST['p***word'])) { if($_POST['p***word'] == 'correctp***word') { $_SESSION['p***'] = true; header('location: somepage.php'); } }
<0> or you could do that all like if(isset($_POST['p***word']) && $_POST['p***word'] == 'correctp***wd') { $_SESSION.... etc.
<2> Pollita: do you have a windows computer?
<0> !tell b1n0ry about poop
<5> arrrgh!! i wish it would "just work"(TM) ... now it turns out that serialize() gets called _after_ __destruct() when an object implements Serializable :-(
<0> alright, gonna give the baby more food. brb, maybe
<6> jeebus...
<7> can someone tell me why this !((bool)$***igncl*** xor (bool)$***ignname) doesn't work but !((bool)$***igncl*** == (bool)$***ignname) does?
<7> when i say it doesn't work, i mean the boolean value returned is wrong
<7> argh
<7> forget it
<7> i see what
<8> which function should i use to store all file names in a specified directory in an array
<7> scandir?
<7> or dir?
<7> either one wil work
<9> majikman ---> http://us2.php.net/manual/en/ref.dir.php
<9> you'll need to open the directory, read it's contents into an array and ....
<7> eh?
<7> and???
<7> tell yawg, he'es the one asking
<9> the and... depends on what you wanted to do, heh..
<9> everything you need is on that manual page, look up the different functions, check out the user comments etc..
<7> cyphor: i'm not the one asking.... yawg is. i was responding to his question
<9> I realized that a second ago =)
<10> is there a way to make php create a directory, if it doesn't exist, given that the containing directory has appropriate permissions?
<7> haha, ok
<11> mkdir
<9> hehe
<10> thanks
<5> chmod
<7> but if someone can help me out with xor... its confusing the crap outa me.....
<7> so i have two strings, i want to xor them to see if they're set cuz only one should be. i set both of them but xor returns false
<3> No, wait, what was that function? strof?
<3> It sees if a certain text is in a string?
<7> dude... go to php.net and look
<7> actually, sorry, i only set one string
<9> why not just do something like if (($thisbool) && (!$thisbool)) etc...
<0> heh, gates is beating warren buffet for the richest man by *only* 8 billion USD.
<9> lol
<7> cyphor: because i'm stubborn and i want xor to work
<9> heh, k
<7> i've never got a chance to use the xor operator before
<7> so this is my first chance... i'm not p***ing it up
<7> i want to devirginize my xorness
<0> majikman: ok, here's the deal. i'll bet you're doing something like if($str1 xor $str2) aren't you?
<0> majikman: the problem is neither $str1 nor $str2 are boolean values, so how can you do boolean logic on them?
<3> strpos!
<3> got it...
<0> majikman: you need to turn them into boolean values. so... how about: if( (strlen($str1) > 0) xor (strlen($str2) > 0) ) { }



<12> alright, so is there anyway using file_get_contents to get the contents of a page that is blocked with a cookie?
<12> like get my server to set the cookie, then get that page?
<12> im trying to parse some data out of my account page, but it cant be accessed without a cookie
<0> majikman: because (strlen($str1) > 0) -does- evaluate to a boolean value
<3> b1n0ry: wait, would I use: strpos($_HTTP_USER_AGENT, 'Firefox') < 0 to see if they were not using ff?
<7> b1n0ry: read this
<7> http://us3.php.net/manual/en/language.types.boolean.php
<7> you can do boolean operations on strings
<0> pianoboy3333: how about if(!stristr($_SERVER['USER_AGENT'],'firefox')) { header('Location: notfirefox.html'); }
<0> of course, remember that people can make their user agents lie
<3> meh...
<3> How?
<3> Just out of curiousity?
<0> with IE it's just a registry setting. firefox i think it's pretty easy just in a setting.
<0> pianoboy3333: http://johnbokma.com/mexit/2004/04/24/changinguseragent.html
<3> kk
<13> how do I chop off the \n from the input of fgets()?
<0> Psi-Jack: str_replace("\n", '', $var);
<13> Hmm.. Dang, nothing like perl's simple little chomp? :)
<0> that will remove any instance of \n in $var
<0> Psi-Jack: one of the comment entries in http://us3.php.net/manual/en/function.chop.php is a nice little function that emulate's perl's chomp()
<14> how long will I have to do a usleep() for it to be a second?
<14> 1000?
<15> Jymmm:
<14> or 10,000
<0> Shadow_mil: for full seconds, just use sleep()
<14> Well, I need to do a half a second and just thought it be easyer to ask what a whole second was.
<0> Shadow_mil: 1 microsecond = 1/1000000 second. therefore 1 second = 1000000 microseconds
<0> so neither 1,000 nor 10,000 but 1,000,000
<14> wow... thats a small unit of time...
<14> thanks
<0> one millionth of a second
<0> np
<16> ./topic ##php <14> wow... thats a small unit
<7> i remember reading somewhere that most implementations don't even use a true microsecond anymore
<0> wouldn't surprise me. how would you know?
<7> i thought i read something like that somewhere
<0> esp. if it's averaged.
<7> well.... kernel wise, that is
<0> no i mean how would anyone know if a system was exact to a millionth of a second?
<7> most linux kernel's only support 10,000th or 100,000th of a second or something like that
<7> oh.... lol
<7> yea, i suppose
<0> if it's averaged. if it's not averaged, it really wouldn't be hard to find out.
<13> b1n0ry: Poifect :)
<7> well.... i can tell if its off by 2 millionth's of a second... but not one
<0> start an infinite loop where you output the current unix timestamp every 1,000,000 microseconds. let it run for several weeks. then search it for any duplicate entries. there should be none.
<17> is there any way to export a dynamic site made with smarty, to a group of static pages? I want to have an admin option to export the site to a static group of pages for use on a cd
<0> if there is even one duplicate entry, clock cycles are off by some far insignificant amount
<18> is there a way to do a timeout(), i-e non blocking sleep() ?
<0> marccd: set_time_limit() or max_execution_time()
<3> b1n0ry: <?php session_start(); if(!isset($_SESSION['p***']) || $_SESSION['p***'] !== true || !stristr($_SERVER['USER_AGENT'],'firefox') || stristr($_SERVER['USER_AGENT'],'epiphany')) header('location: notfirefox.html');?>
<0> actually max_execution_time isn't a function, it's an init directive
<3> b1n0ry: something is wrong...
<18> b1n0ry: thats something else, I was thinking something more in the line of glib's g_timeout_add().. Does php support threading?
<0> pianoboy3333: there's a logic problem, let me think here
<3> b1n0ry: it says the headers are already sent...
<0> pianoboy3333: do you have anything before your <?php session_start()... because you can't send anything to the client before you session_start
<3> oh
<0> and i think there's still a logic problem there
<3> so put the php tag at the VERY top of the doc?
<0> yes
<3> oh
<3> that's the prob
<0> you can't send headers if you've already sent content
<0> session_start() sends headers and so does header()
<0> heh, i think i'll let you figure out the logic. i do think there's an issue, but try it and see.
<19> could someone explain me what 'global' is?
<20> Fushuing: in what context?
<0> Fushuing: global is a directive that is used to increase the scope of variables to allow them to be used by functions, typically
<19> as in functions
<20> Fushuing: do you have an example?
<0> Fushuing: in a function, using global would allow that function to access a variable defined outside of the function.
<19> global $vboptions, $bbuserinfo;


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #php
or
Go to some related logs:

xorg-x11 accelmethod radeon
link:http://freelance-job.blogspot.com/
drivecrypt mybook
#kde
ubuntu wifi manager xfce
select into outfile error 28000
#suse
#perl
centos postmap
tvtime requires hardware YUY2 overlay support from your video card *** driver.



Home  |  disclaimer  |  contact  |  submit quotes