« first day (811 days earlier)      last day (4142 days later) » 

10:00 AM
Now it returns whatever I choose even items without Blue
 
user652649
this is not what you want?
 
No, I want to return only if they select item with prefix Blue, if they select anything else I want to do whatever is in else
 
user652649
return what, from where
 
from if statement. I want to echo blabla if they select item with Blue prefix, and I want to echo bleble if they select any other item
 
@Jimbo :)
 
user652649
10:03 AM
if(substr($dropBox2,0,4) === "Blue" && substr($dropBox2,0,6) !== "BlueRB")
{ echo "starts with Blue and does not start with BlueRB"; }
 
@PeeHaa I thought your quote needed captioning, lol
 
Yeah. The post really needed that
:D
 
@wes We have items in dropdown menu. Some items are Blue some are BlueRB and later on we might add more that start with Blue. Then we also have other items like car, watch and others that doesnt start with blue. Now I want to make it so that if they select item with prefix Blue, I want to echo 123, if they select any other item I want to echo 456
 
if (selected item prefix is blue) then echo 123
else echo 456
 
user652649
if(substr($dropBox2,0,4) === "Blue" && substr($dropBox2,0,6) !== "BlueRB")
{ echo "123"; }
else { echo "456"; }
 
10:07 AM
Well, this will need to be updated every time we add new items, I would like to make it with prefix Blue, not list each item
 
so items with BlueRB are not items that start with the prefix Blue?
@user1914940 no it will not
 
It is yes
@andho I was pointing at wes example
 
@user1914940 i know, explain why you will need to update every time with an example
 
user652649
hes trolling me. i surrender anyway
 
@wes super troll
 
10:09 AM
Because you have to name each item exact name not just by prefix
 
@user1914940 example
 
Well his code will echo 123 if item is "Blue" or "Bluerb", right?
 
@user1914940 that's not exact name, substring takes the first 4 characters, then those four characters are checked if it is "blue"
@user1914940 then he takes the first 6 characters and checks if it is bluerb
@user1914940 can't you see the substr function used there
 
Yeh but it doesnt works. My code now is: if(substr($dropBox2,0,4) === "Blue" ), and when I select item named Blue phone it doesnt works
 
@user1914940 AT the point you do that if statement, does $dropBox = "Blue phone" ?
 
user652649
10:14 AM
@user1914940 it is because $dropBox2 doesn't contain Blue phone
 
@wes
it does, I select it
 
user652649
@user1914940 maybe you are completely wrong with that?
 
@wes how?
 
user652649
var_dump($dropBox2);
 
user652649
and you will see
 
10:17 AM
NULL
 
user652649
lolol
 
What?
 
user652649
@user1914940 RTFM
 
I dont get it..
 
10:18 AM
@user1914940 Have you looked at the link I sent you?
 
yep
 
That proves that IF $dropBox does indeed contain "Blue Phone", that substr($dropBox,0,4) will always give you back "Blue"
 
Doesnt works for me, let me show you
 
@user1914940 Okay
 
if(substr($dropBox2,0,2) === "KD" ) {
echo '1223';
}else {
echo 'OTHER';
}

I select item named: KD life surfer and I get returned OTHER
 
user652649
10:21 AM
@Jimbo doesn't matter that code part because he said $dropBox2 = NULL;
 
That code gives "1223"
 
user652649
@Jimbo the problem is how he set $dropBox2 because his one is NULL
 
@user1914940 Can you show var_dump($dropbox2); please? IIRC it contains a database ID and not a string. You would need to SELECT Short FROM products WHERE Key = $dropbox2 and test the result row of that ;-)
 
@wes Ahh, okay
 
@DaveRandom var_dump($dropbox2); at the last line of my code = NULL
 
@user1914940 OK - so it sounds to me like you are trying to do this before the user submitted the form.
Which you cannot do.
Because you don't know which option the user selected until they select it ;-)
 
No no I do have

