« first day (712 days earlier)      last day (4241 days later) » 

@DaveRandom You saw what happened?
 
@PeeHaa ?
 
@DaveRandom Found a bug. Don't think you have been in that part of the code though
That cv request of @Robik resulted in 2 notifications
 
?
 
@Robik cv plugin bug :) Not your fault ;)
 
3:09 PM
:)
 
@PeeHaa Not for me, I'm running a version I'm currently working on though. It may be something I have fixed in the meantime.
Will push changes to my repo before I go home, we'll see if there's still a problem with that
 
@DaveRandom I like when issues are solved before they are known :)
 
@PeeHaa May not be, it maybe an oddity with the way the DOMNodeAdded event works combined with the major chopping and changing that happens behind the scenes in the SE code. I was thinking that some kind of mechanism to prevent dupe requests from entering the queue might be worthwhile anyway, that would fix the problem if there is one.
Although actually, thinking about it, I know what will have fixed it in the version I'm running
 
3:25 PM
morning :)
 
Morning NIkita!
 
Sup dawg
 
@NikiC Hi
 
hello guys, i am php normal coder and i want make one thing. i want write into php server side code and write with C programming language client Side code, but i have very poor experi experience in C programming. can anyone gave me advice how i can write c code wich will send information for example dir list into server and after this i will write code in php. sorry for bad english. thanks, *Dest
 
any news?
 
3:26 PM
3 mins ago, by PeeHaa
I've been stupid in the past :)
@Dest If you don't know how to write C don't do it please
P.S. This is PHP channel
 
@PeeHaa Well, that's not news :P
 
:D
 
> i am php normal coder
so... a terrible one then
 
@PeeHaa oky bro but i want help, true advice. sorry for Harassment
 
lol
Aaaaaand it's gone
 
3:31 PM
I gone done breaked the status poll :-( getting tired of build -> watch console -> change one line -> build ... repeat ad infinitum. Is there an easier way I'm missing?
 
@DaveRandom Implement unit tests so you know you break something :)
Although that may prove to be hard considering there is some tight coupling going on in there :P (Yeah yeah I suck)
 
I know that's on my radar of things to sort out. Not too much though, only really Post and VoteRequestBuffer. Plus at least you apologised in the comments.
 
:D
 
Well... at least the removal of notifications that scroll off the top seems to be working.
 
Progress
 
3:46 PM
polling works better when you turn it on...
 
How would you configure your VPS if you had 6 cores available and you could use at most 54% of one core? You must either choose 1 core and 54% or 2 cores and 27% etc?
 
@DaveRandom lol
@Dude Sounds like a strange requirement
 
Not a requirement
just a question
on how I should configure it
 
@Dude In general more cores = better, I would say, $concurrency++
Not a hard and fast rule though
 
But the guaranteed CPU resources decreases then
I currently have 6 cores and 9%
but would you change it to 4 and a little higher guaranteed resources?
 
3:49 PM
@Dude It depends
 
@Dude If you are running a highly concurrent app, more cores are better. If you are running a single CPU hungry app in a single thread, one core is better. Depends on the use case, in short.
 
I am going to use Jira and Confluence
With me as the only user
 
@Dude I'm out then, I don't even know what either of those are.
 
7,001 questions tagged
 
atlassian.com
 
3:52 PM
@hakra You better hurry before PHP 6 ;-)\
 
@PeeHaa oh that will become a mess :)
 
@hakra should be an alias of for the time being, IMHO
 
