« first day (424 days earlier)      last day (4515 days later) » 

Hi
Does anyone have a good guide to using mod rewrite?
I want to do somthing like this, /add.php to /add/
 
did you try google ?
additionally , this is completely unrelated to PHP
 
yeah the example i found that i could understand only removed ?id=111
 
@StephenWolfe I'd suggest /add without the trailing slash, fyi.
personal preference
Trailing slashes seem to imply a directory.
 
yea but i still cant work out how to remover the .php
 
6:23 PM
@StephenWolfe Could you paste your relevant rewrite rules?
 
by the way, does anybody have a pdf of clean code lying around? I'd like to read that
 
No, I have a copy sitting next to me on my shelf though
 
@tereško whoa
 
@NikiC I just have Code Complete in paper. Haven't read Clean Code yet.
 
6:27 PM
this is as far as i have got
RewriteRule ^/?add\.php$ add-lead.php [L]
 
@StephenWolfe remove the first slash ^add\.php$ add-lead.php [L]
But are you sure you want add.php to redirect silently to add-lead.php?
 
@LeviMorrison i just want to removed the .php from the add-lead.php
 
@Neal this is a test of the emergency alert system.
@Donut!
 
@StephenWolfe So you want the url /add-lead to use the page /add.php?
 
I mean @Robik!
 
6:35 PM
yea
 
Hi @Neal
 
@StephenWolfe RewriteRule ^add-lead$ add.php [L]
 
@LeviMorrison ahh i had that before, i have just noticed that it works if i just tap it in, i was exspecting it to redirect
is there a way to make add-lead.php to redirect as well?
 
@StephenWolfe RewriteRule ^add-lead(\.php)?$ add.php [L]
the ? makes it the preceding thing optional, in this case, the parenthesis group.
 
@l
@LeviMorrison I want it to force the change on the url
So for example if someone clicks a link on my site saying. add-lead.php it changed the URL to /add
 
6:51 PM
@StephenWolfe What file should /add use to generate the page?
 
add-lead.php
if i type in the URL www.mydomain.com/add-lead.php i want to to redirec to www.mydomain.com/add
i can get to load the page by typing in www.mydomain.com/add
just cant get it to redirect
 
@StephenWolfe You can't have add-lead.php redirect to /add, which redirects silently to add-lead.php. It's recursive.
It's an infinite loop.
 
admmit
damit*
so does that mean i have to change all the links on my site?
to not use the real file names
 
@StephenWolfe Pretty much. There are other means, but . . . they aren't pretty either.
That's why site construction and url abstraction are so important.
 
what do u mean?
 
7:00 PM
Well, you could move everything in your website up a directory. So /add-lead.php becomes /dir/add-lead.php. You then have a rewrite rule for /add-lead.php to become /add, and then /add silently uses /dir/add-lead.php.
 
ahh so nothing is in site route and no one can access the pages anyother way?
 
But I'd say that's abuse.
Well
They could still go to /dir/add-lead.php. It would show up still.
 
basicaly i have pages with lots of GETS and i want to clean them up
 
If I were you, I'd create a url scheme for your whole site, and then go through the pain of fixing all of it.
It will break things. It will mess up Google PageRank. But it will be better for future changes.
 
The site isnt going to be live, its a intranet thing i built
localhost/cashaccess/crm/search-list.php?page=1
thats like the pages i have
 
7:04 PM
Well then, no worries. Fix it, lol.
 
i would like to clean that up to localhost/crm/search-list/page/1
 
@StephenWolfe Does search-list take anything as a parameter besides page?
Btw, search queries are fine to be queries.
 
lots
its like this
crm/report-by-date.php?page=1&status=2&product=&company=&date_from=01-12-2011&date_to=14-12-2011&closer=&filter=Filter#?id=1
see why i would like to clean it up
 
I'd recommend localhost/crm/search?querystuff or localhost/crm/search/?querystuff
 
u have lost me,
oh i see
 
7:07 PM
You shouldn't be getting rid of the parameters in this case
You really are doing a search
But hiding the file that does the searching is fine.
 
Don't try to "clean up" your get; look at the urls a google search can generate...
it's best to keep all that info in get so a search can be bookmarked. There's nothing dirty about parameters not being legible, they only need to be legible to the dev. The only potential concern is exceeding max character length of a url if you keep on making the url larger and larger.
 
user1385191
you have to admit that sites like amazon and google have massively bloated query strings
 
I can't tell if you're agreeing that because Amazon does it, it's okay, or you're saying that it's "bloated" and therefore not ok.
 
user1385191
latter
 