if(isset($_POST['submit'])) {
if(substr($dropBox2,0,2) === "KD" ) {
 
user652649
@PeeHaa i think it is a legit question
 
@user1914940 Right, where did you assign a value to $dropbox2?
 
@DaveRandom at the end
 
10:26 AM
@wes Agreed - it's badly asked but it is a legit question. I would be surprised if it's not a dupe though.
 
@wes It is, but it's a dupe
:)
 
@user1914940 Well you can't use the value of $dropbox2 until you assigned a value to it. There's actually no reason why you can't assign the value at the top of the page, you just need to check that the $_POST var was set first.
 
user652649
dupe for what reason?
 
@DaveRandom Ohh, now I know what it is...it is trying to compare "KD" with the value of item selected as we were talking...
 
@wes dupe as in duplicate :)
 
user652649
10:28 AM
@DaveRandom i think user19blablah is trolling us all
 
@wes just you
 
@user1914940 Yes I suspect that as well (see my comment about 20 lines up) but you will still need to assign the value before you run the above code as well
 
user652649
@user1914940 probably
 
6 mins ago, by DaveRandom
@user1914940 Can you show var_dump($dropbox2); please? IIRC it contains a database ID and not a string. You would need to SELECT Short FROM products WHERE Key = $dropbox2 and test the result row of that ;-)
 
@DaveRandom So I need to run that query?
 
10:30 AM
@user1914940 Or something like it, yes. But you will need to assign the value of the $dropbox2 before you run it. And don't forget to escape your user input!
 
They select an item, and after they submit form I do that
 
@user1914940 come back after assigning a value to $dropbox2
 
Yes but it matters in what order you do things. Can you show the current code on a pastebin?
 
@user1914940 :'( are you trying to learn programming, or are you trying to program something without learning?
 
user652649
10:38 AM
@user1914940 if you are not trolling us, you should change your learning method, because people is not here for teaching. search some php beginner tutorial, a php form tutorial
 
@wes Did that, Im just at beginning stages so I dont know everything and I have to program that kind of stuff
@wes watched thenewboston tuts
 
user652649
i don't know what newboston is, but seems that tuts didn't work for you
 
when i started learning php, there was a great tutorial site around. Nowadays it's hard to find a good tutorial.
@user1914940 do you know basic programming?
 
@user1914940 Please add var_dump($_REQUEST, $_POST); immediately above the line $dropBox1 = $_REQUEST['select1']; and show the output (after you submit the form) here
 
user652649
10:41 AM
the paypal official api's code is all in the global scope, using variable names like $url... paypal is pretty sure that no developer in the world will never ever use the $url var in the global scope
 
@andho That's very subjective. It's possible the "great tutorial site" you talk about is actually crap, it's just that you are only now capable of recognising that.
 
@DaveRandom are you saying i learned to program pretty good with a crap site. Sure they didn't teach best practice, and didn't mention security concerns in every tutorial.
 
