« first day (818 days earlier)      last day (4116 days later) » 

12:02 AM
I am having an issue with a drupal module - its the link module there seems to be a major bug in the code that create an amp; after ever & in a url ? Can someone look at the code and see if there's a glaring error - pastie.org/5665155 - Also sorry if this is the wrong place to post I figured since it was php someone might see it fast. my php isnt the greatest thanks
 
lol
 
@naeluh I don't think it's there. & is converted to HTML entity, because GET parameters are separated by &, what is the issue there?
 
@naeluh Your entities are being double encoded. Somewhere you are passing data through htmlspecialchars() twice (probably). Unless you are referring to the fact that URLs appear as key=value&otherkey=value in your HTML source, in which case this is not only nothing to worry about, it is the correct behaviour.
 
evening
 
12:08 AM
yo
 
@DaveRandom was that you who had a problem with stream_socket_shutdown or was it @rdlowrey?
 
It was @rdlowrey, I still haven't been able to reproduce it. It was a very narrow use case, it was something to do with async connections between two PHP scripts on localhost, possibly with crypto as well (in which case no-one is ever going to do it IRL because that's just insane)
I think it was Win specific as well
 
@webarto @DaveRandom ok thanks for looking at that. My issue basically lies in that I have a url that I place in the field and then when it saves to the db it adds the amp; - I can provide an example here - dev.client.gotpantheon.com/dobel_report all my facebook links that are created are broke because in the url has been altered ? Does that help explain my issue at all
 
@naeluh Right well that's because you are escaping for html before you insert into the database. Can you show you db insert code?
 
@DaveRandom because I just noticed that I'm using _shutdown, so being able to fix that case without breaking other cases would be nice.
according to the manpage fclose may not be enough.
 
would have to get the dets from @rdlowrey or go find it in transcript, which I cba doing at the moment because it is nicotine time
 
@DaveRandom ok yeah just one sec
 
or "nicotime" if you will
possibly also hammer time
 
@DaveRandom I need to get drunk to be able to sleep, or something. #fml
 
hello ;-)
 
@DaveRandom you know what dave I am not sure where it the module inserts into the db is there any other info I could provide that might help solve this issue ? thanks
 
@naeluh Not really, I'm almost certain that somewhere you'll find a function that looks something like:
function escape($str) {
  return mysql_real_escape_string(htmlspecialchars($str));
}
^^ that's your problem, I'm almost certain of it
@webarto Nothing a joint won't solve :-P
 
@DaveRandom Ok great so do I need get rid of that when I find it ?
 
joint on big tables always great
 
12:27 AM
@naeluh You need to get rid of the htmlspecialchars() from the function, when inserting into the database you should just escape for the database. Only escape for HTML when you are outputting data into HTML
 
I wonder what happened that users nowaday think they need to escape stuff before putting it into the DB.
It's such a common mistake.
 
function escape($str) {
  return addslashes(mysql_real_escape_string(htmlspecialchars(urlencode($str))));
}
 
@DaveRandom Oh man, that doesn't affect me (at least not one), I tried it once, and this guy is regular at it, after one he looked like he was welding without a mask, and I felt nothing. I'm not amused by it :\
 
@DaveRandom yeah see here drupal.org/node/1309658 everyone is saying that it should be fixed altering $item['url'] to $url = check_plain($url); but I patched my module and it did not work ?
 
@naeluh I don't know Drupal at all so I'm afraid that's kind of meaningless to me :S - you need to step back through all the places that data goes between being put into the application and being output onto the page, somewhere it's being double-encoded
 
12:35 AM
@DaveRandom ok great thanks for the help
 
@webarto One or both of you is Doing It Wrong™
:-P
 
@DaveRandom That is not something you should be proud of :P
 
I'm gone. Laters and enjoy
5
 
12:41 AM
@hakre phpBB's fault
sorry about that
 
@PeeHaa l8t0rz
@igorw I was inclined to suggest Wordpress, but if you take it that way, but wait, does this mean, that this is a common error?
 
