« first day (633 days earlier)      last day (4306 days later) » 

12:02 AM
@tereško i just think putting } on seperate lines is redic
 
well .. i don't
although , i would try to avoid such code to begin with
 
if(){
  // weee
}else{
  // weeee
}
is my style
or : and endif;
 
@Mike I think that style should be reserved for templating; jumping in and out of PHP.
 
which, @Bracketworks? : and endif;?
 
12:05 AM
both
 
i agree
 
Yeop.
 
then again i use ternary a ton for inline stuff
 
@Bracketworks , then again , any templates , which contain conditionals are highly suspect
 
like for welcome back, or hello guest messages at the headers and stuff
how so
 
12:07 AM
@tereško Well, I was thinking more foreach(): and endforeach;
I used to newline each brace; now I newline braces around definitions, and sameline braces in control structures.
 
templates should have as little logic as possible
 
@tereško Highly agreed; iteration is clearly fine.
 
true, but for instance... if you had a welcome statement, would you handle the conditional for the entire statement or just whether the user is logged in or not.
e.g; Welcome back <?= $username; ?> instead of passing something like <?php $welcome_message = "Welcome back $username"; ?> and then in your view echo <?= $welcome_message
 
There's no condition in that.
 
<?php echo $username; ?>
 
12:10 AM
hold on
<?php echo ( !is_loggedin() ) ? "Welcome Back $username" : "Hello Guest, Click Here To Login!"; ?>
is what i use sometimes, in a view. rather than performing the conditional in a controller nad passing the entire message to the view
 
hey guys
 
@Mike Why is is_loggedin() a function? If you're doing that, I would think you'd pass some sort of $auth var to the view.
 
as js chatroom is empty, i came hee
r
 
it was an example bracketworks
 
@Mike view !== tempalte
 
12:12 AM
ah thats where the miscommunication is then :)
 
how can i loop over map list in js ?
 
but i always use things like that in views
 
for(var k in mapList){
k.key and k.value
}
 
@doniyor javascript room has exactly same amount of people
 
rather than carrying the conditional statement in the controller and passing the entire message into the view.
 
12:13 AM
@Mike , you are making no sense
 
6 in 1 half a dozen in the other, i suppose.
 
@teresko no, not at this moment, isnot it ?
 
probably so, im sober.
need more ->
 
@doniyor , there are 17 people in

JavaScript

Topic: Anything JavaScript, ECMAScript including Node, React, ...
 
he prolly means jquery
lol
 
12:16 AM
then again .. he is one of children which enter chat room with "is anyone here?" .. the most annoying phrase for chat
 
haha
 
@teresko sorry but i am not a child...
i was sitting on one code since 3 hours and i thought i would need some help from here
i thought people will help me rather than pushing me out
 
user895378
May 11 at 19:39, by gosto
i thought i can find answer here quickly , but its the opposite , only advices
 
is anyone here?
 
hi @David
 
user895378
12:18 AM
lol
 
mega lol
 
hi @hakre
 
you know, @doniyor people always come in here and then say that and then leave. im not sure why.
Is it just me or is there an elephant in the room?
see what i did there?
 
php mascot should be pink elephant .. to complete the metaphor
 
@Mike I do
 
12:20 AM
yeah I love the pink ones, but it didn't make it on the homepage so far.
 
@tereško I bought phpStorm ;)
 
look @Mike i would help and doesnot matter if he leaves now or later or doesnot answer my help... but anyway..
 
my condolences
 
They should turn the whole blue colors into pink via stylesheets :D
 
Why don't you like it?
 
12:20 AM
in english baxter, you know i don't speak spanish.
 
@David Why?
 
@hakre because netbeans and eclipse both suck
and I don't really like using notepad++ for everything
 
@David Well that's no technical reason to buy PHPStorm.
 
dude what the f
in ubuntu i cant figure out how to connect to a VPN
like .. ive added it
but howtf do you connect
 
@hakre it integrates well with git, it supports phpcs which can be a nice tool, it detects copypasta
the autocompletion actually works
it supports traits well
the javascript support is amazing
 
12:22 AM
@doniyor , here is a question for you , why you as java developer decided to ask for JS help in php chat room ?
 
ill stick to sublime text 2, until phpstorm can support multi-line selection.
 
Uhm, that's all true but no reason to buy. That's all I wanted to say.
 
@hakre oh...then why not
@tereško because java is the best language and has the best mvc frameworks
 
