« first day (813 days earlier)      last day (4138 days later) » 

10:00 PM
nope, it wont, unless the pattern fore regexp has been changed
 
Downvote it too, so it's easier to delete
Bring that monster down!
 
@tereško I think it will be, I think it only matters that the post contains a cv-pls tag somewhere and a question URL, not 100% certain though
 
@MadaraUchiha protected by Community♦ Oct 21 '11 at 14:04
 
any ideas where im wrong?
 
@hakre So?
 
10:01 PM
@LilzVotcaLove i suspect E_PEBKAC
 
@MadaraUchiha Keep your hand off ;) It's protected.
 
@hakre fu Community♦
 
@tereško what's that?
 
@LilzVotcaLove , don't use mysql_* functions in new code. They are no longer maintained and are officially deprecated. See the red box? Learn about prepared statements instead, and use PDO or MySQLi - this article will help you decide which. If you choose PDO, here is a good tutorial.
 
@tereško What's the E?
 
10:02 PM
But joke aside, I'd say it's of historic reference. I would keep-it
 
@hakre At the very least it should be closed.
And the rest should be closed as duplicates of it
 
@MadaraUchiha prefix for php's error level constants
 
@tereško alright ill check it out
 
@tereško Not that E, the second one :)
 
10:03 PM
@MadaraUchiha "exists"
 
Why do I get "Undefined index: pswd" for a null POST request? (pswd is the name of the variable and the field)
 
@tereško Ah, good
 
@hakre It's amazing he's planning to use curl to upload files :)
 
@lawm it means that value for that index has not been defined .. it's written in the error message ,in plain english
 
@tereško Is there a way to prevent the error because it's quite annoying : /
 
10:05 PM
write better code
 
lol
 
26
Q: PHP: "Notice: Undefined variable" and "Notice: Undefined index"

PekkaI am running a PHP script, and keep getting errors like: Undefined variable: user_location in C:\wamp\www\mypath\index.php on line 12 Line 12 looks like this: $greeting = "Hello, ".$user_name." from ".$user_location; What do they mean? Why do they appear all of a sudden? I used to use this...

 
@lawm You should validate that values exist before you attempt to use them with isset() and/or empty() (note also that if ($_POST['pswd'] == 'someval') counts and using it)
 
@tereško how do i do all my queries use the old sql will i have to rewrite all the queries with either one of those api
 
@DaveRandom 31.10.2013 first day of next month, works great, thanks mate!
 
10:07 PM
@hakre you are trying to generate random time .... how do you think random a problem on leap seconds might affect the output ?
 
@LilzVotcaLove read the tutorial that was linked
 
0
Q: Requesting assistance to clean a specific type of questions

Madara UchihaWhen you search for OOO000000, you find 12 results relating to a backdoor script in PHP. Questions about this specific backdoor still do come up every once and a while, and we always close them as Too Localized. Since these questions do seem to repeat themselves, Too Localized seems to have lost...

 
@DaveRandom So "if ($_POST['pswd'] !== null){}"?
 
@tereško ok
 
@lawm isset() or array_key_exists()
 
10:09 PM
@lawm No you do if (isset($_POST['pswd'])){} instead
@webarto Winner :-)
 
@DaveRandom Thanks!
 
DateTime is one of the most useful classes IRL :)
 
(N.B.: Not Strictly PHP) Evening, I'm putting something together with a markdown parser. Markdown doesn't support custom image dimensions, it just translates to a full size image in html. Could I use CSS to limit the maximum image width to, say, 500px?
 
@Baba Well, if the period between two days contains leap seconds, there is a chance he random time would be at that leap second. If you go for unix timestamp, than this chance does not exists. So you are not taken into account the whole period. You drop potential results, this means you are only satisfying a subset of the superset the OP asks for.
 
Has anybody else heard of NeptunIDE?
 
10:11 PM
@webarto That and DOMDocument and DOMXPath and Iterator and and and :)
 
Sure one could argue that it does not happen often, but well, let's be strict here, right? ;)
 
@PeeHaa That is the beauty of PHP, it just works :)
 
emm .. on a completely unrelated topic .. i seem to be at 2nd position for architecture tag
that's somewhat sad
 
@tereško What seems odd to me is that even though I've retagged your favorite question to OOP, the count on your profile hadn't changed.
 
it will get update within 24 hours (most likely at midnight in GMT+0)
 
10:15 PM
31.10.2013 first day of second month this is amazing... :D
 
@PeeHaa, oh f*ck!
 
Is there anyway to skip multiple element in a foreach loop
 
@Baba Set a counter and decrease it on each iteration while skipping elements?
 