lol he actually pinned it
@webarto It is a long expired chapter of my life. But I do maintain that Mr Mackie is wrong...
 
tzaziki time!
so I gonna go into the bg having some fun
cu later tomorrow.
 
@hakre nite nite
 
user895378
1:24 AM
@igorw It was a very narrow situation where I had a problem -- Windows-only, async stream socket client connected to an async stream socket server with both client and server running on the same machine. I originally used stream_socket_shutdown because of what I read at the manual as well. I feel fairly confident that the problem can be worked around by properly handling the out-of-band data on the $e stream array passed to stream_select, though.
 
user895378
I haven't experienced any problems using fclose though, so I'm not entirely sure the commenter at the manual 100% knows what he is talking about.
 
yeah, according to chris (ratchet guy) the shutdown makes sure TCP FIN or whatever is closed cleanly
but neither of us are on windows, and the windows system APIs tend to work differently
 
Yeh I have to say I've never experienced any problems with fclose(), I always thought _shutdown() was only really useful for half open
(which is not that useful anyway IMO)
 
user895378
For the record, I think core PHP developers purposefully trying to put a ceiling on how useful PHP can be is the dumbest behavior I've encountered in a while.
 
are you referring to the socket APIs lacking shitloads of features?
 
user895378
1:33 AM
lol, no, more @ircmaxell's frustration with Stas and others. But the lack of socket features is a PITA too :)
 
ok sure :)
yeah, in my experience they don't reject PRs for that kind of stuff, don't really work on it actively much either.
 
user895378
And now that I've looped stupid Rebecca Black's "Friday" from the starred youtube link several times I need to do some work.
 
2:06 AM
good night
 
 
1 hour later…
3:37 AM
Hi may i expect help regarding stackoverflow.com/questions/14264757/…
 
 
1 hour later…
4:53 AM
@PeeHaa ribeka black :P
 
5:23 AM
php scraping
I want to get the first column value from every row of table
data maybe in <a href="">xxx</a>
or xxx
how can i do this
any help on preg_match
 
5:38 AM
hi
anybody know how to set cookie path using stream_context_create
 
6:32 AM
@JinuJD are you using context for server?
I mean php stream socket server
 
7:02 AM
@JinuJD please do not ping individual users if you have a question. It's considered rude.
 
@Jinu, nobody cares about your question, go away.
 
please any one answer this
1
Q: Looking for plugins for activity live updates in widgets in elgg

MohanI need to a plugins for the widgets of live update of activity in my website.the activity depends upon the friend and groups latest updates. it's like a face book update live stream

 
7:21 AM
morning .. guys ...
 
Good day!
 
morning ....
guys anyone have any little project on php ... i have made project in asp and now my professor refuse to take it ..he told i must have to do in php and there is only tow day remaining to submit .. demo
 
@user1879104 :P
 
Hehe. Try find some example scripts on internet.
That will save you alot of time.
 
@Ladineko i have tried but only got script like .. login script , php capptcha , not a webstie i can submit
if anyone know any website where i can get .. please tell me .. and it must be only opensource ...
 
7:34 AM
Search the internet for example websites... or website templates in PHP. (Not styling templates)
 
no buddy, can't answer my question
 
@Mohan That's because its not a real question.
 
0
Q: Looking for plugins for activity live updates in widgets in elgg

MohanI need to a plugins for the widgets of live update of activity in my website.the activity depends upon the friend and groups latest updates. it's like a face book update live stream

re-read question its makes no sense
@Mohan shows no efforts ... you are just asking for code ... Stackvoerflow is not free code writing service ...
:7129243 yo.. have done ...
@user1879104 so have you got ...:P
 
@NullPointer no i am searching but havent got ... yet could you get me any .... i just need only working php project design ui doesnot matter ...
 
@user1879104 lol...
 
7:49 AM
@NullPointer Need help very badly. Can you please spare few minutes?
@all Anyone?
 
You don't have to ask whether someone is here or can help. Just tell us your problem. If anybody can and wants to help, they will.
 
