« first day (1937 days earlier)      last day (3011 days later) » 

1:09 AM
heh
 
1:28 AM
I have a nested if else block where somewhere in this block I may set a $flag and do something if $flag is true and after the last closing bracket of the block. Kinda like this: 3v4l.org/EfO12 - All variables can change each time but as long as they check the true flag then I'm okay. It works though it really feels like it's ugly. Any suggestions?
 
@Ekin switch block?
 
oh right I'll try changing it to switch now, thanks
that'd look more organized I guess
 
2:01 AM
@AnmolRaghuvanshiVersion1.0 stackoverflow.com/questions/tagged/night
 
2:14 AM
hi can anyone tell me why my ban on asking question is not uplifting?
 
you may want to verify the meaning of uplifting :)
@TahaDhailey I can't really say just by looking at your profile, but your last three questions were heavily downvoted, which sometimes trigger a question ban. The dialog preventing you to ask question should also display the remaining duration of your ban
and please. don't ever again ask "can u do me a favour by upvoting my question since i have been blocked from asking questions due to negative votes"
ask better questions. there are plenty of resources on how to do that.
 
52
Q: What can I do when getting “We are no longer accepting questions/answers from this account”?

Robert HarveyDo not repost the question you were about to ask until you have READ EVERYTHING WE ARE ABOUT TO TELL YOU. While trying to ask a question, one could get: We are no longer accepting questions from this account. See the Help Center to learn more. Likewise, for answers: We are no longer a...

 
 
1 hour later…
Wes
3:32 AM
morn
 
morn
 
what are we mourning?
 
Wes
4:27 AM
php5?
 
4:54 AM
moin
 
@jbafford as you're still here, can you please answer two simple questions.
1. What would your code do if require won't find it's file
 
@YourCommonSense Why would I want to? You've been insulting and demeaning, and you've shown no interest in actually learning a point of view different than yours.
 
2. What would your cod do if PDO query won't find a table to select from
the problem is it's not s "point of view". It's rather programming principles. But ok, if you prefer to feel insulted, then better to leave you alone :)
 
I don't prefer to feel insulted. I actually was insulted.
 
Just think on these two questions when you got time
 
5:01 AM
Oh, I already have answers for those. Did long before our conversation earlier.
I just see no reason why I should waste my time explaining myself to you.
Feel free to try again in a few months when maybe I've forgotten this conversation and I'm bored enough to spin round in circles again.
 
No, you have to break that circle yourself. Because it's in your mind
 
Please don't tell me the contents of my mind.
You certainly have no idea what's in there.
 
what's going on ?
 
@JoeWatkins Oh, nothing. Just a stupid conversation from earlier today that won't die.
 
I am just trying to explain that all errors have to be handled in a PHP application, not just one particular selected kind.
 
5:05 AM
Partially my fault for continuing to engage.
@YourCommonSense You think I don't know that?
 
But php users are very reluctant to this idea in general
 
Look, despite that I only have 3200 rep and have only been on SO for a month, I have been doing this professionally for 20 years and non-professionally for longer still. I am not some idiot newbie with misconceptions on errors.
 
it started from a false statement in PHP manual, telling you to catch a PDO exception instead of handling PHP errors properly
 
I grew up on a platform where not checking for errors meant in all likelihood you had to reboot your computer.
You think it's a false statement. I, and the manual, disagree.
 
show me
 
5:08 AM
You seem to prefer to catch exceptions and errors via an error handler.
That's fine. But don't presume to call the manual wrong because of it.
 
but for require you can't catch. that's the problem.
 
@JoeWatkins in short: manual on PDO recommends a try-catch around creating a new PDO instance because if it fails, the backtrace that gets emitted by default includes your connection credentials
 
that's horrible
 
First there was a whole argument over what the default behavior of error_reporting and display_errors was; then it was over whether it was a leak or not; then it was over whether it was a stack trace or not; then whether it was over whether try-catch vs. an error handler was appropriate.
 