array(10) { ["select1"]=> string(15) "account 2009-01" ["select2"]=> string(4) "5111" ["text1"]=> string(25) "Enter contract number" ["text2"]=> string(10) "0000009745" ["text"]=> string(3) "dfg"
 
61
Q: What's wrong with using $_REQUEST[]?

sprugmanI've seen a number of posts on here saying not to use the $_REQUEST variable. I usually don't, but sometimes it's convenient. What's wrong with it?

 
@Gordon wow this is a super answer
 
10:49 AM
@DaveRandom Is that correct? I mean...is that what you needed?
 
@andho It's possible. I know that some of the tuts I used when I was a lot greener are terrible.
 
@DaveRandom yeah, what i was actually saying was their tutorials were very comprehensive, specially the three part membership system tutorial. I had enough PHP knowledge to make a web site with a custom CMS with just that one tutorial.
 
@user1914940 It is indeed - you need to run something like the query above in between the $dropBox2 = $_REQUEST['select2']; line and the if statement, and test the value of the Short column instead of the $_POST value.
 
@DaveRandom but nowadays, i just can't find such comprehensive tutorials
 
user652649
10:52 AM
@andho because you are a pro! you should write tutorials!
 
user652649
xD
 
@wes i'm not so good with teaching hehe, not too patient either. and not pro in the sense of writing a tutorial
 
@andho That doesn't seem to stop a lot of people.
 
user652649
I mean... tutorials are not comprehensive because they probably talk about pro code, not beginners one
 
@DaveRandom Yeh but the problem is..its in different table
 
10:56 AM
i am new to jquery and i try to learn jquery from basic show i avoid to use plugin.i design simple input type text field and check whether for empty it work or not .it work fine but massage is showing for few seconds only.i don't know why?
 
@user1914940 Oh right because it's a contract number? Well you just need to use a JOIN in a similar way to the queries we worked through yesterday.
 
user1125394
@DaveRandom 'a lie' is actually 5 chars :p
 
@DaveRandom yeah, it's something that takes a lot of time. Atleast it should. Do all proper research, cover all bases. I write about what I'm passionate about. Being here does make me passionate about making tutorials :D
 
here the script
$(document).ready(function(){
//var msg=$("p").text("Are you sure?");
$("#form1").submit(function(){
if ($('#fname').val()=="") {
//$("#ms").show("slow");
$("p").html("Are you sure?").show();
//$(this).show("Are you sure?");
}
});
});
 
@cyril Yes but PHP knows that The Cake Is A Lie so it matches anyway :-P
 
10:57 AM
@AnkurSaxena goto javascript room please
but they will probably throw you away
 

JavaScript

Topic: Anything JavaScript, ECMAScript including Node, React, ...
 
@DaveRandom hahaha … people still confuse Java and JavaScript?!
 
@AnkurSaxena To answer your question though, you are not preventing the form from submitting, merely showing a message.
 
where i find solution of my problem sir.i am new to jquery
is $("#form1").submit(function() creates the problem \
 
@Gordon I suspect @rlemon's facetiousness there. The room description was "tits or gtfo" the other day, they change it quite a lot
Maybe there was an incident
 
11:00 AM
@AnkurSaxena in the javascript room maybe
 
@AnkurSaxena go to the JavaScript room please. This is the PHP room.
 
okey...............
thank you ..........
 
Hi all, quick question, what does -> do in PHP?
e.g. $O_tpl->loadTemplateFile('T_formServiceSalesman.tpl');
 
@AnkurSaxena You need to prevent the default action of the submission. Hint. But you really should move this question to Javascript.
 
@Fergal it does what . does in other languages
 
11:01 AM
@Fergal It is called the object operator. It is PHP's equivalent of . in Javascript and Java
And many other languages.
 
@DaveRandom hate it. hard to do dictation coding
 
It is used to access a member of an object instance
 
OK, thanks, I'm primarily a JavaScript debv
 
@andho dictation coding??
 
@DaveRandom Ok, so it looks like this?

$ra = mysql_query("SELECT product.Key, product.Short
FROM product
FULL JOIN Complaints
ON product.Short=Complaints.Key");
 
11:03 AM
"okay now type echo dollar user dash greater than name semi colon"
@DaveRandom yeah when peer programming
@DaveRandom or helping someone out
 
@andho lol
@user1914940 You probably want INNER JOIN, and I think you want product.Key=Complaints.Key if I remember your db schema correctly.
 
@DaveRandom a Complaints key doesnt have Key inside, just Short
 
as products name
 
@user1914940 Right... what is the 4111 value from the var_dump()? I product id or a complaint ID? In essence, from which table/column in the database did the value 4111 come in the first place?
 
user652649
11:11 AM
@DaveRandom i admire your patience
 
Greetings! I need to get content of https website which has username and password? How can I manage to send username and password automatically to get data?
 
@DaveRandom I think it is complaint ID...there are so many that Im not really sure but I think it is
 
^^ burn it before the rep-whores descend
@user1914940 OK well you can just SELECT Short FROM Complaints WHERE ComplaintID = $dropbox2 then
(where you change ComplaintID to whatever the PK of the Complaints table is)
 
@DanielsPitkevičs is the username and password required by a Basic Auth header?
or is it just a form that is posted
 
@DanielsPitkevičs http://user:pass@domain.com/path is the simplest way.
 
11:15 AM
@andho Basic auth
 
Goddamnit I like PHP when it works
 
@DaveRandom I am trying now. And script is still running, hope it will retrieve correct data.
 
@DaveRandom Ok got it up now, how can I compare now?
Or echo to see if it works or something :)
 
@Dave
@DaveRandom Yesterday You were helping me with FTPS protocol. It turns out it is just HTTPS with some kind of WebDAV extension :)
@DaveRandom Perfectly, this worked.
 
@user1914940 You should just be able to do the if (substr($str, 0, 4) == 'Blue') approach now
 
11:22 AM
@DaveRandom and also the most insecure :)
 