riiight .. but that would not answer my question
 
right but java is better than all other languages so it can be asked here
 
user895378
12:24 AM
@hakre I believe I recall seeing a specific problem with the github integration in phpstorm 4.01 that @hakre commented on at the phpstorm site
 
@David and now you made an impression , that in your mind, java and javascript are one and the same
 
@rdlowrey Yes, and it turned out some weeks later, the problems grow. My ticket was practically hjacked ;)
 
please stop trolling, @David
 
fine
i'm done
 
user895378
@hakre I saw that yesterday when I was testing out phpstorm to see if I wanted to use it ... if there are bugs like that I'm not interested.
 
12:25 AM
i've been trying to figure out what to name this interface for the past week and it's driving me crazy way more than it should
 
@teresko sometimes, if you sit whole day on coding problems, at the end of the day, you even dont know "how to print a string"... i just asked here for a quick help.. anyway.. i found the solution and thanks @teresko for the talk! :D
 
user895378
I can't afford to waste time trying to make my editor work.
 
What's missing in PHPStorm is support for phar files. But normally bugs are fixed and features are integrated quite quickly.
 
@doniyor , if you have a JS problem and javascript room is dead, you should head for freenode's ##javascript channel
no point in trolling php chat room ..
 
12:27 AM
@teresko you are totally right ..
 
@David PHPCS integration works pretty fine I'd say.
@rdlowrey Well, git integration itself works w/o problems, that one is a github plugin you can make use of to checkout from github via some plugin. You can always do the standard git checkout, no problem at all.
 
user895378
@hakre Yeah ... it's just a bad sign when the very first tool I tried to use in the program was broken.
 
@rdlowrey Which OS were you using?
 
user895378
It's like opening up someone's repo on github: if the first file you look at is garbage you're just going to assume all the code is garbage.
 
mother of god
 
12:32 AM
first impression often counts.
 
user895378
@hakre I just warez'd a windows copy to try it out and see if I was interested. Hadn't tried it in my usual *nix environment
 
 
but can be also misleading.
 
google chrome forgot all my passwords
 
user895378
@Mike only a problem if Mike forgot all your passwords too :)
 
12:33 AM
and he did
 
lol
 
@Mike Playing with the new profiles settings?
 
thats what i get for making them alpha/numeric/sym and 16 char long
no
i have them written down in my file cabinet
problem is i lost the key >_>
time to drill the lock!
 
@Mike In a world of computers, even a sheet of paper can be pretty save.
 
so can passpack
or 1password or (any other password manager)
 
12:35 AM
keepass ftw
 
@David i have 1password but it doesnt have all of the stuff, like the password to a clients VPN network
 
@hakre , if you want a secure media for storing information , put it on 8 inch floppy
 
which their sysadmin felt the need to make it abnoxiously long
8 inch floppy lol
i want cross pc syncing.. i had lastpass but god it blew. i use 1password now and i cant fig how to get it to x-sync
 
/me is using OperaLink
 
or you can use google docs
just make sure you have a secure as F pass =)
+ its free
 
12:38 AM
@tereško always making a great sound.
 
btw, here's a scary thought : installation of win95
 
why is that scary?
i have plenty of fond memories of 95
 
windows me = scarier
 
was about to say that
scarred memories of windows Me
jesus h christ 1password bundle is expensive
 
@Mike better tools exist for free.
 
12:41 AM
$50 for the windows/mac bundle
name a few
 
The expensive part about 1password is the marketing you need to pay to pay the pay.
@Mike done that. you need to listen.
 
keepass?
keep-ass
 
> As a cryptography and computer security expert, I have never understood the current fuss about the open source software movement. In the cryptography world, we consider open source necessary for good security; we have for decades. Public security is always more secure than proprietary security. It's true for cryptographic algorithms, security protocols, and security source code. For us, open source isn't just a business model; it's smart engineering practice.
Bruce Schneier, Crypto-Gram 1999/09/15
I'm off wishing you all a sweet rest of the day and dreams later on.
 
heh keepass doesnt run on lion
 
@Mike May KeePassX does? keepassx.org
Otherwise use wine.
 
1:04 AM
i have broken the conformity... i have deactivated my facebook acct
 
is it possible to do 1-time pads with php?
 
oh my lord, installing RVM on ubuntu is so much less painful than mac os x
anyone on have exp with MongoDB or similar nosql solutions? i have a question about whether mongodb/sqlite would be a good fit for my application
 
 
1 hour later…
2:32 AM
How can i post HTML as a value of an XML? i tried CDATA, htmlentities and htmlspecialchars and didnt work
 
