« first day (964 days earlier)      last day (4209 days later) » 

Anonymous
19:07
Why do we use array() when executing PDO commands? even when the parameter is just one single value? In other words, why is execute($value) not a valid statement?
@phpNoOBఠ_ఠ To keep the API consistent I would imagine
@phpNoOBఠ_ఠ the two brackets...
Anonymous
consistent by overriding logic? weird
user1596138
@phpNoOBఠ_ఠ Ah alright.
user1596138
@bwoebi Ah, ok.
19:10
@phpNoOBఠ_ఠ How is it overriding logic? You always pass an array of parameters as the first argument of the method. Regardless of how many parameters that is
Anonymous
Well, the question is then why should the " first argument of the method be an array" even when the argument is a single value. @cspray
@phpNoOBఠ_ఠ I just told you. For consistency when using the method
You're just passing a collection of input parameters. Nobody ever said that a collection must have more than 1 element in it
Anonymous
Can you give me a link to where it says, "for consistency" ?
And also to support named parameters
@phpNoOBఠ_ఠ You're gonna have a hard time finding decisions for their design choices without going through the internals mailing list
@phpNoOBఠ_ఠ pro tip: install overlook whiz on your phone
19:16
I'm telling you why I would use an array for a parameter even if you may only pass 1 element in the array
stackoverflow.com/questions/16970312/… E_RECOVERABLE with message: "title: tl;dr"
gratz!
Hey all, whats the difference between Binary Search Tree and Randomized Binary Search Tree?
In computer science and probability theory, a random binary tree refers to a binary tree selected at random from some probability distribution on binary trees. Two different distributions are commonly used: binary trees formed by inserting nodes one at a time according to a random permutation, and binary trees chosen from a uniform discrete distribution in which all distinct trees are equally likely. It is also possible to form other distributions, for instance by repeated splitting. Adding and removing nodes directly in a random binary tree will in general disrupt its random structure, bu...
I'm calling session_create and I am also setting the session doing:
    $_SESSION['user']['username'] = $_POST['username'];
    $_SESSION['user']['id'] = getID($db, $_POST['email']);
    $_SESSION['user']['email'] = $_POST['email'];
but my session still doesn't persist when I change page. any obvious reasons?
19:48
@JamieH Please don't make up code
@PeeHaa埽 Huh?
session_start() I should say
Are you starting the session when you try to access the variables?
I guess I am.
That's a problem I take it
What? The fact that you are guessing? Yeah that often doesn't end well :)
Fixed. Bit of a hack but
19:54
Define hack? What did you do?
$username = $_POST['username'];
$id = getID($db, $_POST['email']);
$email = $_POST['email'];

$_SESSION['user']['username'] = $username;
$_SESSION['user']['id'] = $id;
$_SESSION['user']['email'] = $email;
Why?
That's effectively the same code
Evening ladies
Evening Chris
Sup Pieter
Anonymous
19:57
Man Jehovahs witness just ate 30 minutes of life.
Anonymous
thank @PeeHaa埽
Anonymous
I will check out the app
@phpNoOBఠ_ఠ yw
@PeeHaa埽 more lines of code :L
@DaveRandom Is it also finally getting hot on the other side of the pond?
19:58
@phpNoOBఠ_ఠ You need to invest in one of these
@PeeHaa埽 Yeh it's been really nice the last week or so
@JamieH What was the exact problem you are trying to fix, because I get the feeling your solution might not be optimal
Anonymous
@DaveRandom lol
@PeeHaa埽 Basically I am registering there user session and then redirecting with the previous method it wasn't persisting but not it is.
If this:
$username = $_POST['username'];
$id = getID($db, $_POST['email']);
$email = $_POST['email'];