@MarioS Not very often then :-P
 
I just made some logic completely on my own(great victory) and it actually worked without any hiccups ^^
 
Ok, now it is like this and I always get same result no matter what I select:

$ra = mysql_query("SELECT product FROM complaints WHERE contract = $dropbox2");

if(isset($_POST['submit'])) {
if(substr($dropBox2,0,2) === "KD" ) {
echo '11';
}else {
echo 'OTHER22';
}
}
 
@Gordon Doesn't make much difference in PHP code does it? I mean you have to have the user and pass as string literals in the code somewhere, why does it matter how you inform the back-end procedures of them?
 
stackoverflow.com/a/14154915/727208 .. should have been a comment , has nothing to do with question
 
11:24 AM
you should consider this: if ($_SERVER['REQUEST_METHOD'] === 'POST') instead of isset
 
Ohh, and I get this error with this query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
 
@user1914940 Right, but you have to do mysql_fetch_*() and test the value you retrieved from the database. Running the query doesn't magically alter the $dropbox2 variable ;-) Also please escape the user input
@tereško Isn't it a CI autoload issue? Seems sensible if so. Although I say this knowing pretty much zero about how CI works.
 
@DaveRandom :O I get error from that query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
 
@user1914940 Change $dropbox2 to $dropBox2 (variable names are case sensitive)
 
I did, but its not that
 
11:28 AM
@user1914940 Copy first line. Syntax error is when you have something misspelled
 
About escape-ing user input @DaveRandom I kind of used a very forceful method, I basically made a function which throws the input in the htmlspecialchars and mysql_escape string and then return back to the script. I have a bit of difficulty with figuring out the logic when input has to be sanitized.
Any suggestions you could give me?
 
@DanielsPitkevičs This are my first lines of page:

<?php
if ($_SERVER['REMOTE_ADDR']!="ip here") {
exit("Under construction");
}
 
@user1914940 And the error was about syntax?
 
Yes..
 
@MarioS Yes. Firstly, don't do that. You should escape for the database when you need to use the string in a query. You should escape for HTML when you are outputting it into HTML. don't store escaped HTML in the database.
So you only ever call htmlspecialchars() when you are going to echo or print the result.
 
11:30 AM
@DaveRandom because they are send over the web in plaintext for everyone to sniff. And will show up in your browser history.
 
and you only ever call mysql_real_escape_string() when you are building an SQL query string
 
So my script is still vulnerable then?
 
@user1914940 And that is all your code? Paste it in pastebin.com and also error text.
 
@DanielsPitkevičs pastebin.com/SF3HCRAM
 
@Gordon Yes but in the above use case the URL scheme is HTTPS and the server requires Basic auth
 
11:30 AM
Error code: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
 
(although I take your point)
 
@DaveRandom it says http not https
 
@user1914940 Oh it is not even PHP error but SQL. Check Your SQL queries.
 
@Gordon Oh right yes sorry my example URL is http. But @DanielsPitkevičs' URL (the person who asked the question) is HTTPS.
 
@DaveRandom ah. ok :)
Random Fun Question: what is the favorite breed of dogs for computer science people?
BitBulls!!!1
 