stupid ruby
cant figure out why passenger wont load
 
2:52 AM
MYSQL chat is dead right now, dumb question : If I want to insert a value only if another value exists in mysql, do I need to run two queries or can I run one?
One to check if value exists, second to insert
 
user895378
3:29 AM
@Mike I've done this once before. I basically never use it. I should probably do it too.
 
5:19 AM
posted on July 10, 2012 by Cal Evans

Blog:  http://elizabethmariesmith.com/ Twitter: @auroraeosrose Show Notes: http://mojolive.com http://www.phpwomen.org/ http://gtk.php.net/ http://www.linkedin.com/ Sponsored by: Engine Yard

 
 
2 hours later…
7:24 AM
@Mike MongoDB has it's place, but make sure you're aware of the caveats if you want to use it. It currently uses a global lock (will be changed in the 2.2 release - currently unstable). When you perform an update/insert, you don't know if that data has hit the server unless you specifically check for the return code. It uses this fire-and-forget mechanism to achieve throughput. Too much throughput + global lock = problems.
I actually recently took MongoDB off my server. It's only a little VPS, and I want to store relational and non-relational data. Mongo was too hungry for me to run multiple servers, so I'm giving Percona + HandlerSocket a go.
 
morning people
 
o/
 
morning @PeeHaa
 
8:05 AM
morning guys (even though its getting dark here) :D
 
8:40 AM
posted on July 10, 2012 by Lorna Mitchell

PHP has a variety of magic methods; methods named with two underscores at the start, which get called automatically when a particular event happens. In PHP 5.3, a new magic method was added: __invoke(). __invoke() The __invoke() method gets called when the object is called as a function. When you declare it, you say which arguments it should expect. Here's a trivially simple example:   c

 
8:53 AM
I know this is not strictly the appropriate room (I tried on server fault, but it's a desert there)
but here it is:
[copy paste rulez]
I have a peculiar problem
I was trying to access phpMyAdmin through the browser, it wouldn't allow me, and when I started investigating I've discovered, to my enormous astonishment, that there is no phpMyAdmin directory on the server. At all.
But, all the config files are still there. So, I was wondering what would be the implications of simply reinstalling it?
 
OS ?
 
@MeLight backup config files, re-install, restore config files
 
centos
 
worst that can happen is it doesn't work
but you have a backup, so no problem
 
I dont need the configs, I was wondering if they're gonna cause trouble for the new install
 
8:58 AM
@MeLight just delete them then?
 
@Leigh good call, I've found them in like 4 folders
this server is a total mess
 
:) install to a new folder
 
At times like these I understand why I dread administration
 
if there is no phpmyadmin on the server, none of the config files are being used, right?
 
correct
 
9:00 AM
so what will it hurt if you get rid of them?
 
@Leigh i think ill go for it
 
make a backup
if you don't want to delete, just move them
 
especially coz we just had backup a few hours ago :)
ok, off to reinstall and stuff
 
have fun
 
why do you need a backup of phpmyadmin ?
 
9:02 AM
I don't need it, there's a server backup
 
is it installed in web directory or globally ?
and linked to apache
 
whats up!!
pretty hot programmers: php
 
LOL
 
hey @jasminder
 
@PeeHaa We really need that dump of Russian something in questions?
 
@Whisperity Bulgarian ;)
 
@PeeHaa Mea culpa. Just call it 'dump in Cyrillic' and we are enough close to the truth. :)
 
@Whisperity True :-)
 
Hi. I am new to php. Can someone help me with some syntax errors?
 
9:35 AM
Don't ask whether someone is here or can help. Just tell us your problem.
 
@Whisperity btw: you're new here in chat? Don't think I've seen you before have I?
 
Ya im new to chat too :)
 
37 secs ago, by Whisperity
Don't ask whether someone is here or can help. Just tell us your problem.
 
@PeeHaa Yes I'm fairly new. Even as a contributor to StackExchange.
($rant = new Rant('Why can't Stack Overflow's chat show other non-SO rooms I'm in. On AskUbuntu, the chat shows the Server fault and Super User rooms I have favourited too.', 'Why is SO's meta so different than other site metas...', RANT_OFFTOPIC);)
@MadhulikaMukherjee So, just tell us what the synxtax error you got is. We will help if we can :)
 