Okay. My problem whenever there is a small string, I am able to get it from a database and store it in a variable. But when I have a very large string and after I encode it into json, it always shows me null. But it's not happening with strings of small lengths and even somewhat considerable large strings. I am unable to get whether there is a fault in a string that I get or the size that matters over here.
@NullPointer
@all
 
8:19 AM
@AnoopKumar It doesn't sound likely that the string length actually matters. Either way, we can't help you unless you show us some strings that aren't working. (I'm not saying that I can help you either way, I don't have much experience php+json, but otherwise others can't help you either)
 
8:29 AM
hi is there any drupalers put there ? I got a ?
opps out ther e
 
I need a php editor :superuser.com/q/532444/49579
 
@NullPointer k but i need simple plugins or idea how can make a this in code.......
 
8:44 AM
Hi
 
hi
 
I ha ve alittle question related to DateTime and MySQL :
I use almost everywhere \DateTime object in my PHP project
but how do I store them in MySQL
should I use DateTime or TIMESTAMP ?
I see that MySQL timestamp do some magic about TZ
 
@magnetik i would be using TIMESTAMP , but IIRC, in MySQL all the date formats are stored as something like string
 
In MySQL documentation :
"MySQL converts TIMESTAMP values from the current time zone to UTC for storage, and back from UTC to the current time zone for retrieval."
so if I set a timestamp with UTC+1 locale, and get it back with UTC+2 locale, I won't get the same date right?
 
@tereško TIMESTAMP is stored as an int (unix timestamp) but every other date/time related format is stored as a string. For some reason they have imposed some arbitrary limits on the range, so that the year must always be 4 digits and the first numeric in the year must be >0.
Mornings
Looked into this recently ^^
TIMESTAMP as a unix timestamp is SQL standard
Which for once MySQL have decided to follow in this case
 
8:56 AM
Yay just tested it out :
inserted '2013-01-01 12:00:00' in both TIMESTAMP and DATETIME fied with UTC+1 locale
changed locale to UTC+2
got '2013-01-01 13:00:00' for TIMESTAMP and '2013-01-01 12:00:00' for DATETIME
@Death I answered :)
 
9:11 AM
@magnetik Maj? which key is that?
 
humm Shift
 
@Jasper Yeah. I agree with you. Will show my string. It's the fault in the strings that I get from database and json is unable to encode them.
 
i've found quite a lot articles that says "TIMESTAMP SUX USE DATETIME", and as many saying the opposite :D
 
@magnetik Also you could replace Alt with <kbd>Alt</kbd> and similarly for the rest (purely for the looks). Your choice really :D
 
@ShyamK done, thanks :)
 
9:19 AM
pretty :D
 
@ShyamK How did you get an animated gif avatar to work? It's a good change, your old avatar looked like a mugshot from just after you'd been arrested :-P
 
but I wasn't arrested :P
 
@DaveRandom Can you please look at this? pastie.org/5666796
 
Hello
whats up.
 
It always gives me null @all
 
9:24 AM
@DaveRandom is my gravatar animated? I still see the mugshot. Maybe a refresh is in order... Any how there is a new upload image feature at your profile page... Uploaded a gif...
 
So, I scratched my head like anything while tracing out and finally found out that there are some special characters in that strings which I get from database. Because of that special characters , the json is unable to encode. Can some one please suggest me?
@all
 
@igorw +1 for requiring 5.4, something like React is really for quite advanced users anyway so I'm not sure you really need to worry about what ships with common distros, compiling is trivial for intermediate/advanced users. Having said that, what exactly are you proposing to do that wouldn't work in 5.3?
@ShyamK Yeah the bear dances :o
@AnoopKumar Output of the above script? I would expect {"details":[]} because you didn't push the string onto the $response array
 
@DaveRandom monkey... not bear :P Does it dance everywhere? Shaquin and Nullpointer where trying it out yesterday... It reverted to a png after a while...
 
@AnoopKumar the long string probably contains a non-UTF8 character, which will cause json_encode() to drop the entire string silently.
All input to json_encode() needs to be valid UTF-8
 