Yeah, but that's kind of like looking under the hood of a car and saying "eww there's no leather upholstery in here"
URLs are for the browser, they aren't meant to be pretty, that's what the page title (or page itself) is. They are meant to communicate with the webserver.
I'm sure Amazon thought its policy out well.
 
user1385191
7:23 PM
it's just annoying to copy+paste a google link with a query string 200+ characters long
 
That's true. It'd be cool if they had a way to auto-bit.ly their url maybe.
Maybe a browser plugin by bit.ly that automatically would bit.ly the current URL and copy it to your clipboard when you click a button.
 
well, i think non of my users will be "book marking" or copying urls, i just didnt want some users to know how to inject strings in to my gets
then again i have a some protection from my str_replace, and remove /
 
@StephenWolfe str_replace is not really protection
Use mysqli or PDO and use parameters.
 
moving something out of GET is not any safer. If it comes from the client it comes from the client and is not safe.
 
lol
for checking for php injection, someone told me i could run a query then check it again? is this right?
and compare the results?
 
7:29 PM
you mean sql injection?
 
Listen to Levi Morrison. Lookup something called "PDO" and parameterized queries.
Makes SQL injection impossible. I was just tested on this in a job interview yesterday.
 
Since @ircmaxell doesn't seem to be here right now, he seems to prefer to use mysqli (hope I'm not putting words in his mouth). Personally, I like PDO, but I think you should look into both.
 
Im just reading up now one sec
so whats to stop users still being able to submit injection querys?
I think im going to read this tomorrow when i have more time,
 
7:46 PM
basically, it's a solution from the ground up built entirely TO make injection impossible.
 
@StephenWolfe In PDO: SELECT * FROM users WHERE id = :id When you use a parameter, you have to bind it. The libraries do the safety stuff for you that way. In mysqli, you'd use SELECT * FROM users WHERE id = ?
 
The parameters and the query aren't even combined UNTIL they reach the server. The server puts it together in a un-injectable way.
 
so what if the value of :id = or 0=0
u know the usual
 
@MattMcDonald What's you point?
 
user1385191
7:51 PM
those are his thoughts on the subject
 
@MattMcDonald What I meant is that I've heard him advocate mysqli over PDO.
 
8:16 PM
oh dudue IRCmaxell is apparently quite smart
 
8:46 PM
Someone here quick sql help?
Im trying to make a query where time() is between date_start and date_end
i tried:
date_start > CURRENT_TIMESTAMP AND date_end < CURRENT_TIMESTAMP
Dont work out
 
use between
look it up
 
i tried
WHERE time() between date_start AND date_end
but time() turns out like a real timestamp and it says unknown column
 
try WHERE CURRENT_TIMESTAMP() BETWEEN date_start AND date_end
It has a note on dates and such. Suggests using cast.
 
Still nothing
current_timestamp() got red, so i used current_timestamp, still nothing
 
@LeviMorrison yes, that's right, but we have an office christmas party now, so won't be here anymore
 
8:55 PM
hoy guys. is there a room for CodeIgniter, or too few people are using it?
 
@Vlad I don't think there are enough people using SO chat to get a good sized room for that specific a topic.
 
@CharlesSprayberry thanks
 
anyone used dtrace?
 
-4
Q: Upgrading RAM in Laptop

user1098692i have a HP Laptop G62.Its RAM is 2 GB.on the Manual it is read that I can upgrade it to 4 GB.I have a question what If I install 6 GB or 8GB in my Laptop?what would be the cons and Pros?Is it Ok?

 
@NikiC I haven't used dtrace. I just heard of it. . . just now.
@CharlesSprayberry That should have been moved to superuser probably, not just closed
 
9:02 PM
@LeviMorrison Fair enough.
 