@DaveRandom Has been discussed on meta multiple times, but people who dont know php didn't agree
:(
 
Who's going to go retag them when PHP (whatever is next) comes along?
 
Only the minor version (is that the right term? 5.x.y, the x in that) tags should be specific. It would be good to have a more complex aliasing system where tags still appear in , but you can still filter down to just if you want
@salathe It should be done in such a way that the questions don't need retagging, only the tag relationships need to be changed
 
4:12 PM
@hakra , you have been busy
 
4:26 PM
Huzzah everyone :)
i thought this was a legal statement?
    			$dbcon->sendquery(
			'INSERT INTO deliver(`inviter_nick`, `invited_nick`, `inviter_email`, `invited_email`)
			VALUES(
				SELECT `inviter_nick` FROM invites WHERE `inviter_key`="'.$_POST['invtkey'].'",
				"'.$_POST['invdnick'].'",
				SELECT `inviter_email` FROM invites WHERE `inviter_key`="'.$_POST['invtkey'].'",
				"'.$_POST['invdemail'].'",
			)');
^that looks nastly formated :o how do you guys get yours to be all neatly formated? =o
 
@MoshMage do you know what SQL injection is ?
 
or should i just select them in a dif line and use their respective variables?
that ought to be enough and evade injection?
 
no , it would have no effect on you injection vulnerability
i actually am not even sure what you are trying to do there
 
what im trying to do here is to "save a trip" to the database
and select 2 values right of the database instead of going throught the php
 
@MoshMage Sounds like your are looking for caching
 
4:37 PM
also, @tereško, the linked-code isn't enought to stop all injections or just the injection that's possible from the pasted-coder ? (i thouhght my sendquery was safe, hence the asking)
 
@MoshMage the linked code is no enought to stop ANY injections
 
@PeeHaa im reading on that subject
 
@PeeHaa , what he actually needs is understanding of FOREIGN KEY and related concepts
and some understanding of prepared statements
 
@tereško either i can't properly sqlinject or ... idk do try (please) and 'drop *' the beast? sjzcraft.com/treba/?page=invite (i will hold no grudjes, in fact i'll hold thanks)
 
hello
 
4:45 PM
@MoshMage You want something like this:
$dbcon->sendquery('INSERT INTO deliver
(`inviter_nick`, `invited_nick`, `inviter_email`, `invited_email`)
SELECT `inviter_nick`, "'.$_POST['invdnick'].'", `inviter_email`, "'.$_POST['invdemail'].'" FROM invites WHERE `inviter_key`="'.$_POST['invtkey'];
@MoshMage That being said, you would be far better relating into the invites table rather than duplicating your data by reinserting it into another table
@MoshMage Also you might want to consider using prepared statements to reduce your vulnerability to SQL injection. I would recommend using PDO
 
i was thinking of using PDO, but i already had this class lying around and i wanted to make something fast - still: i am downloading a sqlinjection tool i found in a SO answer to test it out
 
hey fellas
 
@AndyPerlitch hiya!
@MoshMage Don't do it. Use either mysqli or PDO with prepared statements
 
i am using mysqli
 
@MoshMage With prepared statements and bound params?
 
4:52 PM
@MoshMage could tell me the answer in which you found the tool or tool name
 
2s @hekko
 
@MoshMage From the SQL you've posted you have no protection. From the linked function you've written your using an inferior custom set of code to do what PDO and Prepared statements do natively are far more efficiently.
@MoshMage It wouldn't take you long to switch over
@PeeHaa I didn't know mysqli has prepared statements
 
stackoverflow.com/questions/190435/… @hekko 2nd answer is tool im using
 
the pdo isn't totally safe check this stackoverflow.com/questions/134099/…
 
@James Sure
@hekko Specifically this answer
 
4:57 PM
@PeeHaa yes thats about i am talking
 
@hekko Its only 'insecure' if you retrieve and then used a "literal" in another query.
 
@PeeHaa this is the code im using to avoid injection paste.thezomg.com/4923/48763369
from what James sais it's less then pdo and mysqli but i am using mysqli and escape thingy
 
If I am looking into automating a task in an old win98 program (specifically, evaluating a CSV file and performing a task in said program for each record), what scripting language should I look into? Is this even possible? im a mac user with experience in php, js, and some java. i dont want someone to hold my hand, I just dont even know where to begin researching
 
11 mins ago, by PeeHaa
@MoshMage Don't do it. Use either mysqli or PDO with prepared statements
^I think you missed that
@AndyPerlitch vbscript
 
@MoshMage check this answer a complete sql injunction life saving for mysql_* function stackoverflow.com/questions/12549264/…
 
5:04 PM
@PeeHaa awesome, thanks!
 
np :)
 
Aren't you suppose to pass in the connection to mysqli_real_escape_string?
 