@AnoopKumar Ow wait I got that wrong, got the array_push() args mixed up. It actually doe seem to work
 
9:29 AM
@DaveRandom I pushed it
 
some people suggest not to use json_encode but an alternate implementation
 
@Pekka웃 Exactly
 
@andho Why?
 
If I replace the 41/2 it works. @DaveRandom
 
@DaveRandom lots of edge cases not covered in it
 
9:31 AM
Hello :) Can someone please tell me how can I run sql query when someone press html button
 
@andho Such as?
@AnoopKumar Well the input data is obviously not UTF-8 then. Please can you show echo implode(' ', str_split(bin2hex($str), 2)); generated from your computer in the same script where it fails to encode? It's likely the data was converted to unicode when you posted it on the internet.
 
@DaveRandom i'm not sure, it's something one of my previous colleagues mentioned. I mostly don't believe stuff he says though
is this non-utf8 thing part of JSON or just PHP's json_encode
 
@andho json.org
> A string is a sequence of zero or more Unicode characters, wrapped in double quotes, using backslash escapes
JSON standard
(Javascript standard as well)
 
@DaveRandom This is the output when I do that. {"details":[{"description":null}]}
 
9:40 AM
@andho There aren't that many edge cases in JSON, it's specifically designed to be as unambiguous as possible. There is an edge case incompatibility with Javascript though NikiC was talking about it the other day, I'll find the transcript link
 
@DaveRandom doesn't say utf-8, so utf-16 can be valid right
 
Can you show var_dump($response) when you get that result please? If there is a charset error I think the whole thing should fail, I could be wrong about that though. Could do with seeing a hex dump of the string generated from you machine as well (which is what the above bin2hex() line would do)
 
@DaveRandom @Pekka웃 When I remove that 1/2 , it absolutely works fine. This the output
 
Good morning guys
 
Hello, can someone please tell me how can I update table in my database when a HTML button is clicked?
 
9:43 AM
In this statement there is a 1/2 ---> Struts 2.0 (Java) 10.PHP Duration: 4 ½ to 6 Months
 
I'm using Git, but I'm the unique coding the project. Do you recommend me, using branches, or do you think I should code right on the master branch instead of merging them after?
The content of master branch is being pulled on a test server in a VM
 
@AnoopKumar Yeh it's that 1/2 char that's wrong, really need to see a hex dump of it to confirm but the answer is that it's not encoded as unicode. Where is the data coming from? A string literal in your script or a database or what?
 
@user1914940 you asked that 12 minutes ago already. it takes less than a minute to find a tutorial for that
 
@andho Indeed, although they are designed to be compatible, UTF-16 is just UTF-8 that uses shorts instead of chars. Sort of. A little more complex than that but in a nutshell that's the difference.
 
@DaveRandom That's what my problem is, If it is a string literal in my script, I could skip those, but it's coming from database.
Even I would show one more character that keeps bugging me like this 1/2.
 
9:46 AM
@AnoopKumar OK, so you need to make sure the table charset and the connection collation are both unicode an the problem should disappear. Either that or transliterate with iconv, but you can easily get the database to figure this out for you.
 
This is another character …
 
^^ read those
particularly the second one
 
Morning all :)
 
moening
 
9:50 AM
hello world
 
Has everyone Got Down? Please do not forget that you have Gotta Get Down On Friday.
 
Friday? Friday!? Gotta get down on Friday?
 
@DaveRandom I have no rights to change the designed database. My work is to only bring the data from the database, encode it to json and make this json object available in android. So that in the android side I am decoding this json object and displaying.
 
9 hours ago, by PeeHaa
 
Do you guys know any function that converts the string to utf-8 and later on I can encode that json.
?
 
9:55 AM
@AnoopKumar have you tried putting utf8 in the searchbox of php.net?
 
utf8_encode() ?
 
@AnoopKumar what character set are your tables and your DB connection in?
Chances are that if you set the right connection charset, you don't have to convert anything
 