@LeviMorrison ^^ c sucks. with php everything is so easy. If you want to debug c code you need fifteen different hard to use command line tools :(
 
Are you kidding? @NikiC
 
@NikiC I just use valgrind and ddd.
 
I wish I could step through my PHP 1/5th as easily in xdebug PHP as I can step through C++ with Visual Studio...
 
@Anfurny Oh, I'm using Linux right now ;)
@LeviMorrison yeah, valgrind massif didn't help much. now trying dtrace
 
9:06 PM
Hmm, can't help you there.
 
@NikiC you need to learn C bending to make it do your will.
 
9:30 PM
night
 
hi all
 
@LondonBoy Hello.
 
I code in D♭. It's the same is C#, but not as mainstream.
 
@stevether lol
 
For those who don't get it.
 
9:43 PM
Wow you really invested in that joke
 
@stevether hello levi how you doing?
 
Who's levi?
 
@LondonBoy Quite well. I've discovered that PHP's DomDocument and HTML Tidy do not play nicely with each other.
You have to find the exact configurations to get it to work.
 
i have a problem with php coding i hope someone can give me an idea on it?
 
9:52 PM
@Anfurny Get Eclipse / ZendStudio. It's really easy.
 
@LondonBoy Perhaps.
 
To set up xdebug on Netbeans isn't half bad either, you just have to dig up the tutorial first.
 
@LondonBoy Don't ask whether someone is here or can help. Just tell us your problem. If anybody can and wants to help, they will.
 
That said, C/C++/PHP debugging sucks really bad.
Want some good debugging experience? Get it wih Delphi.
 
@ChristianSciberras Well when I used xDebug it was with eclipse and really it was the eclipse part that bothered me... slow... missing breakpoints, occasional eclipse crashes
 
9:54 PM
Hell, there's a reason why Delphi people love debugging. Some even call it the "play garden"
@Anfurny Blame Java :D
 
Visual basic and c# have outstanding debugging
 
The only thing I couldn't get to work is the watch panel in netbeans. Ah well.
@Anfurny Designed over Delphi ;)
 
e.g. changing source code during execution.
 
The only thing better is perhaps javascript console (firebug/f12/devtools/whatever).
 
Eh, I totally disagree
 
9:57 PM
@Anfurny Hey, I didn't say the console works better as a debugger.
 
Then better as what?
 
im trying to do the following: i have a set of numbers for example 8 6 5 4 7 4 and i stored this in a table each with its own column e.g no1=8, no6=2 no6=5 ... i retrieve these numbers and compare it with a number that i set e.g. 8 3 4 4 8. if any of the numbers is equal to the one of the numbers that is set i need to count sum for it
 
It's just one of the best tools in web world.
 
array_intersect? @LondonBoy
 
I couldn't get much headway in debugging using browser tools. Except MS's windows script debugger. 'T was great back then.
 
9:58 PM
MS imho definitely has the best JS debugger setup
and it's great, especially for a free product, but there are things that one could still ask for.
 
@LondonBoy Are you wanting to get the sum for all of the numbers listed or only one number?
 
For example, debugging AJAX requests could be 75% easier if somebody designed a nice solution.
 
charles i need sum for each number
 
@Anfurny That's the thing with MS. The write a geniune innovative product, only to deploy it half-working.
Apple on the other hand...
 
Does apple have a superior JS debugger?
 
10:03 PM
No, I was talking in general.
In general, I quite dislike Apple and it's fanbase attitude.
 
@LondonBoy What exactly are you attempting to sum?
 
And I'm not saying the MS product doesn't work. What I'm saying is, because it's not commercial it doesn't have extra bells and whistles you get with their other commercial products.
 
But it does have several commendable qualities (sadly, perhaps...)
 
The Webkit JS tools are superior than Firefox imo
 
@CharlesSprayberry I found the Firebug was much UI-user-friendly.
Sadly, it got crippled a bit in each release.
Till I got fed up with it and firefox in general. Today I'm mostly on chrome.
It's fast, lean and works like a charm.
 
10:04 PM
I use Chrome the majority of time as well
Of course that's Webkit :)
 
Firefox (imho) is bloated, slow, memory-consuming and crashes more than IE6 did.
 
Still IE to debug, which is kind of funny, because I use chrome for everything else. I only pop up IE to debug javascript.
 
True.
Some hard JS bugs I only fix thanks to IE
IE 9's one huge welcome improvement despite sceptics.
 
@ChristianSciberras I disagree.
 
I don't want a bloody bleeding edge browser, I want one that works.
 
10:06 PM
From what I've seen of IE9 it is a huge improvement. The problem with IE has always been getting users to upgrade
 
i will try to explain more clearly.
I have an mysql table:
no1|no2|no3|no4|no5
1 3 5 2 6
4 7 8 9 8
2 6 9 1 0

and i have set number i.e 8, 8, 2, 6 i have to compare this to each row in the table and get sums for each number
 
@ChristianSciberras I agree on everything but the crashing more than IE6.
 
Yeah, IE is finally shaping up, but only because of the competition forcing it to.
 
@CharlesSprayberry Way true.
@Anfurny That's typical of companies you know.
I mean, it's not actually really new.
 
Yes.
 
10:07 PM
IE6 at it's time was a huge breakthrough.
Did you know that contentEditable happened thanks to IE6?
 
But Chrome has always had the edge on security in my mind, which is my #1 concern.
 
Now some very intelligent people are calling it an HTML5 blessing :D
@Anfurny Doubtful actually.
 