@PeeHaa Changes committed to repo and new build on DL page if you're feeling brave - all seems OK in the tests I have done, only real test is real life though... If you want to see a difference, make sure you check the new options and enable polling
 
@MoshMage Is mysql_real_escape_string sufficient for cleaing user input: stackoverflow.com/questions/2353666/…
 
@DaveRandom Great. Installing
 
5:10 PM
/me reading all links
 
nor the addslashes() is sufficient
 
@PeeHaa I've been to town with JSLint in the main file today, now passes with no errors. There are a couple of very annoying things it has started complaining about recently, in particular (function(){})() vs (function(){}())
 
addslashes isn't sufficient for some of the same reasons why mysql_real_escape_string isn't
 
@DaveRandom One should do the latter?
 
i have not even thouhgt about the xxs
oh god. ok. Ill just finish this then rewrite the class to pdo or prepared statments and htmlstrip
 
5:14 PM
its seems like to be safe from sql injuction dont use sql ...lolZ
 
lol
 
@PeeHaa Apparently so. I personally don't see why but I'm inclined to go with Douglas Crockford on it for now, given that it's just moving a paren. Although I set tolerate ++ and messy whitespace because my views on both differ from his.
 
@MoshMage than you need to thought this buddy .... other wise get ready for problem
 
@DaveRandom kk Will also follow that convention from now on
 
@DaveRandom óÒ
 
5:18 PM
@NikiC Nice touch with the eyebrows
Right, I'ma go home and eat some dinner. L8rz
 
later
 
@DaveRandom you can always use the kids-version of JSLint : jshint.com
 
> Good job! JSHint hasn't found any problems with your code.
:-)
Right, actually going now
 
@PeeHaa how to do close vote
 
little more needed
 
:)
2
 
6:03 PM
@PeeHaa Just an FYI because it occurred to me on the way home: The reason you got two notifications before is because the post was edited. When a post gets edited the old one gets removed and a new one gets added, and the version from last night did not have the DOMNodeRemoved handler to account for this. It has also made me realise that if you disabled the "Remove notifications for vote requests that scroll off screen" option it will happen, so will have to implement a work around for that
I have a plan though
Prob wont be on here tonight as am going out somewhere, will catch up tomorrow (or possibly much later on)
 
@DaveRandom A man a plan
@DaveRandom No worries. Take it easy
 
You know it baby :-P
 
6:30 PM
@DaveRandom, would you be willing to help me convert my entire mysql_ to pdo? I mean its like 3-4 pages with different functions using mysql_ that need to be converted to pdo.
Would anyone like to help?
 
@user1079641 If that is the case you have a huge design flaw in your system
 
@user1079641 , 50$ per hour
 
What happened, as you probably figured out, was that the whole site was based on mysql_ functions until I realized this thing was completely out of date. PDO was far more advanced and recommended. But I still have some parts of code that I don't know how to convert
except you guys are charging me now, so never mind.
 
@user1079641 You can base your entire application on something and still prevent tight coupling
 
What do you mean?
 
6:35 PM
In software engineering, coupling or dependency is the degree to which each program module relies on each one of the other modules. Coupling is usually contrasted with cohesion. Low coupling often correlates with high cohesion, and vice versa. The software quality metrics of coupling and cohesion were invented by Larry Constantine, an original developer of Structured Design who was also an early proponent of these concepts (see also SSADM). Low coupling is often a sign of a well-structured computer system and a good design, and when combined with high cohesion, supports the general goals ...
 
.. time to install new BSD server-like-thing in VM
 
@PeeHaa So what do you suggest/advice
 
@user1079641 Depends on whether it is a lot of work and what I would gain from it. But if I were in that situation I would rewrite it
 
point of order: by saying that , PeeHaa did not mean that he is willing to rewrite your code
 
Well there are two problems: 1. Apparently I was recreating a database connection in a ton of different files when one was already made in a file which was supposed to be the global one.
2. I am not asking anyone to rewrite the whole thing. I just need some help in converting the $query statement to PDO style and mysql_fetch stuff. So basically 4-5 lines in total.
 