there are other errors that are not exceptions - undefined function, double declaration, etc. You have to set proper error reporting for all errors. This done, you won't need any special treatment for the particular kind of PDO errors
 
5:10 AM
basically, hours of pointless argument over a difference of opinion over the proper way to handle errors.
 
it doesn't seem important enough to argue about for hours ...
 
It really wasn't.
I was cleaning my office today. Apparently that was my chosen distraction.
 
There was a guy named Tom o' Bedlam who used Great Seal of England to crack nuts.
To catch an exception only to report (or not to report) it is pretty much like this
This is all what I said. But people fiercely disagree with that
 
I don't even understand it ...
 
Thinking if you don't catch an exception you don't handle it.
That Tom is from Mark Twain's famous novel
 
5:20 AM
@YourCommonSense are you going to be at phptek?
 
Then I'm done typing about this conversation for the forseeable future.
 
> Thinking if you don't catch an exception you don't handle it.
 
There are clearly more subtleties than can adequately be conveyed over a text medium.
 
yeah I think you're probably right ...
the initial advice in the manual is horrible, is all I have to say about that really ... and that error handlers are not really reliable ...
 
5:29 AM
but may be it's going to be a good idea to exclude a stacktrace from the stringified exception
because if you want a trace you can get it from a handler
 
well, you can probably get it from a handler ... notice they are called set error/exception handler, not add, the fact is neither can be relied upon because they can be overridden ...
the proper fix is making the trace secure, no question about that ...
 
Regardless of one's opinion on error handling mechanisms, there's not one word of that warning that's wrong.
If you don't do something about the error, your credentials will spill.
I'm not saying that that's good or bad. It's just the way that it is.
As for a proper fix ... I'm open to suggestions, but it's hard to see what that would be without some sort of special case that allows "security critical" functions to selectively omit their parameters from a backtrace.
And even then, you never know what's going to be emitted from earlier up in the chain.
 
you said it was hard to see it, then described a solution ... so it wasn't that hard to see it ...
 
It's hard to see it being effective.
Let's say PDO::__construct can hide its parameter list.
That doesn't really help when you're in a DI system and there's a dozen more function calls between main and PDO::__construct() that all include the configuration parameters, including the credentials.
 
it's really not possible, when designing something internal, to ensure that it is always used effectively, we can only provide the features
 
5:37 AM
well, yes, that's kind of the point
This is a consequence of the way the system is designed, and has to function.
 
what system ?
 
PHP's exception system? PDO's error system? Backtraces containing function parameters? Take your pick.
 
hold on a minute ...
 
The only real alternative I see is, maybe, if you could taint parameters (and have tainted parameters not show in backtraces), and that somehow trickle that taint back up the call chain to everything that was used to construct them. That's a lot easier to describe than actually implement.
 
it doesn't need to happen in any of those places, you can just pick a place it will work from ...
 
5:41 AM
but most tainting systems work in the other direction: you taint a value, and anything derived from that value is tainted.
 
Wes
what's happening? fights? i wanted to join
 
<?php

$config = [
	"username" => S"root",
	"password" => S"secretpass",
	"hostname" => "localhost"
];


?>
 
Wes
seriously, what's the topic?
 
replace S with whatever you like ...
why can't we do that ?
 
because complex things never work
 
Wes
5:42 AM
morning joe
 
well, that's taint in a nutshell
 
a solution have to be simple
 
I thought taint was only for input and was automatically applied
 
but to be devil's advocate here: now you've got a symfony app and your items to be tainted are actually in a yaml file four levels removed from actual php code, and there's no pre-existing structure to declare certain values as taint-worthy.
 
Wes
variable tainting kinda reminds me of magic quotes...
 