How can I carry over variables through blocks of code in the page (for example <?php $foo = "bar";?> <h1><?php echo $foo;?>
 
10:26 PM
	$range = range("A", "Z");

	foreach ( $range as $v ) {
		// Output A

		if ($v == "B") {
			// skip till "W"
		}

		// output X Y Z
	}
 
@lawm, You don't need to do anything especial about it
 
@MadaraUchiha thats is a typical example of what am saying
 
@Alexander Then why for some reason I get an undefined variable error?
<?php if ($pswdtrue===True){echo 'style="display:none"';}?>
 
@tereško, was that intended to me?
 
10:28 PM
@MadaraUchiha I know it can be done with implementing SeekableIterator
 
@MadaraUchiha that's somewhat disappointing
 
@lawm How may I know? You need to clarify the context and see if anyone wants to answer
 
Here's the whole thing: "<div id="pswdfield" <?php if ($pswdtrue===True){echo 'style="display:none"';}?>>"
The syntax highlighting was weird so I might have forgotten something?
 
@Baba Here
function iterate_while_skipping_from_to($array, $offset, $count) {
    $result = array();
    foreach ($array as $item) {
        if ($offset-- < 0) {
            if ($count-- > 0) {
                continue;
            }
        }
        $result[] = $item;
    }
    return $result;
}

var_dump(iterate_while_skipping_from_to(range('a','z'), 2, 20));
 
10:33 PM
Oh I figured it out nevermind
 
@MadaraUchiha cool .. nice one
 
@PeeHaa lol some of them are awesome. Although I would also like my 10 mins back please :-P
 
@DaveRandom No refunds!
 
10:36 PM
@MadaraUchiha Thanks obviously to cheap way out without loop through all the values
 
@Baba Without looping through all of them?
How do you define which elements do you want to skip?
 
@MadaraUchiha hold on let me show you a typical example
 
How can I make the style attribute recognized as an attribute? "<div id="pswdfield" <?php function hide(){ echo 'style="display:none"'; } ?>>"
 
user1125394
wut?
 
10:42 PM
@cyril So the above code right now echoes "style="display:none"" on the screen, I want it interpreted as an actual html attribute
 
It's wrapped in a function and you didn't call it
 
@Alexander I did call it, and when I did, it echoed as a string on the screen not as part of the div's atributes.
 
Drop the function definition and echo'd. Or, move the function and call it. As it is right now, it's just awful
 
@Alexander ? Here's an example: gist.github.com/4470816
 
user1125394
function hide()
 
10:46 PM
If that's your definition of calling it
 
@Alexander I need it as a function though...
 
@lawm Defining a function only creates a function in the global namespace. It has nothing to do with the place where you insert the html
If you would have called that function from there that's a whole other story
 
I want it to add that stuff when I call a function. Would it come out better if I used a boolean?
 
you are NOT calling the function!
 
@Alexander What do you mean it's on line 1! gist.github.com/4470816
 
@MadaraUchiha see
	$iterator = new ArrayIterator(range("A", "Z"));
	$t = $iterator->count();
	foreach ( $iterator as $v ) {
		print($iterator->current());
		if ($v == "B") {
			$iterator->seek(22);
		}
	}
 
@lawm, you are calling it in the right place ._.
 
@Alexander Oh I get it!!!!
 
@Baba Okay, so what's wrong with it?
 
@MadaraUchiha only works with array but trying to use it with Traversable interface
 
10:52 PM
@Alexander No I don't get it that defeats the entire purpose of what I was trying to achieve. -____-
 
I want the function to call not when the page loads, but whenever I want.
 
Eh?
 
`echo $validUntil->format('d.m.Y') . ' first day of ' . $period + 1 . ' month';`
not what I expected...
 
@Alexander I want to insert that style attribute once someone presses a button or something.
 
10:53 PM
Am I only one, who looks at user's SO profile, before I start arguing with them?!
 
@tereško, nope
 
@tereško You have to get to know your opponent first :P
 
.. well .. sometimes i get a feeling that i am
 
@MadaraUchiha IteratorIterator($period) it would have been nice to seek to random position
 
I'm just kinda having problem displaying single data which is stored in a database .. Am I in a right place?
 
10:54 PM
Aaaaaand he's gone!
Tiny avatar away!
@Baba I'm guessing IteratorIterator doesn't have a seek method?
 
@lawm, you have the wrong idea of what you can do at PHP level
 
@MadaraUchiha exactly
 
@lawm, client-side v server-side
 
@Alexander Okay I get it I just thought it was possible w/ PHP
 
11
Q: What are the difference between server-side and client-side programming?

Madara Uchiha I've seen questions (mainly on Stack Overflow), which lack this basic knowledge. The point of this question is to provide good information for those seeking it, and those referencing to it. In the context of web programming, what are the differences between Server-side programming and Cl...

Here you go :)
 