Oh? @ChristianSciberras
 
IE's security is quite advanced you know. Problem is that it's been highly targeted.
 
@LondonBoy You want to go through each row and column in your database table and sum together any numbers that you set?
 
10:09 PM
IE is advanced too, I'm sure, but I've never heard that it's more advanced.
 
I'm not saying everyone should jump to IE "because it is secure".
I'm saying that modern security standards have been set by IE.
 
and if nothing else, Chrome withstood the last pwn2own unlike IE
(granted with last minute patches in each case)
 
The concept of zones, for instance, has been in IE since 4 or 5? Safari, even today, doesn't have it.
@Anfurny Again, it's the targeting issue.
 
I don't think so.
 
See, when they actually targeted chrome, they found a hole in about 2 hours.
 
10:11 PM
Source?
 
sure, 1 sec.
 
Pwn2Own had separate divisions where any researcher had months to find holes in browsers and the winner would get like 20k or something
 
didn't find it, sorry.
but on the other hand...
 
i will try to explain more clearly.
I have an mysql table:
no1|no2|no3|no4|no5
1 3 5 2 6
4 7 8 9 8
2 6 9 1 0

and i have set number i.e 8, 8, 2, 6 i have to compare this to each row in the table and get sums for each number
so in first row i should get sum for 8=0, sum for 2 =1 and sum for 6=1
 
@LondonBoy I would refer to this as a count. You aren't really adding the numbers together so much as you are counting their occurences
 
10:15 PM
Okay, I'm not saying Chrome cannot be hacked.
It's just my experience that there are proportionally fewer holes found in it than other browsers in a given amount of time.
 
@Anfurny Yeah, we'll leave that to firefox fans :D
 
And I think chrome sandboxes its plugins or something, and I'm not sure about other browsers.
Obviously I'm not super-well informed here, and if anybody knows of a source that is I'd like to learn a little more.
 
Google's been running a lot of private hacking contests.
Which is why we don't hear them more often.
What would you choose, $500-$2k or a post saying you got the better of the browser?
 
But even so, if they are the one to find and fix the hole, and not some russian hacker, that's still important security wise
 
Well, the hacker community seem to love bashing ms for some reason :D
 
10:18 PM
It's an easy target.
 
there was this article I read once about browser security measures
Can't find it again.
The point was that msie had the most security measures.
doesn't mean they had the least bugs.
I remember that msie was the first to introduce anti-xss engine.
regarding sandboxing, all browsers do it (opera, msie, firefox) except maybe safari.
safari is slowly getting worse imho.
 
@CharlesSprayberry any idea how i could implement that?
 
And of course there's the new highly controversial paid-for-by-google report zdnet.com/blog/security/…
 
the graph is moot I can tell
URL blacklisting is done on all of them
in fact, they even share the same service
modern versions of firefox does sandboxing (badly imho)
 
10:26 PM
plug-in security, I'm not really sure what that is, but people usually don't check if the plugin needs access to their entire history or not. People should be concerned with regular plugin security norms.
But it's a nice addition of course :D
 
well there's a link to a full like 100 page review
that's just zdnet's 1-page summary
 
When I read the 2nd graph, I thought about the same thing
Can't believe IE had less vulns than chrome
All in all, I still prefer chrome.
But I'm not concerned with either browser's security to be honest.
 
@CharlesSprayberry thank you charles i will have a look at it
 
One of the key aspects for why I like chrome is that it gives me the most screen real estate. Toolbar up top and status bar down below are either minimal or removed altogether. I like seeing more stuff.
 
on a pc I'm perfectly happy with IE9. Chrome would make happiness one notch higher :D
 
10:31 PM
Man security is my #1 concern.
 
@CharlesSprayberry Haven't you seen IE9? it's quite lean
 
I'm pretty sure browsers are like the #1 attack vector now.
Or browser plugins.
 
@ChristianSciberras I don't have immediate access to a Windows machine. My exposure to IE is limited
 
@CharlesSprayberry IE9's leaner than Chrome, just checked now :D
it's like 32 pixels less
what they did is that they put the address bar next to the tabs
[<B] [F>] [Addr] [Tab1] [Tab2] [TabN]
 
@CharlesSprayberry I have similar code which gives total for all rows but instead im trying to get a count for each row. thanks anyway and sorry for bothering
 
10:34 PM
@Anfurny I'm not really active on the web. So unless sites I visit most often (google/gmail/so/...) get hacked, I won't be in any trouble. Plus, I don't visit pr0n sites, like most people :P.
 