5:44 AM
(maybe that means the frameworks need to change to account for that, sure. but it doesn't do anything for existing users.)
 
@jbafford but your yaml was parsed, right ?
seems like a job for the parser of the future that supports these language features ?
 
yes, already addressed that.
 
oh I didn't read up ...
still < 6am
morning wes
 
This is actually a fairly interesting idea for taint I had never previously considered.
I wonder if something like that would stand a chance at getting included in core
I wonder if something like that could even be implemented without a huge memory and/or performance penalty.
 
it can be done
 
5:49 AM
oh, I've no doubt it could be done.
 
mornin
 
But at what cost?
 
there is an rfc for taint, but the original code started as pecl extension (written by xinchen), it's really quite complicated and does have an impact, but if you came about it from the other side, from inside zend, I can imagine much nicer, more effective solutions ...
@jbafford I mean it can be done, without a huge memory or perf penalty
maybe you found the subject of your first RFC :)
 
actually, it would be my fourth.
 
Wes
@rtheunissen if you need another pair of eyes for what i believe you are doing, feel free to ask
 
5:52 AM
I don't pay much attention lol
sorry :D
 
@JoeWatkins look, you may simple take the trace out of the stringified exception. Really
 
Fatal errors never had a trace in them but nobody died out of that yet
 
but that doesn't solve the problem of leaking sensitive information @YourCommonSense
 
both of them need updating with performance numbers
 
5:54 AM
It does solve a blame for "zend engine"
 
but they're otherwise ready to go; I was just waiting for the code of conduct brouhaha on internals to die down a bit before I made more noise.
 
Wes
@jbafford planning putting them into votes soon? foreach void is very good :P
 
@Wes glad you think so :)
I did want to get perf numbers updated and try and drum up some more support
I got a lot of "that looks cool" from people with no voting karma, and blank stares from people with karma.
 
Wes
although, i'd add a triple vote option, (no, yes foreach($a as $b => void), yes foreach($b in $a))
 
Well, I considered that as an option, but I didn't like it because it was more new syntax than I actually wanted to deal with.
 
5:58 AM
no tripple votes
I like it fwiw, I'm always wrong about this stuff though ...
 
Also, because (key in a) is not necessarily the expected reading.
 
it's probably horrible for some reason I don't know about yet ...
 
Look, there could be an smtp wrapper that accepts credentials in the constructor that may be leaked as well. There are hundreds of cases. And the root of the problem is the stack trace in the default error message. Remove a trace from it and its done. If someones handler leaked - its their problem
 
If you come from javascript, sure. If you come from php, you might think it a reverse form of foreach (arr as val).
Twig uses {% for value in array %}, so already there's precedent against that would cause confusion.
 
6:00 AM
moin
 
@JoeWatkins if I were going to make it multiple choice, I'd do: one Yes/No on the concept, and then a A/B choice on syntax options
 
Wes
idk... => void is so ugly
 
@jbafford if you want to pad your perf numbers, use an iterator that computes expensive values on access
 
@jbafford don't, pick your favourite and if it fails, do what everyone else wants ...
so long as favourite for good reasons ...
feel free to ignore any and all of what I say, obviously ...
 
@tereško glad you re back. Can you tall me what is that pptentially dangerous code you are talking about? Ok, I am not asking you for a proofcode, but only a hint. Ill write a code myself. But what is this vulnerability you are aiming to?
 
6:02 AM
groups of people don't work like anyone you ever met ... I noticed ...
 
@YourCommonSense ya know what - I don't give a fuck anymore
 
lol, morning @tereško
 
o/
 
@PaulCrovella I forgot what my numbers were, have to re-run them, but in a particular contrived case of foreach(array_keys() as $k) vs. foreach($k => void), the foreach-void was easily twice as fast, and could very easily be more.
 
you removed --enable-debug from benchmark build, right ?
 
6:05 AM
@PaulCrovella I'm not actually sure that would help. The iterator's going to compute key and value anyway. The perf win is from not emitting the opcode that copies the value into the target variable
@JoeWatkins damnit, I'm going to have to re-do my benchmarks. I honstly don't recall.
I must have recompiled PHP like a hundred times that day.
 
hehe, yeah, it happens ...
 
Wes
@jbafford "The iterator's going to compute key and value anyway" -> when doing foreach($x as $v) ->key() never gets called
[unless something changed in recent times]
 