I had the following three lines in a certain php file where i started getting errors,

$id= json_decode($_POST['id']);
$name = json_decode($_POST['name']);
$Address = json_decode($_POST['Address']);

The errors were :

<b>Notice</b>: Undefined variable: id in <b>C:\xampp\htdocs\connection.php</b> on line <b>37</b><br />
<br />
<b>Notice</b>: Undefined variable: name in <b>C:\xampp\htdocs\connection.php</b> on line <b>37</b><br />
<br />
<b>Notice</b>: Undefined variable: Address in <b>C:\xampp\htdocs\connection.php</b> on line <b>37</b><br />
 
9:40 AM
@MadhulikaMukherjee You sure want to call json_decode() on $_POST?
 
The fields id, name, and address, are being sent as form inputs from an html page
 
@MadhulikaMukherjee That is not json encoded
 
so i think i should use $_POST
right?
im not sure
 
right, but that isn't json encoded
 
@MadhulikaMukherjee Then there is no need for json_decode(). All you need to do is $id = $_POST['id']; and the others respectively.
 
9:42 AM
at the click of a submit button, here is how i send my three fields to the php file mentioned above -

<script>
$(document).ready(function () {
$("#btn").click( function() {
alert('hello hello');

$.ajax({
url: "connection.php",
type: "POST",
data: {
id: $('#id').val(),
name: $('#name').val(),
Address: $('#Address').val()
},
datatype: "json",
success: function (status)
{
if (status.success == false)
{
alert("Failure!");
}
else
{
alert("Success!");
}
}
});

});
});
</script>
 
I see relevant question on your profile. You only need to call json_decode() if the input itself has been previously encrypted with JSON.
2
Q: PHP for parsing JSON and adding to database mysql

Madhulika MukherjeeI am making a web app (android) with phonegap and jquery mobile. I am trying to send three fields from an html form as json, to a php page which will decode the json string/object (im new to json, ajax, jquery) and add the three fields as a mysql query to a database on my localhost. My html pag...

 
thats MY question :)
oh i see
let me check
 
@MadhulikaMukherjee Yes, that's why I said I see relevant question on your profile. You might want to print_r($_POST); to get a dump of what you get posted.
 
Alright. Are you saying i should just say

if (isset($_POST['name']))
$name = json_decode('name');

and not

if (isset($_POST['name']))
$name = json_decode($_POST['name']);
 
@MadhulikaMukherjee $name = $_POST['name']; if the input is not JSON-encoded.
 
9:46 AM
yes but the input IS json-encoded! look at my html file, its sending json encoded data to the php file
:(
 
@MadhulikaMukherjee Then do print_r($_POST); and after you got $name decoded, print_r($name); to make sure you get the input you want to get.
 
alright i will try it and get back to you in some time
 
Good morning, Dinesh and Bikas Das.
 
Good morning,I am using the ajax uploader (valums.com/ajax-upload) in my php application. If i upload picture, its works fine . When i upload flv file i got the response as "For security purpose this page is denied by server"
I gave respective uploader for both picture and video file and given allowed extension in my controller.why i cant upload video format. Do i need to give content type for video format ?
Kindly advice
 
Search for the error in the source code and track back why it is thrown.
 
9:57 AM
can I write code for schedule task in mysql for a php application ?
 
Yay found a post where I could use the random number xkcd image
1
A: How is PHP's mt_rand seeded?

PeeHaa Image source: http://xkcd.com/221/ Funny because it's true.

 
once i upload video it immediately response 403 forbidden error
 
@BikasDas Of course you can. PHP codes can be executed as a scheduled task with using the proper crontab and the php command with the php-cli SAPI.
 
@ircmaxell will probably like that :)
 
9:59 AM
@Whisperity can u provide a tutorial link for that ?
 
@BikasDas Just write a normal PHP code with no browser output (HTML) in it. Then, nano /etc/crontab (with root priviliges) and you will see the documentation in crontab of what to enter. You can test your script by going php myscript.php in the terminal too.
 
hi to all i have one problem anyone help me? my problem is creating session in php
 
0
Q: check login credentials

mauroi have a login form that when i get to the page it gives me automatacally the alert message, and i didnt put yet the user and password info when i go to the page, the message that gives me is "User and password dont match". Here is the page that makes the verification of the login form, hope for ...

$linha... really?! I mean its pretty much okay that in my code, I name the variables as I want, but still...
 