11:32 AM
@DanielsPitkevičs Ok, if I remove Where contract = $dropBox2 it works :S
 
That was hilarious
 
@MarioS thanks
 
@user1914940 Try - WHERE contract = \"$dropBox2\"
 
was about to say that :P
 
O now it looks like works
 
11:33 AM
@user1914940 In SQL strings should be in quotes
 
What? That makes no sense. Are you sure it's not just and empty string?
@DanielsPitkevičs But it should be an int PK
 
@DanielsPitkevičs Got it, thanks .)
 
I had the same issue before @DaveRandom after I scaped the quotes it worked as well
 
@DaveRandom Really?
Oh then mby he is using singlu quotes in that string :)
 
@user1914940 You need to crank your error reporting right up to max - put ini_set('display_errors', 1); error_reporting(~0); at the top of your script, I think that will give some clues.
 
11:35 AM
Which means $dropBox2 is just a string not variable.
 
~0 ?
what does that do?
 
@user19149 Paste the whole sql query.
Whole line with PHP
 
@MarioS It's an integer where all bits are set. 99.9999% of the time ~0 === -1 but in theory it's possible for that not to be the case.
Force of habit
 
$ra = mysql_query("SELECT product FROMcomplaints WHERE contract = \"$dropBox2\"") or die(mysql_error());
 
hehe that's pretty clever
I use E_ALL
 
11:36 AM
Huh...First add space between FROM and complaints
contract is supposed to be an integer or string?
 
@MarioS Again, force of habit from when E_STRICT was not part of E_ALL
 
Ohh sorry, there is space. contract is number
 
I see
 
And do not use mysql_* functions.
$ra = mysql_query('SELECT product FROM complaints WHERE contract = '.$dropBox2.') or die (mysql_error());
This works or not?
 
hmmm I use single quotes in the where clause. i.e WHERE contact = '1'
 
11:39 AM
And Im going to smoke :) 5min break
 
@DanielsPitkevičs You have a stray .' on the end ;-)
 
@DanielsPitkevičs Yes it works
 
@DaveRandom Oh, ok :D
 
@user1914940 I suggest you work with mysqli or pdo
 
Baby steps guys...
 
11:41 AM
I don't agree
Teach this your self as early as you can.
 
Ok, but now it doesnt show when I try to print it...

$ra = mysql_query("SELECT product FROM complaints WHERE contract = \"$dropBox2\"") or die(mysql_error());
$array = mysql_fetch_assoc($ra);

Print "<b>Name:</b> ".$array['product'];
 
there is a . infront of your array
remove it
 
Well that means to add it to string
 
@MarioS That I agree with, but I also think that once you've started down a road it's hard to go back. If you have an absolute beginner who's never written a line in their life that sure but when you have someone who's half learned it I think it's better to just leave it be until some of the basic concepts have sunk in. Either way an absolute beginner is not going to be using prepared statements, so better to just teach proper escaping - and ext/mysql is perfectly good for that.
@user1914940 Have you turned error reporting on? I suspect you will find that the query returns no rows. The real problem here is that $dropBox2 does not contain what you need it to before the query I suspect.
 
11:46 AM
Might be a good idea to post your whole script.
 
My head is just gonna go boom
Everything is wrong and... -.-
 
Calm down, re-read your script, and dump some vars to check if they contain stuff. Recheck if you can pull date from your db, etc etc.
retrace your steps ;)
 
@user1914940 Yeah, chill. @MarioS is saying good things :)
 
OMG the default AD layout in SBS2011 is even more stupid than it was in 2003/2008. Why do people buy SBS? I really just do not understand. It hardly makes anything any easier and it make a lot of things a lot harder.
I am sorely tempted to just put a dodgy copy of 2008R2 on this box and be done with it.
 
Ok, will try I am really at the end with nerves right now, thanks everyone so much for help for now will go on air for 10min
 
11:54 AM
morning
 