I'll add a thing with an iterator into the mix to see what happens
but iterators (and yield, also) has always had the assumption that you're emitting values (and keys also).
the major change to the compiler really is just not emitting the opcode to copy the value. The value's still going to be generated elsewhere.
I need to look at it again, but IIRC, the key and value are actually generated by the ZEND_FE_FETCH_R(W) opcode, which doesn't change at all.
though maybe this is a possible avenue for future improvement
 
@wogsland what was that??
 
@tereško ok, np. Thought you do as you bothered to say that my code is wulnerable.
 
6:16 AM
morning
 
.. about as much as for any Tuts+ post
 
6:46 AM
hi all
is there any by which I can set unlimited session timeout in laravel until and unless user closes his browser
 
Hi all
 
http://stackoverflow.com/questions/35194376/last-login-time-for-mvc-‌​identity-user
http://stackoverflow.com/questions/35194376/last-login-time-for-mvc-‌​identity-user
 
i am android devloper but i want to know about web services
 
Hi all buddies
 
anyone ?
prntscr.com/9ysq90
i know whhats the problem but is there anyway bypass this
my hosting providers dont let me use curl_exec()
i am using codeigniter as framework
and on windows shared hosting
 
7:22 AM
Good morning peeps
 
Meurning!
 
o/ morning Epodax,Naruto
 
Wes
i don't use SO main much - does this look right to you? opinable? should i improve it? thanks
 
@Wes looks like you're fishing, or going for a tumbleweed in any case debatable
show some code to show us you care :D
and hi
 
@Wes Not entirely good at making questions myself, but as mentioned above me, It's a bit broad, perhaps show / include something of what you have done to research :)
 
7:35 AM
i mean research it a bit more than what you heard and post at least some docs links source code/links
 
Wes
i haven't been given much information :B basically just got a "ur wrong!" and no actual explanation given
 
tumbleweed it is then
 
Without any certainty, what so ever, but just so you know, you risk getting the "Do your own research" :)
 
Raj
can any one help me ?
0
Q: custom url in php using htaccess (url rewritting)

Raji am new in url rewriting in php htaccess. currrently my url as like http://localhost/htaccess/Movie/my-parameter-value but i want to http://localhost/htaccess/my-parameter-value i want remove Movie (movies is from action source name ex "movie.php"); Thanks In Advance here is my code : #Opt...

 
Wes
if you look at php's documentation you don't get much apart obvious features @Epodax the other research i could do is looking at the source code, but i'm not very good at reading C..
 
7:42 AM
@Wes again, I'm not good at asking questions myself, and really don't know much about that subject, just trying to give you a heads up :P
 
I have a small question.
SERVER 1. needs to create a subdomain blah.domain.com which redirects/forwards to anotherdomainInTheWorld.com
What kind of redirect should be used for that? ( 301 or 302 )
 
Depends on what you intend for the SEO to see Duik
 
Wes
i imagined already it would end up tumbleweed :P will bounty it in case
 
Although I'd properly go with 301 unless it's not something permanent. 302 is a temp redir.
 
stackoverflow.com/a/1393298/1063823 Not sure which fits my scenario. Real life example: people see on a paper invitation a nice url subscribe.xyz.com which leads to someurlwithaform.com
It's just for a few weeks that it has to exsist.
 
7:46 AM
Then do a 302 :)
 
301 = for redirecting 'in the same domain? '
Or what could be an example of that? :)
 
No. 301 could be.
That I have olddomain.com with a website and links, all indexed nicely by google, but then I make a new domain + server (completely new site), but i'd like to keep my old google rankings. I then use 301 to tell google that olddomain.com/supersite.html is now newdomain.com/evenbettersupersite.html and olddomain.com/almostawesome.html is now newdomain.com/awesome.html
 
Raj
hello every one !!!!!! wow to know url rewriting in details=?
 
Oh ok. I get it ! So for now I need 302. Tanks for the explanation. @Epodax
 