2 days ago, by NikiC
@igorw There two unicode newline characters that you can use in JSON, but can't use in JS (in strings)
2 days ago, by NikiC
It's the U+2028 and U+2029 chars (the line and paragraph separators)
2 days ago, by NikiC
But in any case, in PHP one doesn't have to worry about stuff like this because PHP automatically encodes high-unicode chars ;) At least I think it does ^^
@Jimbo ...is a function that is almost useless. Use iconv() or mb_convert_encoding()
 
@DaveRandom Was just looking at docs now, seems to be mostly useless lol
 
buys sorry if i start a bounty on stack
then if no answer will be good, what will happen?
also what if i delete a question i posted with a bounty?
 
10:01 AM
@Pekka웃 character_set_database | latin1
 
*guys
 
hii all want to ask one thing
 
What has happened to Ubuntu lately? I mean, it's easier to move the task bar in Windows than it is to move the launcher in Ubuntu...
 
@Jasper more like impossible to move
 
@Jasper Windows has always been easier for a newbie to pick up and understand imho
I'm using Ubuntu now, of course
 
10:04 AM
but i don't mind it's position
 
because it provides killer keyboard navigation shortcuts
 
@andho Right. (I was being careful with my wording since you can replace it by something similar that can be moved)
 
@IvoPereira what does unique mean?
 
The only guy in the project :P
 
10:06 AM
@AnoopKumar set the right connection encoding and mySQL should convert the results for you automatically. stackoverflow.com/questions/279170/utf-8-all-the-way-through
 
@IvoPereira i guessed that but had to be sure right ? :P
 
@Jimbo I do administration on a terminal server with a couple of other people, so I wouldn't call myself a newbie, really :P
 
eheh, right :P
 
@IvoPereira merging is to make collaboration easier so no, you don't need to to any branching
 
10:07 AM
@Jasper Sorry I didn't mean to imply that you were a newbie, I meant just in general I've always found newbie's find it easier to use Windows at first (possibly because there are more Win32 users out there to help them, possibly not).
 
@IvoPereira but it would do you good to get the flow of branching and rebasing
 
exactly what I was thinking :) yup, still reading some stuff about merging vs rebasing
but yesterday i was on a PHP meeting, and I've met a lot of expert guys in the area, and we've spoken about this
 
@IvoPereira i would choose to do branching, it would be good to follow the git flow
@IvoPereira and?
 
@Jimbo I wasn't taking it as an insult, really, just saying that Windows wins it in an area that was traditionally not even a competition: customizability (sure very limited and specific cutomizability but still customizability)
 
Guys, which one would use more resources to generate a result? using methods like contains or regex to find out if a string contains a certain character
 
10:11 AM
@Pekka웃 I don't have any rights to play with database except getting the information what I should get the information from the database. So, do I need to concentrate on the Data Access: part in that answer?
 
@Jasper I agree, I was trying to put that exact point across, but failed miserably :P
 
And i kinda felt like crap. a lot of stuff i've never used and never saw how to work with them. from ssh stuff, to js libraries. i've never "felt" the need of it, but maybe as i've never tried them, that's why i guess :P
 
And I probably would be okey with the bar on the left if it wasn't for the fact that I am currently on a small screen due to two screens breaking down not too long ago. Ubuntu already seems less efficient about my space on this resolution and adding a rather thick launcher on the left doesn't exactly help...
 
@Jasper actually Linux won in customizability, it was just harder to do so.
 
@Jasper Ubuntu is awful. It's just awful. There's not a lot more to say about it.
 
10:11 AM
I installed Gnome-classic on the latest ubuntu, much prefer the top / bottom bars and no launcher
 
@IvoPereira yeah it's always to good to keep exploring new stuff, atleast in hobby projects
@Jimbo go with something like Mint
i'm thinking of switching soon
@Jimbo they have developed a fork of Gnome, i'm not sure 2 or 3
 
@Jimbo I recently installed xubuntu on an old laptop and I quite like it. It may be worth looking at.
 