$_SESSION['user']['username'] = $username;
$_SESSION['user']['id'] = $id;
$_SESSION['user']['email'] = $email;
is persisting, but this:
$_SESSION['user']['username'] = $_POST['username'];
$_SESSION['user']['id'] = getID($db, $_POST['email']);
$_SESSION['user']['email'] = $_POST['email'];
not there is something else wrong
More to the point, there is something in between you are not showing us
20:01
There actually isn't
while i was using django and python, i found that either i have to use mrkdown laguage or escape the html properly in the textarea, but in php we donot need to do that.. why ?
@DaveRandom How is the job hunting coming along btw?
@blackbee uhhhm yes you do
20:03
yay for sublime
@PeeHaa埽 Yeh alright, I've applied for a couple but I'm not that interested in them, but I figure I might as well get some interview experience. Actually someone emailed me of the back of my SO account with a job offer but it's a bit far away and would involve some (but apparently not much) Ruby
Still it doesn't make sense it didn't persist :P
but if i write
<ul><li>hello </li></ul>
in a textarea in php and then append the contents to a div then what i have typed in just that gets printed, no html formatting occurs
@DaveRandom lulz
I'm thinking cache
20:04
What do you mean? I was reading the session from PHPStorm + xDebug and the session was NOT there.
I unset the session when they load that form up
I would have said the same thing as Vectory, had I not seen the above comment. — php NoOB ఠ_ఠ 1 min ago
@blackbee Yeh it will, you would need to use innerHTML for it to be interpreted as HTML
LOL … who teaches people the wrong things?
Anonymous
@bwoebi no one teaches people wrong.
20:06
if (isset($_SESSION))
{
session_destroy();
}
@phpNoOBఠ_ఠ but? why did you think this?
Anonymous
Because, I never read about it. Not because, someone taught me the other way around.
user1596138
Anyone know why my JS functions would seem undefined to elements calling them with onload() which are included through php?
@Jhawinsss inspect the dom and find out
user1596138
@PeeHaa埽 I've been digging like crazy and can't find a reason. I can call the functions from console after the page has loaded.
20:09
@Jhawinsss do you have a live link?
    <script>
    function check() {
    	var p=document.getElementById('abc').value;
    	document.getElementById('content').innerHTML=p;
    }
    </script>
    <div id="content"> <form method="post" action=""><textarea id="abc"></textarea>
    <input type="button"value="submit" onClick=" check();"/></form> </div>
    	</div>
this is what i am using
i have tried inputs like
<ul><li>Hello</li></ul>
<a href="javascript:alert('xss')">hi</a>
user1596138
Nope.
user1596138
I wish.
Hello Everyone :)
I need help about sessions
can someone help me. i am totally messed from a week approx :/
o damn it happened when i used <hr>, how to escape the html??
20:11
@CodingNoob hola
@peehaa
@CodingNoob If you have a specific question somebody in here might be able to help you
@PeeHaa埽 hay dude :) here is the question link
Hi all.
20:12
3
Q: After Logout user can still access protected page

Coding NoobI added a session & used this code to prevent user from accessing a page after logout but i can't do so. User can still access the previous page.Here is the code login code is <form id="form1" name="form1" method="post" action="alogin.php" onsubmit="return(validate());"> <p align="center"><f...