@PLB yeh, sure, the shared host block set_time_limit() but they'll definitely have an experimental extension that provides a feature that makes it even easier to do stupid things that grind the server to a halt :-P — DaveRandom 36 secs ago
@NikiC Mornings
I have been wanting threading PHP for ages but I am now starting to dread the inevitable influx of people asking why their server doesn't work very well when they have code that spins up a thread for every little subroutine.
"You want me to query the database? Well, I'd better do that in a separate thread, it might take a while. Oh we need to read some data from a file as well? Well that clearly needs its own thread."
 
@DaveRandom PHP still doesn't have threads, so the average shared-hosting user will not be able to use them
The ones who are able to install pthreads for example should also be the ones you aren't complete newbies
 
@NikiC You have a level of faith in the community that I do not. All it takes is one dickhead to write an idiots guide to setting it up while singing the praises of parallel programming and kaboom.
 
Ok I am back got a bit of air.. so here is my code:

$ra = mysql_query("SELECT product FROM complaints WHERE productNumber = \"$dropBox2\"") or die(mysql_error());
$array = mysql_fetch_assoc($ra);

echo '<br />'.$dropBox2.'<br />';
echo "<b>Name:</b>".$array['product'];

But when I enter this code in my sql I get products name back:
"SELECT product FROM complaints WHERE productNumber =4011
 