@LondonBoy If you are trying to get a count for each row then simply remove the outer loop
Consolidate the loops to count the values into a method
Pass each row to the method separately. viola, you have a count for each row
 
Also, if you want great security measures, don't bother with browser security and use a VM like I do.
In the 8 or so years I've been using PCs, I never got hacked once (virus infections count as well). Pretty sweet eh? :P
 
Even news sites will sometimes allow 3rd party "ads" that actually are hidden exploits..
 
@Anfurny True, but they get stopped on the way. ;)
 
As for VM, that's a good security idea, though I'm too lazy to do it. as my main browser.
 
10:37 PM
@Anfurny VirtualBox. Can't get any better.
Fast, light, clean, supportive. You can't ask for more.
Then it's got seamless mode. I can have hacked IE6 browser windows running all over my 64bit Win7 desktop :D
 
Heh, yes I can. I can ask for a virtual box that will automatically startup from a read-only machine in under 4 seconds with an open browser window.
 
(I play around with malware form time to time, on my vms).
uhm, do a regular hibernate?
not 4 seconds, but it ain't really much worse.
 
because just running in VM doesn't assure adequate security. Sure my desktop may not be hacked. but if my VM is hacked and I use my VM to login to my bank, they can still get my bank password and transfer my money overseas.
 
keep different VMs, no?
I use my main environment as the most trusted, so I do banking through it
 
That, or have the VM reboot from a read-only image.
 
10:41 PM
it ain't hard to get it with a custom linux build.
There's use the light host OSes
 
I believe it can all be done... it's just not convenient enough for me yet.
 
They're barebones OSes used to boot up a VM.
Many servers do this actually.
 
I want it to be nearly seamless.
 
VMWare has it's own product line.
While security is a huge concern, I'm confident that with the right methods, it's much harder to get hacked today than before.
I also just realized I'm a very lucky person.
 
It's harder for an expert to get hacked perhaps. But way harder to detect when he does.
And of course much easier for a noob to get hacked.
You can buy commercial exploit kits for around $3k, buy some add space, and start a botnet with a rootkit you bought or stole too.
 
10:44 PM
I'm typing this stuff while running a couple of VMs as well as coding on ZendStudio on a nice well-lit Series 9 laptop (64bit windows 7) without any lag whatsoever, next to a heater.
 
I should get a heater...
 
The only thing I lack is a wireless power chord :D think I'll have to log off for a while
I must admit the laptop cost me a fortune by my salary.
But nothing I couldn't afford.
I'm also very happy with it.
 
Move to SF
 
@CharlesSprayberry are you still there?
 
10:47 PM
San Francisco
 
@Anfurny I'm still planning my World Tour :P
Some day, I might visit.
 
It's just a great place to get a very high paying software job, once your resume is shiny
 
Hi
 
11:03 PM
@Ozbekov hi
 
It's nice to see Gordon here again, I'm guessing this room is still quiet most of the time :)
It's been a year since I've been here.
 
@LondonBoy What's up?
 
11:19 PM
i wanted to show you what i achieved and whats not working for me if thats all right to send links here?
 
what is the name of URLs which look like this: http://krugman.blogs.nytimes.com/2011/12/14/speaking-of-people-whose-models-have-failed/ ? is that "clean URL?"
 
@LondonBoy go ahead
 
urls which dont have a page.php?article=19348732 type thing
 
@LondonBoy You need to post a link to a pastebin of your actual code and say what is wrong with the code?
 
11:24 PM
could you see the page?
 
Yes, I could see the page
 
its working ok but only problem is that but if a row contains 3 or more same numbers and in the specific number there are only 2 same numbers it will count as 3.
 
@LondonBoy Right, would need to see some actual code instead of the output
 
currently i put the dublicate numbers in an array and if they are in the row i just count them as 1 otherwise i compare them to the other numbers in the textfields and if they match i set 1 of them as 0
 
@LondonBoy I need to see the actual PHP code you're writing to produce this. I cannot help you if you don't show me what you're doing.
 
11:40 PM
thanks anyway charles can i add you on fb?
 
@LondonBoy I reserve my friends on FB to people I've actually met in real life :)
 
ok :) nice to meet you anyway
are you here often?
 
Yes, I use SO daily
 
do you recommend any books for php?
 
Anybody have some good Joomla tutorial links?
 
I want to start developing in Joomla but the innerworkings of it are sketchy and there's not a while lot on google :/
 
thanks charles i think i will get the one by mat zandstra
im off now i will be on earlier tomorrow around 1-2 hours earlier
thanks and have a good day
 

« first day (424 days earlier)      last day (4515 days later) »