6:41 PM
@user1079641 1. Dependency injection 2. We do have a nice tutorial for that
 
@PeeHaa is the tutorial given above you the one you refer to?
 
Seems there's no "good" article about migrating MySQL to PDO
 
Don't know that tut, but @tereško found a nice tutorial in the most. 1 sec
 
Okay, I was wrong :|
 
6:45 PM
@PeeHaa by Dependency injection, you mean create that one global file and link all files to it, correct?
 
Aaaargh I hate the UI of GitHub's gists. It's like the retarded brother of the main site. Totally not organized.
 
damn, the new install-setup-wizard-thing for freebsd 9+ is confusing
 
33
A: Use global variables in a class

PeeHaaThe correct way to solve this would be to inject the database handle into the other class (dependency injection): $db = new DB_MySQL("localhost", "root", "", "test"); // connect to the database include_once("pagi.php"); $pagination = new pagi($db); $records = $pagination->get_records("SELECT...

 
See, now I get a problem here (as usual):

	$name1 = "$_SESSION[name]";
	$query = $db->prepare('SELECT * FROM list WHERE name=?');
	$db->execute(array($name1));
Fatal error: Call to undefined method PDO::execute()
 
@user1079641 That's because you didn't read the tutorial
 
6:49 PM
what ??! are you saying that i cannot just make shit up and expect it to work ?
 
$name1 = "$_SESSION[name]";

$db->quote something like that
This code is from earlier
hence i asked.
@tereško
 
hence you were given a tutorial .. which you looked at and started to copy code from instead of reading it
 
Do you not know how to read?
 
Read the whole tutorial first, please.
 
I just said I had this code earlier, <-- this means I didn't copy it. I had it before you gave me tutorial
Easy to understand now?
If I don't convert to PDO, is it just a security flaw or any other serious too?
And you can't use Order By? Great!
 
6:57 PM
HELLO
 
that's it .. i am adding that guy to the ignore list
 
@tereško Ha! I was first!
 
Wow, not cool
 
$db->execute($query , array($name1));
 
6:59 PM
@Emis hello
 
@user1079641 So what help did you expect?
Cody ready for copy-paste?
 
If I am asking someone a level 4 question, and that person gives me a level 1 tutorial, what do you expect?
@PeeHaa You gave me a very basic tutorial that is of no help, because the code I have uses things that are not even talked about in that tutorial. When I ask about it, other people get angry
 
What stops you from using PDO manual?
It's level 9000
 
The link you gave me doesn't talk about things like Order By, or session variables
 
Why do you think PDO migration tutorial should include Session variables?
 
7:04 PM
@Emis , please dont make shit up. PDO class has no such method and PDOStatement's method has only one argument
 
Blah
 
@ircmaxell Bleh
 
Bluh
 
I just really need to know how to get session variables working with pdo :(
 
you pronounce it : "блядь"
 
7:15 PM
@tereško who are you talking to?
 
@user1079641 My crystal ball is out of order today.
 
Those pesky cheap crystal balls nowadays.
 
I have a magic function... magic("what I want it to do ")...
 
@ShaquinTrifonoff, perhaps you might be kind enough to help me. I really don't need anything other than getting session variables going with my code.
 
7:18 PM
I run a cron job nightly magic('Deposit $1000000 USD into my bank account')...
 
Perhaps you might me kind enough to elaborate 'is not working'.
 
@user1079641 Sure. I'm just reading the messages further up.
 
	$name1 = $_SESSION['name'];
	$query = $db->prepare('SELECT * FROM list1 WHERE name=?');
	$db->execute(array($name1));
	$row = $db->fetch();
	$id = $row['id'];
Fatal error: Call to undefined method PDO::execute() at line 8
 
lol
 
which is $db->execute(array($name1));
 
7:20 PM
read the docs
specifically on PDO::prepare
it tells you exactly what to do
 
@user1079641 It's $query->execute(...);.
 
reading is hard
it easier to just make sh*t up as you go , and then find someone who will fix it for free
 
No, perhaps if you put me out of your ignore list, you would understand that I am confused and instead of answering my question, you confused me like crazy even more.
 
@user1079641 1. Session Variables are not the problem here. 2 . PHP is right, there's no PDO::execute 3. You might be looking for this
 
And easier to ask others for help rather than trying to help yourself...
 
7:21 PM
but anyways, why am i talking
I understand that I might not be as good as anyone here, but I am trying. Sure I am slow, but I am asking because I am confused, not because I don't want to read, want people to work free for me, and all the things you said.
 
The problem is here $db ->execute
 
The problem that you're experiencing is pretty easy to identify if you would have followed the documentation...
 
Yes, I understood the problem. Thanks for pointing it out @Robik @ShaquinTrifonoff ...I appreciate it and won't make the mistake in the future.
 
that guy was given a tutorial about PDO almost an hour ago ... he still has not read it
 
7:28 PM
hello :)
 