10:59 PM
@MadaraUchiha, lol. Nice, by the way.
 
BrainDrain: Is there an algorithm, to pick a random value from a set whichs size is not known upfront?
 
@hakre Sure
 
Right now I first iterate a full set to get the count and then I get the random number and then I iterate again up to that random number.
 
function random_from_set($set) { return $set[4]; /* Chosen by fair dice roll */ }
 
lol
 
@MadaraUchiha as if you have never written public function isValid() { return true; }
 
@tereško Only in tests, but I should do that with false to troll someone sometime :D
 
I feel one of my answers was shamelessly stolen. Gracefully, they put a "... expanding on Alexander's answer..." >.<
 
just comment it with:
> please do not confuse "expanding" and "maiming". If you think that i need to elaborate, then I would prefer to do the "expanding" myself
That should solve your .. thing
 
@tereško miming?
 
11:09 PM
@MadaraUchiha maiming , verb - Wound or injure (someone) so that part of the body is permanently damaged.
 
@tereško I will rephrase it a bit. But, yes, I need to comment on it
 
@Alexander also, you can end with a link to imgur.com/r/funny/oW03n
 
@tereško, then he'd flag me xD
 
.. you clearly have never read my comments
 
tereško, Riga, Latvia
18.3k 8 22 53
 
11:15 PM
which reminds me that i need to spend the close-votes
 
It seems you frequent (of course). So, I believe I haven't
@tereško I never spent them all
Right now I have 40 cv remaining
 
most of regulars in this chat room try spend them .. with is kinda why we have the backlog
we recognize that is a mess , and we are trying to "do something about it"
 
> we recognize that php is a mess
pun-intended?
 
6
A: Please synonymize the now-empty [php5] tag with [php]

Tim PostI did one last merge as a few more crept in since you posted, but this is now completed. php5 is now synonymous with php. This is another example of how the PHP community does a fantastic job of curating the tag, thank you all for your efforts.

=P
 
11:24 PM
@tereško congrats room
 
1 message moved to JavaScript
 
@PeeHaa thx man
 
I suspected you entered the wrong room my mistake so I acted
 
id Name Age
------------------------
1 Mark 24
------------------------
2 Lili 36
------------------------
3 Zola 19
-----------------------
4 Ted 54

guys...I have a row called User and I have data like above in a database and I'm trying to display only Lili 36....I asked on the main page +Googled but I couldn't get it work...I can display the whole data in the User row but I want only to display single data. Does anyone know how to display the 2nd user info?
 
@PeeHaa an avatar-size-challenged user is spamming .. oh the surprise ... in other news, scientists suspect that sun will rise tomorrow
 
11:29 PM
for some of us is actually today
 
i had the impression that everyone has "tomorrow" available
do i need to start to panic .. or something
 
some of us live in the future (?)
 
no .. not in the way you think
 
:p
 
the is some time dilation due to the drag on space-time caused by combination of earth gravity and movement, but nothing that you can subjectively perceive as "living in future"
 
11:34 PM
in JavaScript, 26 mins ago, by ThiefMaster
Gibberish.
^ epic
 
wow finally hitting cap ;)
 
I'm not sure if it's the stupid that makes my head hurt or this horrible horrible cold.
 
@hakre Just in time :)\
 
Are there any serious jQuery examples? — hakre 9 secs ago
@PeeHaa yes, that was close. I already started to get depressed.
 
11:51 PM
I still have a few delvs left if anyone has an appropriate target.
 
$.serious();
 
$.why($('so').serious()) ?
 
it's the joker, run!
 
or even better $('why').so(serious)
 
@Baba you still here?
 
11:56 PM
Yeah, but it's a question, so shouldn't it be $('#you').why(new Serious('so')) or something?
Man, why do I really want to break out a sentence diagram? DAMN YOU MRS CULLIGAN!
 
@hakre yes ..... hacking your script
 
@Charles yeah, prob
 
@hakre won't sleep until i find a solution
 
@Baba What if I have the list, An I decide first between each two on random which of both to keep (let's assume there is an even count of items in the list)
So when I decide between each two, I have already reduced the list by half.
What if I do the same then on each pairing of the twos?
and again and again - like building little pyramids.
 
@hakre don't you think that would be expensive too ???
 
11:59 PM
wouldn't this distribute random over the whole list allowing me to pick the random element at the very end by deciding between two finally?
@Baba why expensive? Because of running the random function often?
 
@Baba: didn't @PeeHaa ping me about you earlier?
 

« first day (813 days earlier)      last day (4138 days later) »