Aye, but you CAN also use it for internal redirs. we do, for example if your customers, for some reason, keep typing domain.com/acb.html instead of domain.com/abc.html, (in order to get best "ranking" and not loose customers, you can use 301 to say, "Hey, instead of a 404, move them over to domain.com/abc.html instead"
 
7:51 AM
allright! :D
Thanks a lot! Makes sense.
 
@Epodax Hii there I have a problem in google login can you please look into it ?
 
@PraveenKumar Random pings! - As in you use google to login / auth, or that you can't login to your email? :P
 
@Epodax yes sorry to disturb you but can you check this url for me medibuysell.com/index.php/account/newaccount/google_plus
google login/auth
 
@PraveenKumar The redirect URI (where the response is returned to) has to be registered in the APIs console, and the error is indicating that you haven't done that, or haven't done it correctly.

Go to the console for your project and look under API Access. You should see your client ID & secret there, along with a list of redirect URIs. If the URI you want isn't listed, click edit settings and add the URI to the list.
 
@Duikboot did you checked the link ? you can check the both requested url and registered url and tell me the difference ?
@Duikboot because when i checked i see no difference there...

as both are

//http://www.medibuysell.com/index.php/account/google_plus_auth/auth_callback

//http://www.medibuysell.com/index.php/account/google_plus_auth/auth_callback
 
8:04 AM
Uhm, for those who use SQL server and php7, please vote here surveymonkey.com/r/ZCHZBP7
 
@Duikboot @Epodax there ??
 
@Duikboot yes checked
already
 
yesterday I found that the way to create pages dynamically was to use php routing. i've been through some examples, but I don't see any mention of fopen. What am i missing? Because isn't fopen the one way to create a page on the fly, which will be needed before going on to make a friendly url?
 
8:09 AM
@AgniScribe what exactly are you trying to do?
 
@ter
 
it seem that your solution is "create pages dynamically", but what is the problem that you are trying to solve?
 
@PraveenKumar Sorry, don't have time to do your debugging :)
 
@Epodax no problem dude :)
 
8:13 AM
@teresko, the situation is this: with html & php, I have my website's static pages (home + main landing pages) full created and linked to the dbase. Now I have a bunch of other pages that fall under one or the other of the landing pages, and these would have to be created dynamically(simply because it would be to arduous to make static); so now i needed to know how exactly to go about having these pages created dynamically (given that I already have a ready template for them)
 
i need them to be created on-th-fly and I assume fopen is needed for that, but I don't see mention of this in any of the routing examples.
 
@AgniScribe leem check if I get this right
 
so am wondering how exactly are these pages created?
 
@AgniScribe Save slugs in your database, couple content to that slug, display when url is requested. Slug is part what comes after domain domain.com/foo/bar/baz.html slug would be /foo/bar/baz.html
 
8:16 AM
instead of having a single page with <title><?php echo $title;?></title> you decided to make separate files with <title>Foo</title>, <title>Bar</title> and <title>Etc</title>
have I understood you correctly, @AgniScribe?
 
@Michael, yes, i understand this - that slugs will have to be saved in the table. but after that, how is the page actually to be created?
 
@AgniScribe in 99.999% of websites there are no static pages generated.
 
via a cms @AgniScribe, a Content Management System. There your users(or you) define what the content of that page should look like.
 
@teresko, I don't think I understand that. So let me explain, my websites has 4 main sections 'Recipes'-'News-'Events' : each of these have landing pages which I have created statically, along with the home pages. Now I have 33 pages that will fall under the category recipes, 33 under news and 33 under events. These pages have to be created dynamically, when their links are clicked.
 
that's not how it works
 
8:22 AM
^
 
@Michael, I have already made a CMS for the admin to add-edit-delete date in the backend
 
lemme guess, @AgniScribe, this is your first month using PHP
 
i think he want do add pages like in wordpress
 
yes - it's my first project
 
8:23 AM
@AgniScribe then please stop what you are doing
 
ok?
 
google on create own cms step by step
 
@MichaelDibbets NO STOP WITH THE FUCKING CMS
 
:P
he wants to learn :P
or... learn to work with a cms like octobercms ;-)
 