@PeeHaa can you use vbscript within an application?
 
@Jocelyn Hi
 
Hi @Jocelyn.
 
@AndyPerlitch What kind of application?
 
7:32 PM
the one you make with application paper and some glue
 
lol
not sure what you mean by "kind". its an application that interfaces with a cutting table
 
@AndyPerlitch What language / what environment
 
its a gui program
 
@AndyPerlitch so are we talking about simple Prolog application for real-time operating systems to control the cooling rods in the reactor ?
 
@tereško essentially, yes.
@PeeHaa not sure what language it was written in
 
then why are you asking about it in php chat room ?
 
because there isnt a vbscript room :D
 
@AndyPerlitch Most Some applications will have some way of running external applications / script (at minimum cmd scripts) But it's hard to tell without knowing tha application
 
@AndyPerlitch there also isn't a room for posting nude pictures of people over 80 ... that does not mean that PHP chat room would be the appropriate place for it
7
 
7:38 PM
noted
 
@tereško I thought that was for the C++ room
 
@PeeHaa , judging by the incoming stream of flagged pictures , it actually might be for Android's room
 
how do I prevent users from accessing a subfolder and view the filelist?
what to add in the .htaccess file
the files are accessible of course
 
Just a general question, but I read some time back that Facebook writes its code in PHP and converts it to C++ to enhance quality. How exactly do you run C++ on a website? I though C++ was software programming, not web programming?
 
@radashk Simply make sure the files are outside of the docroot
 
7:47 PM
explain please
 
@user1079641 You can write "sites" in programming languages using CGI
 
so where should the url land to?
 
@radashk The only php file in the document root should be a file which loads the bootstrap file
 
document root is www?
for WAMP for example
I'm framework brainwashed
I know how Codeigniter routes all to index.php
and instantiates the controller and etc..
 
basically , when you are opening http://who.cares/index.php , it should be executing a file which contains :
 
7:51 PM
@radashk Never had to use WAMP, so don't know. It has to be somewhere in either the main apache config or the vhost config
 
<?php
    include '../application/bootstrap.php';
?>
 
but in pure PHP
 
@radashk Basically the same thing
(I think)
 
@PeeHaa , in codeigniter the index.php file IS the bootstrap
 
7:52 PM
@tereško Figures
 
which is just another reason why it sucks
 
still the same file
 
can you show me a basic file stricture example.. I have more detailed questions which I think I myself will respond to after I see it
 
I'd like to create links to remove entries from my database. I know, however, that using GET for such queries is not very secure. How do I go about this? Use GET anyway and then have verification during processing?
 
7:55 PM
@Chris you use prepared statements
 
4 mins ago, by tereško
<?php
    include '../application/bootstrap.php';
?>
@tereško btw why do you use include?
 
@tereško What do you mean by that? I am not talkign about the mysql query itself but rather the link that triggers it
(not a matter of injection)
 
@PeeHaa habit. I use include when i am intentionally executing/parsing the content of the file , and require when loading classes and interfaces
 
So it's fine that in my .htaccess I route everything to a file?
 
@radashk That's the point
 
7:58 PM
voila:)
 
@Chris do you know what prepared statements are ?
 
And the bootstrap file can find out what files to load from there on (for example by using a router of some sort)
 
$count=mysql_num_rows($result); vs $count = $result->rowCount(); are different, correct?
 