can you guyz visit this and help me with this :(
Please don't spam
@PeeHaa埽 k
How are those users accessing the pages? Back button?
@PeeHaa埽 yes but it's not cache they can access even after ctrl+f5
Anonymous
@CodingNoob how many session_starts() do you have on your site?
20:14
@phpNoOBఠ_ఠ one on one page
I don't find out if you can also put (under which eventual conditions) flow content in html4 into an <a> tag? May someone help me googling, I'm too dumb to use the right keyword appearently...
@PeeHaa埽 yess, its happening.. how to escape with html but still allow formatting. i mean if i use htmlspecialchars then everything gets escaped
@blackbee htmlpurifier is the best I have seen to allow some tags
Anonymous
I think, just for debuggin purpose, create a simple file and keep your session there.
Anonymous
And just keep sharing that page
20:16
ow, i was searching the manual for htmlpurifier haha
@phpNoOBఠ_ఠ i tried that too but it did not changed anything
@bwoebi I'm sorry, but that answer is not worthy of a +1
@CodingNoob The code you have should just work. Please enable error reporting. exit; after redirects. And var_dump() the $_SESSION super global where you think it should be cleared
@PeeHaa埽 and in what more ways can an attack be performed, i am using prepared statement, so i may assume to be safe against SQL injections
20:18
@blackbee Do you also use bound params? Otherwise your prepares are pretty useless
@PeeHaa埽 hmmm let me try
yes i am using that...
@DaveRandom don't know, but it is hundred times better as before. I think I should also recompense an user when he tries to improve it's answer.
@blackbee There are numerous ways an application can be attacked
A good starting point would be owasp.org
You know, I think we'd all assume taking a shit is a FIFO operation; however upon inspection I appear to have performed a LIFO operation (barring of course, the possibility of toilet bowl acrobatics)
20:24
@Bracketworks I did never assume such thing :P
The most worrying part of that statement is "upon inspection"
@DaveRandom Nobody blindly flushes; don't kid yourself ;)
nice page... full of atttacks..
@PeeHaa埽 here is the current code i am using "<?php
session_start();
if(isset($_SESSION['name']))
{
if(!$_SESSION['name']=='admin')
{
header("Location:login.html?id=You are not authorised to access this page unless you are administrator of this website");
}
}
else
{
header("Location:login.html?id=You are not authorised to access this page unless you are administrator of this website");
}?>" and in logout the code is "<?php
session_start();
$_SESSION=array();
setcookie(session_name(),"",time()-3600);
@CodingNoob Can you pastebin it?
20:26
@PeeHaa埽 means? :O pastebin ?
@Bracketworks Well yeh, fair enough, but I certainly don't inspect closely enough to determine the constituent parts
user652649
evening.
Evening wes
Evening. We're discussing @Bracketworks' bowel movements.
user652649
hey peehaa :P
20:27
@DaveRandom Oh, understandably, however I did leave out the detail of having consumed great quantities of gummy worms and blue-raspberry slushees, which provided quite an color indication.
Vivid, if I must say so.
user652649
@DaveRandom ok i'm leaving so
user652649
xD
Anonymous
@CodingNoob do you acctually have this on your site header("Location:login.html?id=You are not authorised to access this page unless you are administrator of this website");
I demand pictures!
@phpNoOBఠ_ఠ yes
Anonymous
20:28
Please remove it
@CodingNoob pastebin.com however i don't see any error reporting / exiting or var_dumping as per my suggestion
Anonymous
header("Location:login.html?id=You are not authorised to access this page unless you are administrator of this website");
Anonymous
Is just wrong.
Wow, ratemypoo.com still exists
It was quite an unbroken beast, like a sandworm from Betelgeuse. I should have snapped a pic.
20:28
@phpNoOBఠ_ఠ what to use now?
@DaveRandom damn you!
user652649
@phpNoOBఠ_ఠ if you read carefully that's an actual token (id=), not a text string
Ah well, maybe next time.
I purposefully didn't link it to try and save the laziest amongst you
20:29
@PeeHaa埽 pastebin.com/LSxaRbFh & all other PHP Masters
user652649
@CodingNoob login.html?errid=229 $errors[229] = "bla bla"; at least
@Wes what does this mean?
user652649
nothing
@CodingNoob Still missing my suggestions.
Anonymous
@Wes It does not seem on par with good practice though. He could just send a hashed id= and output it with a text format on the landing page
20:31
@PeeHaa埽 i tried that in past not now
@phpNoOBఠ_ఠ how can i do that? what do i need to add?
user652649
@phpNoOBఠ_ఠ i was kidding xD
Well in that case I cannot help you. I cannot see what is happening on your end in my crystal ball
@PeeHaa埽 :(
@PeeHaa埽 you don't have polished enough
@CodingNoob Passing messages via querystring to be displayed on the other end will inevitably result in an http://isgay.com kerfuffle.
20:32
evening guys, gals and suckers
Anonymous
@CodingNoob first focus on the main problem. That script I mentioned is not the cause for your session-related problems. Just fix the session problem first.
hiya @tereško
@PeeHaa埽 everything in your crystal ball is too diffuse...
user652649
breaking news. webkit implemented mouseenter and mouseleave events! i was waiting them since WW2
@CodingNoob fwiw my suggestions should either fix it for you or at least point out where the problem is
user652649
20:33
now i will have to wait until WW3 to actually use them
@bwoebi I got it on discount. I won't complain
@PeeHaa埽 problem is that" when i click on the page which include code it redirects me to login.html while user was not logged out yet
hey guys I was wondering if there was an idiom for update, if null insert
@phpNoOBఠ_ఠ hmmm yes but it seems good to me to show as text on the page lately that's why i asked
@PeeHaa埽 buy a new one.
20:34
that works across most flavors of sql
anybody here work with h2 databases?
Anonymous
@CodingNoob come here
@Bracketworks it's missing the thing from MassEffect
@Bracketworks lol
20:36
@tereško It's missing what I created not 20 minutes ago.
@CodingNoob btw I doubt you meant to do if(!$_SESSION['name']=='admin')
anybody? sql?
@tereško Just looked it up (haven't played it) that's pretty darn big.
the if @@rowcount stuff only works for mssql server
does merge into work for postgres?
@HansZ No thanks, I've got enough
20:37
lololololol
i still remember when this chat has 1..2 lines of avatars
@HansZ Seriously though, what you are talking about it sometimes annoyingly referred to as "upsert"ing and approaches are many and varied
What are you actually trying to do? (schema + RDBMS)
People should be treated with shiock therapy who upvote stuff like that
omfg java doesn't have default values for arguments
okay people, have a good one!
20:42
> -10 User was removed
hi
hi
table preset contain id, sspsid,categoryid
id = 1, sspsid = 1,2,3,4,5,6, categoryid = 1
query
select preset*., category.title, etc
how can I select ssps table title contcate
@StackExchange Y U NO SHOW ME WHICH QUESTION????
@NikiC hehe, this is one of the things that bit me when I went back to working with Java
@NikiC A few years ago, PHP hadn't supported it either...
@NikiC No you overload instead. The two are sort of incompatible I guess (although not really)
20:44
@DaveRandom They are absolutely not incompatible, Java is just too stupid for it
Not that that's any news of course
@NikiC That beats me... You have to write a crapload of unnecessary overloads
@DaveRandom And then I have 5 functions which call each other until you have a function which has the 5 args
posted on June 06, 2013

The PHP development team announces the immediate availability of PHP 5.4.16 and PHP 5.3.26. These releases fix about 15 bugs, including CVE-2013-2110. All users of PHP are encouraged to upgrade to PHP 5.4.16. For source downloads of PHP 5.4.16 and PHP 5.3.26 please visit our downloads page, Windows binaries can be found on windows.php.net/download/. The list o

hell lot of attacks... how does stackoverflow do the escaping?
@Feeds yay!
20:46
@NikiC I here condemn the authors of java compiler for being soo lazy...
@Feeds not interesting... Announce finally PHP 5.5.0!
@NikiC How many RC's still until PHP 5.5 release? one or two?
@bwoebi one or two :)
@NikiC Which one? xD
> We had bloking [sic] bugs so we had to release another RC. Expect another RC or a stable release to be announced for June 20th.
20:51
@NikiC this means zero or one, not one or two...
@bwoebi Hm... yes, you are kinda right :D
But you know, this is PHP, so it makes to plan in an additional RC ^^
haha xD
@NikiC Are there already features which will surely go into PHP 5.6?
@bwoebi nope
… and perhaps? (any features you know that the creators plan to get in?)
@NikiC or get out?
20:57
"the creators" sounds like some group of evil people puking in shit in PHP
@PeeHaa埽 loooooooooooool
@PeeHaa埽 yeah, this evil group making PHP consistently inconsistent.
"Do not mingle with it too much if it is working"
@PeeHaa埽 fantastic.
I just hope that it's planned to retry to get the property accessors into PHP...
21:15
@bwoebi What happened to them?
21:26
Looking for a good host. Would love a virtual host that gives me full control over the OS, etc. Ping me if you are happy with or hating yours.
9
@LeviMorrison Look no further! :P
user652649
@webarto hey man how's it going? i'm looking for a vps too, do you know some good hosting company in central europe that does English support? france, germany, austria...
user652649
brb
21:58
hi anyone from the miami area in here?
Would anyone mind sharing with me what's wrong with the following??
header('Location: detail.php?fatherID=".$FatherID."&amp;TypeID=".$TypeID."&amp;ListingID=".$Listin‌​gID'."');
I've tried this with and without ."
You are mixing quote styles
@PeeHaa埽 If you could show me the proper syntax I'd be most appreciative
I'm only here for advices
@LeviMorrison In Motion Hosting. You WONT find anything better
@PeeHaa埽 but I think providing the proper syntax for this line is simply copying my line I pasted, making the edits and pasting it back
It's not that I don't want to. I don't KNOW how
22:07
What did you make up from the advice I just gave you?
Ive been switching quotes around for 30 mins
i simply dont know the proper syntax when including a ? at the end of a Location: URL
Well stop doing that. Pick one type of quote and stick it. Also start using a text editor / ide with syntax highlighting
@StuartKaufman It's just a string like any other
I honestly don't know the difference between single and double or when to use each
@StuartKaufman have you checked the manual? php.net/manual/en/language.types.string.php
yes
but I didnt see anything applicable to my scernario
22:10
The manual is pretty clear about quoted strings
I guess header('Location: detail.php?fatherID='.$FatherID.'&amp;TypeID='.$TypeID.'&amp;ListingID='.$Listin‌​gID'); is correct?
@StuartKaufman almost, but as stated before start using an editor with syntax highlighting
I am I am
That should make the error obvious
Using Notepad++
22:12
What does that quote at the end do?
Not when you're very novice
@StuartKaufman Unless you have some plugin installed Notepad++ does not provide the kind of syntax highlighting he is referring to
And don't you agree the colors seem off at the end and following lines
Thats the ending ' from header('Location: ....');
@StuartKaufman count the quotes. If they are an odd number you are doing it wrong
22:13
Yes I see the colors are off and I can tell something isn't right. I just dont know what
I have 6 quotes
@StuartKaufman thats if the entire value is a string, you are mixing vars into it and concatenating
@StuartKaufman I count 7
@StuartKaufman If you cannot count you are going to have a hard time getting anything done :P
I see... 7
Now Im struggling to find the offending
3 mins ago, by PeeHaa 埽
What does that quote at the end do?
I guess the last '??
Yes @crypticツ, I know
Thanks
It's rough trying to come from a life in the field turning wrenches to this
but Im getting it and I appreciate everyones help
now lemme see what removing the 7th quote does
Hmm...
Back for more
The url I am left with after the following code is: xxxxxx.com/…
22:19
Isn't that what you wanted?
If someone wouldnt mind sharing with me why I am getting amp; in the url I'd be most appreciative
@StuartKaufman Because that's what you typed into the header
Personally I think you're going about constructing a query string the wrong way altogether php.net/manual/en/function.http-build-query.php
I thought this was necessary to make it output the proper html compliant url
22:21
@StuartKaufman No. What you put in is appropriate encoding for HTML in the context of normal HTML content. Depending on where the value is being output (url, JS, CSS, HTML content, HTML attribute, etc) different encodings must take place
As I said you guys, I am very novice
but I sincerely appreciate the help
and if im constructing a query wrong that's because Im working with an existing script
@StuartKaufman Ok, but if you're able to add the code to concatenate a string into a URL query then you can create an associative array and concatenate the output of the http_build_query function
Do whatever way is simplest for you
But the $amp; situation and other encoding issues are gonna be handled properly by PHP's functions that deal with URL building
@crypticツ How are your partitions?
@StuartKaufman Just don't use &amp; when constructing the string for a redirect. Simply use &
Anonymous
@PeeHaa埽 check it back again
0
Q: Are there any vulnerabillities here? (PHP)

James PatersonSo, my script allows people to write content into a .txt file and save it on the server. They can currently write anything they want to. This is the method I'm using to save the file. <?php $victim = $_POST['victim']; $user = $_POST['user']; $comment = $_POST['comment']; $IP = $_POST['IP']; $d...

@PeeHaa埽 evening
How was your day ?
0
A: PHP - Safe way to download large files?

BabaThe easiest way to copy large files can be demonstrated here Save large files from php stdin but the does not shows how to copy files with http range $url = "http://REMOTE_FILE"; $local = __DIR__ . "/test.dat"; try { $download = new Downloader($url); $download->start($local); // Start ...

@Baba Busy
23:01
@PeeHaa埽 yeah .... very busy myself ... having headache
23:38
@Danack I recovered about 90% of my data (recovered all my important data, wohoo) and I finally figured out what had happened. =o(
cool. user error or just dodgy software?
Ok so I was working on some bash scripts which I use for my webserver, I have an update script I was moving which has the following code at the end to empty out the temp downloads directory rm -fr ${DOWNLOADS_DIR}/* after the updates are downloaded and applied. Well that variable is included into script via source ./paths.sh well I had earlier changed the name of the variable as I was doing a lot of modifications to the update system.
So when I had acidently executed the file, which would normally be harmless and just do update no big deal it ran the code, but since the var was missing it was intepretted as rm -fr /*
FFFFFFUUUUUUuuuuuuuu........
I had no idea it was deleting all my files in the background
@crypticツ ouch!
23:44
yeah, lesson learned, backup more often, don't mark any local dev files as executable, and find out a safer way to empty a directory in case the path var is missing
@crypticツ hehehe, I've done something like this before
Does anyone know how I can safely empty the directory? The only way I have thought of is to create a var DELETE_DIR=${DOWNLOAD_DIR}/* then before passing it to rm check to make sure it contains a path.
use something at least slightly hardcoded? rm -fr ${PROJECT_DIR}/project_downloads/*
Don't run webserver scripts as root? :P
@Danack oh no it was not root
this was on my laptop
It deleted all my files, root was untouched
5 partitions emptied, everything from media, webdev files, to my tax returns >.<
Ok - but usually a website is user => websitename, group=www-data. So if you were running the script as websitename, it wouldn't have been a big problem - but I still think just including at least one bit that is hard-coded would also stop it being such a horrible problem.
23:55
@Danack yeah going to hardcode part of the path =o)
You could also force scripts to be run as a particular user:

if [[ $USER -ne ${PROJECT_USER} ]]; then
echo "This script must be run as ${PROJECT_USER}"
exit 1
fi
Which would also prevent the script from running if the variables hadn't loaded.

« first day (964 days earlier)      last day (4209 days later) »