@MichaelDibbets HE MADE A HELLO WORLD FEW FUCKING WEEKS AGO, HE DOES NOT NEEED A FUCKING CMS
 
8:25 AM
what's happening? this is my hobby project i'm using to learn things from scratch
i already made a cms and it works fine
 
@AgniScribe sorry, got distracted by stupid
 
oh, that new
 
i made a hello world 15 years ago
 
not in php
if you have a site where you need to have 33 link going to 33 diferent pages showing "event", then you DO NOT make 33 static pages
 
exactly - and i believe i've come pretty far in the project - and have come to a brake at this point - not seeing any compreshensive approaches on the net
 
8:26 AM
you make a single page and populate it by data from DB
what data you pull from DB depends on what paramters have been passed in URL
basically you have http://who.cares/event.php?id=23, which gets data from DB about 23th even and put it in your template
any question so far?
 
@teresko, yes i do have a q
a second to put it together
 
Is there any alternative instead of "good morning" ? (I used it too much everywhere and it is duplicate anomore)
 
@teresko, so i set the php?id=23 in the href of the link?
 
@tereško I hope you have enough coffee
 
<?php
    ... do the DB magic
?>
<html>
   <head .../>
   <body>
      <h1><?php echo $event_title; ?></h1>
      <p><?php echo $event_description;?></p>
   </body>
</html>
This is what that event.php would look like in the simplest possible version
 
8:33 AM
This structure is exactly the same with what I always do :-)
 
@Shafizadeh you really shouldn't :P It's meant for newbies.
 
yes that what I'm doing in my events page.
 
@AgniScribe then why are you talking about static pages?
 
good morning
 
8:34 AM
o/
 
@SergeyTelshevsky yo
 
overslept my job by 2 hours... I feel amazing..
:D
 
@tereško "yo" is stand for what?
 
@teresko, because for the homepage and the 3 landing pages, I have pre-defined the URLs, but in the case of the other 99 page, I have not, except for a field in their table with the filename & path
ie. for the static pages - i'm using a switch-case
 
8:36 AM
ok very good :-) tnx @SergeyTelshevsky
 
@AgniScribe I really hope it's not a horrifying as you make it sound
 
for the dynamic pages, i need a way of pulling out the filename and path to create the url and populate the template to create a new page
@teresko, why is it sounding horrifying?
 
because you either have had a shit-for-brains teacher, or you are really bad at explaining it all
it sound as if you have generated the website by copying files and storing the filenames in database
which, quite frankly, would be idiotic
 
no I have not done that at all. yet. but i read in one stackoverflow session that the url would have to be stored in the table, before a url could be created and tidied.
 
@Ekin I'm only now making my first cup of tea
 
8:41 AM
(my teacher is the net)
(but my objective in this project is to do things from scratch and to depend as little on frameworks)
 
@AgniScribe what posts did you read?
links please
 
0
Q: how to generate a new url for a new page in php

LhfcwsIf we don't use the frameworks, then how to generate a new url in PHP for a new page which may be created dynamicly by the users? For example, a user may create a new account or post a new pice of article, then we'll allocate a specific url for the user, just like http://www.a.com/username/articl...

 
@AgniScribe I suggest you read up on Model View Controller for your purposes, and try to implement that in your setup. That's the best basis to learn, that way you have to unlearn the least possible when going to be productive :-)
 
the first answer here states: "You need to save the articles with an appropriate URL in the database. Say a user creates an article How to bake a cake ..."
* pls correct my mention of filename in the above messages to page url
*correction:
 
@AgniScribe it is meant for links like http:/what.ever/article/some-fancy-title-for-the-article
it's also a really stupid way
 
8:47 AM
so what would be the right way?
 
it is much easier to have http:/what.ever/article/42/this-title-doesn-really-matter
where "42" corresponds to articleID column in DB table
 
@ Michael, yes infact I am reading up on MVC at the moment
 
@AgniScribe you really shouldn't. Currently it will only make you more confused
 
^ is why I'm saving my questions for later
 