Could you people please check my question
 
@Whisperity I ll try this
 
10:19 AM
Geany should really load all the files (and thus the function tooltips) inside the project even if not all files are opened actively.
 
10:29 AM
Well, @PeeHaa, I will try out NetBeans :)
 
@ArtjomKurapov like what?
 
not really
 
@PeeHaa how do you use PHP with NetBeans?
 
Well you can git pull request for changes
 
11:07 AM
@Whisperity Idunno. EditPlus FTW!
 
11:17 AM
my cron wget creates lots of files in root any solution how to stop creating files
use this code for cron jobs
/usr/bin/wget example.com/file.php >/dev/null
 
Greetings.
 
2 862 questions tagged . Hmm...
 
Hello everybody
i have one taugh work to do, so I need a good idea for doing that.
Can someone help just with idea?
 
@DanielsPitkevičs Just post the problem and we will see whether we are able to help. If it is more complex, you should post a question on the site instead.
 
Hmm, ok, i'll try asking here firstly
 
11:32 AM
my cron wget creates lots of files in root any solution how to stop creating files
use this code for cron jobs
/usr/bin/wget example.com/file.php >/dev/null
 
wget is a tool to download files, of course it will create the file. You can call mv to move the file afterwards. Cron processes are executed as root by default, with their working directory set to the home of root, by default it being /root.
 
so how can i stop this
i found ">/dev/null 2>&1" to add this at the end is this fine
 
I have to make a report from very old mysql database (about year 2003). So the style is bad.
The structure is that table have columns: id, type, field, value. In these fields are all information but for one id there are many entries. If normally data would be stored like this: id, name, speed, service, project etc, then in this table data is stored like: id (used for many rows), type, field (here is placed name, speed, service .... but just one of them), value (value of field 'field').
But I need to combine this table data for each id (where are multiple entries with each id) with table where are connections between tables and then combine with third table (which actually is the same table as first but with different id). I wrote a script but it is awfully slow, PHP cannot execute it in 30 seconds. Maybe some directions in which I should write script?
 
@DanishIqbal If you do so, the file will instantly be removed and you won't be able to fetch the content inside.
 
And I should go through about 75k entries.
 
11:36 AM
@DanielsPitkevičs Go and post on the main site.
 
which file instantly removed ?
the files which creates in root ?
 
@DanishIqbal The file which wget downloads. Yes, that file will instantly be passed into /dev/null, which is the bit hole. It means that everything written into it disappears.
 
good means if i do this my root its not fill with thousands of files ?
@DanielsPitkevičs you can solve this problem
PHP execution 30 secs limit
 
@DanishIqbal You should check why it was filled with thousands of files in the first place.
 
11:40 AM
simply just make the foreach loop
and put your db connect lines in it so that the lopps connects and close it again and again
and when foreach loop complete your work complete
 
@DanishIqbal I suppose execution time I can increase in php settings, but I have no access to php settings.
Hmm
 
@DanielsPitkevičs If you have no access to php.ini, you can still call ini_set().
 
set_time_limit(0)
 
@Whisperity actually my app add cron job automatically with user detail and its run every minute but after first run of the script i set to stop in database so the cron tries to run again the job but after reading few lines of my files it exit
@DanielsPitkevičs i have same problem of time limit
i solve this problem with below procedure with i mention in above
@Whisperity thanks :)
 
Thank You for ideas. I will try
 
11:46 AM
'http://stackoverflow.com/questions/9340847/how-can-i-remove-duplicate-values-from-a-multi-dimensional-array-3d-array-in
 
hrm, just found out that a good friend from high school works for github (and has for quite a while)
 
good :)
 
@ircmaxell At what position?
 
not sure
 
@DanishIqbal How do You think close and open connections?
 
11:53 AM
@PeeHaa employee #15, designer
 
@DanielsPitkevičs simpley use foreach()
connect
do your work
close
foreach ($list as $value) {

$con1 = mysql_connect("localhost","user","pass") or die(mysql_error());
mysql_select_db("datbase_name",$con1) or die(mysql_error());

$adder = "INSERT INTO table_name (field1, field2)
VALUES ('$value1', '$value2',)";
$result_adder = mysql_query($adder);

mysql_close($con1);
}
 
@DanishIqbal But I do my stuff inside foreach which have passed array from database, so I can't connect to database after foreach.
Where do You get $list?
 

« first day (633 days earlier)      last day (4306 days later) »