Does anyone know if it is possible to grab a value from a valueble in jQuery and use it in PHP? Example : api.jquery.com/val The first demo
 
@andho the limited scope I meant was "easily moving the launcher/taskbar/dock". And the fact it loses there is a design choice. Sure, it wins the bigger picture of customizability, but that's just not enough I'd say
 
Yeah @andho :) do you have any kind of reference or some blogs or wtv that I could be up to?
 
10:15 AM
I'll probably start using it on my dev VM's
 
@Jasper what i'm saying is Unity came much later, but in Gnome 2 the panels were more customizable than what Windows currently have
@IvoPereira follow the major tech news and blogs
 
@andho Agreed
 
personally I have learned alot from Codeproject newsletter, but most of their articles are not PHP related @IvoPereira
 
They talk about what usually?
@andho
 
@Jimbo I do like the "launcher" in Windows and I do believe there is a reason that Windows (task bar), Mac OS (dock) and Ubuntu (Unity Launcher) have something that practically does the same thing
 
10:18 AM
@IvoPereira usually .NET if it's about programming. But lots of generic information is also available.
@Jasper yeah and what I like about unity is you can press/hold the Super key (windows/command key) and you will have numbers assigned from 1 to 9, which you can press to open the program indicated
the number appear in the unity launcher in the order they are placed. I haven't found this flexibility in any other Desktop
 
@Jasper Say if the Unity Launcher came almost empty, and then you could put what you want in it (like Mac OS X / Windows), that'd be good for customisability. But nope, they have to have a load of extra icons and launchers within launchers and things for Ubuntu, and half your applications in OS X...
 
@andho Windows does the same thing :P
 
@Jasper whoa really
never realised that
 
@Jimbo *italics*
 
@andho neither did I, but I just tried it out as you mentioned it :D
 
10:22 AM
hey can anyone here , help a little with PDF.js ?
 
cool
 
Thanks Dave
 
@Jimbo but you can just remove the things you don't like? I mean that may be about 30 seconds work once, so I don't really mind all that much
 
Yeah I suppose, I'm just finding things to complain about now :P
 
It's not hard with ubuntu
Ugh, I just took my jacket off and found I have a big fat baby vom down the back. My house is not a fun place to be at the moment, the cat has recently taken to crapping in the corner of the cellar as well.
 
10:27 AM
@DaveRandom This... isn't at work.. is it?
 
@Jimbo Yes.
 
@DaveRandom LOL!
 
Can someone please tell me whats wrong here:

<script type="text/javascript">
    $(document).ready(function() {
        $('#update').submit(function () {
   	 alert("testing");
});
</script>
 
You are missing a closing brace inside the function
No wait
 
10:28 AM
Ohh thanks :)
 
^^yeh that
Oh
lol
 
Undelete?
:/
 
You're missing a });
Man I think I'm just going to have a nap on my desk for a bit
 
@DaveRandom Might want to put your jacket back on ;)
 
Actually, for long and complicated reasons, we have a washer/dryer at work, it's already in there.
 
10:31 AM
@DaveRandom poor man lol.. and than switch of light ..
 
So the pseudo class :active for links is actually only "active" when you click(and hold) a link?
 
:-p :-p
 
@DaveRandom Ok, now I dont get error, but still doesnt work properly :( You maybe have a little bit of time to check my question?
 
@MarioS Doesn't it apply when you tab to it as well?
@user1914940 link?
 
10:35 AM
@user1914940 How does the above JS relate to that code?
 
@DaveRandom yes, but I'd like it in combination of the current page as opposed to when a user click it
I just applied it to the li element instead, works fine.
 
@DaveRandom Just to test if it works when button is pressed
 
@user1914940 ...and you don't see the alert?
 
@DaveRandom For some reason no :S
 
@user1914940 OK and the element with id="update", is that a <form> or the <input> from the question code?
 
10:38 AM
It is a button: <input type="button" name="update" value="Solve it" />
 
@AnoopKumar no need to play with the database to set the right connection character set - yup, the data access part is what I meant
 
@user1914940 Right well in that case you want .click() instead of .submit(). Only <form> elements have a submit event, which would fire when you click a <input type="submit">
 
@DaveRandom Oww, yes :) So something like this?