@teresko, ok
 
8:50 AM
so .. lets take you "33 Events"
there should be a table in database called (somthing like) "Events" with collumns: eventId, title, content, date
and all the other data items that you have for that event
 
ok, yes
 
to create a list of all the events in the lading page you just do "SELECT eventId, title FROM Events" and use the results to generate the links dynamically
 
(there is)
 
do you know do to do that part?
 
yes, i would put that query in a functions.php and call that function in the landing page
 
8:54 AM
yes, but I was talking about the "generate links" part
 
no i don't know how to do that part
 
do you know what an array is?
 
yes - its several rows & column s of date, each of which could have its own r&c
 
do you know how to get data from that SQL query as an array?
 
yes, i'm using it already in this project:` $row = mysqli_fetch_all($result, MYSQLI_ASSOC);
return $row;`
 
8:57 AM
then put in your landing page a loop which does:
foreach ($array as $event) {
    echo '<a href="?id=' . $event['id'] . '">' . $event['title'] . '</a>';
}
do you understand what it would do?
 
@tereško Hopefully with escaping.
 
@kelunik at this point I think I am justified to say: "fuck the escaping" (for now)
 
found this gem in my project today, liked it so much that even decided to leave it like it is
 
it's generating a url making use of the id of the record and displaying its title
the url is extending from the landing page address
 
so, can you now make you landing page to show dynamically the list of available events?
(so that you don't have to copy-paste the whole thing by hand)
 
9:02 AM
Morning 11-ers! :)
 
Yo ^
 
@teresko, yes I believe I can - this is great
 
then do the same also for you list other 33 things (which I already forgot)
 
@teresko, is there any need for the php routing then (in this project)?
 
also, instead of "?id= you probably will want "event.php?id=
 
9:05 AM
posted on February 04, 2016 by nlecointre

/* by SansFromage */

 
(i guess i can forget routing for now, since this seems fine)
 
@AgniScribe in your project: probably no, but it's extremely useful in more complex projects
 
@teresko, thanks for the patience .
 
@AgniScribe You have 3 options for routing
 
and the measured explanation
 
9:07 AM
1. Use the default: route based on the physical paths in the system (if you have a baz.php inside of /foo/bar, you access it with http://example.com/foo/bar/baz.php)
 
^ this is what I showed you now (it's the simplest one)
 
2. Use the webserver (apache/nginx) for routing, which involves rewrite rules and all the "fun" stuff you read about online
 
3. Use PHP for routing, which involved writing PHP code in order to decide which files you want to include and run.
 
@AgniScribe kopy.io/cwola If you go toyour page like domain.com/something.php?page=11 it will fetch the page related to id 11, assuming you use pdo. you can just as easely swap out id for slug.
 
9:08 AM
@Jimbo Yo
 
Personally, if you've reached the point where 1 is no longer good enough, I'd jump directly to 3 because PHP is a lot more expressive than .htaccess or nginx server blocks.
 
@ Madara ok
 
I think I am being a bad influence on @Shafizadeh
 
@ Madara that's what i'm going to be doing
 
@AgniScribe Great :)
 
9:09 AM
@tereško That's not bad
 
@MadaraUchiha Apart from that, you mix app logic into the server configuration with option 2.
 
@kelunik if it's just transforming /foo in /index.php?page=/foo, it's fine by me
 
@kelunik lol, you mix app logic into server configuration by default with PHP
(php.ini and stuff)
 
@MadaraUchiha I mix the server completely into PHP with Aerys. :-P
 
The fact that I can have the same source code run differently on two same-OS, same-hardware machines is one of PHP's major weaknesses in my eyes.
(Not only I can, it's not even hard to do accidentally)
 
9:17 AM
@Jimbo \o
 
Monrninininigs
 
9:40 AM
> The uploader has not made this video available in your country.
This world sucks.
We strived for global communication, and now that we finally have it, we decided it would be best not to use it
 
reddit taught us that talking to each other is a mistake
4
 

« first day (1937 days earlier)      last day (3011 days later) »