@DaveRandom you mean making php webscale?!`?!
 
12:04 PM
@user1914940 OK, and what is the value of the column product for the row with productNumber = 4011 if you inspect the database?
 
@NikiC Damn straight mofo. I might write some mongo hooks that only work when being run as a thread.
@MadaraUchiha Sup dawg
 
@DaveRandom It is the name of the product (KD life surf)
 
@user1914940 And what is the output of the above code?
 
Nothing, just Name:
 
12:07 PM
@DaveRandom Found something that might interest you an @PeeHaa coding.smashingmagazine.com/2013/01/03/…
 
@DaveRandom That's actually a cool idea
We can tell people that with threads PHP is webscale
And the same people who think Node.JS is webscale because it doesn't use threads will believe that :P
 
@user1914940 OK well that means that $dropBox2 has no value, so the query is actually "SELECT product FROM complaints WHERE productNumber = \"$dropBox2\""
 
evil plan
 
Sorry to keep harping on about this but please turn error reporting on (!!!)
 
I did put ini_set('display_errors', 1); error_reporting(~0); at the top of page
 
12:08 PM
@NikiC Muahahahahaha!!1
@user1914940 And you get no error messages output at all anywhere on the page?
 
Nope, nothing
 
...right. What do you get if you var_dump($dropBox2); (exact output)?
 
Before I submit form I get NULL, after I get string(4) "0203"
 
@user1914940 OK well where did the 0203 come from? It presumably came from somewhere in the database, you need to work out what it relates to, and more to the point how it relates to the string that you want to compare with
 
Ohhh yes I get it huh...it will only get names from table complaints, not from table products, now it is working when I select the product that I manually put into complaints, but not on any other
 
12:14 PM
@MadaraUchiha that is nice
 
E_HEAD_EXPLODED
I'm out for a little while, my brain is no longer working.
 
@DaveRandom later
 
Where is the problem. I could open https link with file_get_contents from my windows machine. Now uploaded script to server (FreeBSD) and error: failed to open stream. What the hell...
 
Ok, got a little bit further now :)
 
self duplicator
@DaveRandom off .... you are addicted of stackvoerflow ..:P
 
12:28 PM
I'm playing with desktop notifications for so it's kind of in my face
@DanielsPitkevičs That error message has another sentence after failed to open stream which tells you why it failed. Care to share it?
 
pffffff. stackoverflow.com/questions/14156421/… delete is the new accept now?
 
@NullPointer please link to the question, not any specific answer in your MySQL comment
 
@MadaraUchiha yo ill care to link
sorry ill link ..
 
@MadaraUchiha here yo go ...done
 
12:34 PM
@Gordon Didn't you know? Words where levenshtein($word1, $word2) < max(strlen($word1), strlen($word2)) are the same word. I thought everyone got the email.
 
@DaveRandom Yeah, I understood that it cant reach needed address. But still, on Windows everything was going well, on FreeBSD not. Although, I found out that openssl was not installed on that server so now trying on another :)
 
@NullPointer ty
 
@MadaraUchiha ty means ?
 
@NullPointer Thank You
 
12:37 PM
@MadaraUchiha yours very welcome ..
 
@NullPointer yw :)
 
Halal... Is it meat you're looking for
6
 
guys, i have a short question
if two clients run a same script at a exact time
does server run script asynchronously?
or one gets to run first and other one follows?
 
@TemporaryNickName You realize that's likely to never happen right?
 
@TemporaryNickName If they are two separate clients, then for any sane web server (and even some of the insane ones) the answer is yes. However if they are the same client calling the same page twice and you are using the sessions, the answer might be no.
 
12:40 PM
@MadaraUchiha nope =)
 
and its worse so sister site movies.stackexchange.com
 
@TemporaryNickName Even if both clients click a link at the exact same time, the requests won't reach the server at the same time.
 
its like proving nonsense with madness of mind
 
@MadaraUchiha Although it is conceivable, and there is a much higher chance that request 2 will start before request 1 completes
 
@DaveRandom Hey, I have gotten some progress, now I get a full name of item not just its value, now I can compare strpos, right?
 
12:44 PM
@DaveRandom Define "2" and "1"?
 
To be fair, a lot of the time the web server's socket acceptor will be in a single thread, so even if both SYN packets are delivered in succession one will still be processed first. Come to that, it's not actually possible for both SYNs to be delivered at the exact same moment because that's not how frame based DLLPs work.
@user1914940 Yes, but I'd recommend the substr() approach instead. strpos() looks for Blue anywhere in the string, you explicitly want to check that it is at the beginning.
 
Happy new year guys
 
strpos() could give false positives unless you do === 0
@Sommer Right back at ya :-)
@MadaraUchiha Arbitrary identifiers. You are dealing with 2 requests, just to distinguish between them.
 
@DaveRandom Sorry, how do you mean substr with string?
 
@user1914940 As in substr($str, 0, 4) === 'Blue'
 
12:51 PM
Ohh thanks, let me try :)
Can I do that directly below array? Like this:

$ra = mysql_query("SELECT Short FROM product WHERE Key = \"$dropBox2\"") or die(mysql_error());
$array = mysql_fetch_assoc($ra);

echo '<br />'.$dropBox2.'<br />';
echo "<b>Name:</b>".$array['Short'];

if(isset($_POST['submit'])) {
if( substr($str, 0,2) === 'KD' ) {
echo '1111';
}else {
echo 'OTHER22';
}
}
 
if( substr($array['Short'], 0,2) === 'KD' ) {
 
@user1914940
 
@user1914940
 
posted on January 04, 2013 by Brandon Savage

Next week, I’ll be sending out a special series called Five Tips For Developing Awesome Software. This series will be sent out daily via email to list subscribers, and will include five things I’ve learned that will help boost your software development skills. Why am I making you sign up for the tips? Because improving [...]

 
What did you send that? I only see blank page
 
12:55 PM
lol
 
@Feeds shut the feed up ...
 
@user1914940 Please press the button when pasting code
 
@MadaraUchiha aha I see, sorry
 
I hate that Feeds guy. He thinks he's so bloody clever and on the ball. Well how come you never seem to know about ircmaxell's posts before us? Huh? Answer me that!
3
 
Please, don't use mysql_* functions in new code. They are no longer maintained and are officially deprecated. See the red box? Learn about prepared statements instead, and use PDO or MySQLi - this article will help you decide which. If you choose PDO, here is a good tutorial. This would also get rid of that nasty SQL injection vulnerability. — PeeHaa 2 days ago
 
12:57 PM
Or NikiC's
 
@DaveRandom Hmm, but as what?
 

« first day (811 days earlier)      last day (4142 days later) »