<script type="text/javascript">
    $(document).ready(function() {
        $('#update').click(function () {
   	 alert("testing");
});
</script>
 
@user1914940 does it have the id attribute?
 
@user1914940 Yes, but you missed a }); again ;-)
 
10:40 AM
@DaveRandom ahh sorry :)
 
Oh yeh, well spotted
@user1914940 you need to give the input an id="update" as well
 
Wait...how can it be missing }); when there are 2 functions inside?
 
(or change the selector so it's based on the name)
If you indent ir properly it's easy to see:
<script type="text/javascript">
    $(document).ready(function() {
        $('#update').click(function () {
   	    alert("testing");
        });
</script>
You didn't close the outer function
 
it looks like it's missing a leg
 
Sorry for that, but I dont get it..isnt alert function closed? Or.. :)
 
10:45 AM
<script type="text/javascript">
    $(document).ready(function() {
        $('#update').click(function () {
            alert("testing");
        });
    });
</script>
^^ see the difference?
 
@user1914940 open brackets must be closed... ready( and function() { are not closed.
 
Awww it's not animated any more :-(
weird
 
its like a one handed hug... not so warm and cozy
 
Ohh yes yes I see, my bad sorry
 
@user1914940 You still need to sort the element id out before it will work though
 
10:47 AM
@DaveRandom Ok yes, now it works, but only on the first one, others doesnt
 
Which others?
 
The other items, each item has solve it button next to it, and only for the first item it works
 
@DaveRandom ya... must be a png now... or it got that ?s=32 size thing...
 
@user1914940 OK well at a guess you've given them all the same id, in which case that is what will happen. You either need to give them all the different ids or (better) use e.g. class="solveit-button" and change the jq selector to .solveit-button. That does make finding the associated input (that I'm guessing it there?) a little more complex but it's definitely the best and DRYest way to do it.
 
@Pekka웃 Thank you very much. I am gonna check it. BTW I copied your word picture to my name ya. ;) Do you mind? If it has a copy right, let me know, I will remove it and suggest me another one ;)
 
10:52 AM
@DaveRandom Ohh sorry, before I move on from here...is this going to bee good for later when I need to select by ID? Right now I have a list of items, which is generated by a while loop. Each item has its own unique ID, and I want to make it when they press solve it button next to item, I want THAT item to be removed from that list.
 
@DaveRandom you happen to know where I need to look for "share this page" functionality for facebook? their docs don't mention it at all at first glance.
 
@DaveRandom pasting my user profile link still one-boxes the dancing version of it though... weird
 
@user1914940 Yes it's easily possible, there are a couple of ways to do it, all of them are minor changes implementationaly.
 
@DaveRandom Nice to hear that it is easily possible :) So I should now do the solveit-button thing?
 
keep seeing the "like" plugin they have.
 
10:54 AM
@user1914940 I would say so, yes. Otherwise you'll have to basically write the same code for each item
 
Hi guys
 
@MarioS I don't know FB at all. Also, plugin for what? I pretty much never use pre-made plugins, I implement APIs directly most of the time. However, I am an exceedingly dull human being so I'm not necessarily recommending that.
 
@DaveRandom Well, that wasnt too hard, just did what you told me and now it works on all buttons :)
 
@user1914940 The fun starts with tying them to the right inputs. Like I say it's not too hard but it might melt your brain a little at first. The way I look at it you have two decent options: either give both the button and the associated input an id that is based on the id from the database (remember they can't be the exact same id though) and get the other object using that, or you can traverse the DOM to the other object since it should always be in the same relative place.
Personally I'd probably go with the first option because it's a little less mind melting
DOM is powerful but the API is quite verbose.
Very little (native) sugar
 
@DaveRandom Great, thanks a lot for explaination :) Now I will TRY to make it run sql query now after button is pressed :)
 

« first day (818 days earlier)      last day (4116 days later) »