CAM
MAMP + MySQL is Crapping out on me
 
@tereško I thought you meant the queries you prepare, insert variables into and execute afterwards - is it something else you're hinting at?
 
8:03 PM
@CAM You should get a normal desktop
 
(thought you can also use MySQLi
 
CAM
@PeeHaa Thank you for the advice, but no.
 
@CAM Stop whining than ;-)
 
M stands for Mac or Microsoft ?
 
8:06 PM
@tereško It stands for that thing which was based on some unix kernel at some point
 
@PeeHaa , which reminds me of an old lecture about frebsd : youtube.com/watch?v=g7tvI6JCXD0
 
@tereško Like I said, I am not afraid of injection or anything, just don't want the links triggered through other means than clicking on the links (can be done with img src and other elements if I use GET submission - forgot what this vulnerability is called but there's a name for it). But I'll just stick to verification after GET submission rendering such practice useless
 
CAM
cam:bin root# 120927 13:11:11 mysqld_safe Logging to '/Applications/MAMP/logs/mysql_error_log.err'.
120927 13:11:11 mysqld_safe Starting mysqld daemon with databases from /Applications/MAMP/db/mysql
120927 13:11:11 mysqld_safe mysqld from pid file /Applications/MAMP/tmp/mysql/mysql.pid ended
@PeeHaa thanks again
M = Mac
Ok, so i created a new user on my mac
start mamp in new user and mysql will not start
login to other account start mamp, and mysql is running
 
user895378
What do you guys think? Is "reaching through" an object to retrieve one of its properties -- a DateTime instance -- and subsequently calling its DateTime::diff method a LoD violation I should worry about?
 
CAM
switch accounts and MysQL is fully operational
 
@tereško lol fun talk
@CAM Why are you running MAMP?
 
@ShaquinTrifonoff $count=mysql_num_rows($result); vs $count = $result->rowCount(); are different, correct?
@ShaquinTrifonoff no?
 
8:40 PM
@user1079641 $result->rowCount() is equivalent to mysql_affected_rows($result).
 
	// Mysql_num_row is counting table row
	$count=mysql_num_rows($result); // Check if supplied user, password, match database

	if($count==1) // If there is a match..
....
Except converting that to PDO is a hassle because $result->rowCount() is not right, and the answers on the internet aren't clear to understand.
 
$count = count($result->fetchAll());
@user\d+
 
9:13 PM
@user1079641 Well, in that case, you fetch the results anyway (using $result->fetchAll(PDO::FETCH_ASSOC);), and you count the resulting array.
That approach is fine because if you do have a match, you'll probably need to do something with it
And if you don't no array is returned anyway
 
9:26 PM
Does something look wrong with this?

$resultA = $db->prepare('SELECT * FROM `list1` WHERE id=? ORDER BY ID DESC;');
$resultA->execute(array($id));

while($resultAB = $resultA->fetchAll(PDO::FETCH_ASSOC))
?
@ShaquinTrifonoff @MadaraUchiha
anyone?
 
while($resultAB = $resultA->fetch(PDO::FETCH_ASSOC));
$resultA = $db->prepare('SELECT * FROM `list1` WHERE `id` = ? ORDER BY `id` DESC;');
 
so you want me to replace what i posted with thaat?
 
$resultA = $db->prepare('SELECT * FROM `list1` WHERE `id` = ? ORDER BY `id` DESC;');
$resultA->execute(array($id));

while($resultAB = $resultA->fetch(PDO::FETCH_ASSOC)) {
    // ...
}
No, with that --^
@user1079641
 
Fatal error: Call to a member function execute() on a non-object in: $resultA->execute(array($id));
@ShaquinTrifonoff
 
@user1079641 That means that $db->prepare failed. The problem would be a bad query.
 
9:43 PM
@user1079641 before the prepare, add this line: $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
 
@ircmaxell Thanks! I figured out the error. It was "Table does not exist." I mistakenly misspelled the name. It just doesn't show anything on the page though.
It was working fine earlier after converting to PDO, so it must have been some small change that I did.
 

« first day (712 days earlier)      last day (4241 days later) »