« first day (639 days earlier)      last day (4294 days later) » 

5:00 PM
@LearnerExpress PHP breaking in IE only?
 
@markus-tharkun sorry
 
yes @mike
 
@markus-tharkun each subdomain will be connecting to its own database though
 
@hanleyhansen that belongs to the application layer
@LearnerExpress OK
 
@webarto i know. but how am i going to dynamically change that by doing rewrites?
 
5:02 PM
@LearnerExpress explain
 
@mike , php if statement can't hide dynamic dummy image place holder
 
@hanleyhansen I don't understand? Parse HTTP_HOST to see what subdomain is in question, then connect to the database with the same name... but you can connect to the same database if the application is the same... if you use dynamic, it must be the same... so you are little lost here...
@LearnerExpress you might want to show some code...
 
@NikiC As expected, people don't seem too keen on a PyPy engine.
 
ok @webarto
 <?php if ($totalRows_all > 0) {?>

    <img src="../images/<?php echo $all['image']; ?>" alt="<?php echo $row_all['caption']; ?>"/>

<?php }  ?>
 
@LearnerExpress ow ow ow ow ow MY EYES
 <? if($totalRows_all > 0):?>

    <img src="../images/<?=$all['image']?>" alt="<?=$row_all['caption']?>"/>

<? endif?>
Short and sweet ^_^
 
5:08 PM
if it's 5.4 you don't need <?php but <? :P
 
@neal, the above block of code hides the image in ie but can't hide the dummy place holder if no record is found
 
@webarto Oh yea. one sec :-P
 
better :P
 
@webarto let me explain with an example. user1 creates an account. my script is going to create a db called user1_db with all the necessary tables that my application needs. i also want a user1.mycompany.com subdomain so that the user can use that to go to the application. my question is: how can i create the subdomain dynmaically? also, does that mean i need a directory for each user? if so, what is the best practice to create these things dynamically?
 
Smarty they say, LOL I say
 
5:09 PM
@webarto using a cron job maybe? my php script pulls the username from post and sends the correct variable to the cron job so that db and subdomain are created and directory with appropriate application files are created. make sense?
 
(I would never make code like that... just wrote it hear for fun :-D)
 
i'm facing the problem with ie only
 
@LearnerExpress PHP has no affect whether the browser is IE or not...
does care either way
 
yup
 
so it's not IE that is the issue...
 
5:10 PM
PEBKAC
 
@webarto exactly ^_^
@hanleyhansen What the fruit? A different DB for each user?!?! Why on earth would you do that?!
 
@Neal not user. application.
 
@hanleyhansen Do all the "applications" do the same thing?
 
@Neal replace user with company instead.
 
@hanleyhansen See my previous comment ^
 
5:13 PM
@Neal yes but each company will have different data. so for each company that is using the application i need a different db. make sense?
 
@hanleyhansen nope. not at all lol
 
1 db, 1 application, multiple subdomains. period.
 
if everyone did something like that, Facebook would have a billion databases lol
 
facebook doesn't use uique subdomains per user
 
haha oy...
@hanleyhansen use one database.
 
5:14 PM
@Neal if have read several times here "database for each user", don't know where they get that from...
 
Have a table of "companies", or "users" or whatever you want to call them
and then join them all over
@webarto eh?
 
sorry, I've read on SO that many people want to make separate database for each user, like 1000 users, 1000 databases...
 
@webarto r u serious??? wtf
 
I was like, f* this s*
 
@neal, i checked the code with all popular browsers, those don't cause any problem except ie
 
5:17 PM
@Neal @webarto allow me to further explain. let's say i made an accounting application. company1 wants to use is to they sign up. i want to make a subdomain for company1 which is company1.myapp.com and a db for company1 called company1_db. in table company1_db.users i have all the users for that company that register. now a seperate company namely comapny2 wants to use my application for their accounting. they will do the same thing and sign up and i will make company2.myapp.com and company2_db
@neal @webarto for their db etc etc. how can i do that dynamically? the whole purpose is to separate different instances of the application to each company.
 
@LearnerExpress well IE should have no problem showing images
 
ie keeps displaying an image place holder
 
@Neal stackoverflow.com/questions/327787/… one of many examples
 
@hanleyhansen make a table for "companies" make a table for "users" make a table to join "users" to "companies"
 
@neal ie shows image if the record is there
 
5:18 PM
28
A: Is it unreasonable to assign a MySQL database to each user on my site?

Ed GuinessUse one database. Use one table to hold users and one table to hold quotes. In between those two tables you have a table that contains information to match users to quotes, this table will hold the rating that a user has given a quote. This simple design will allow you to store a practically u...

1 min ago, by Neal
@hanleyhansen make a table for "companies" make a table for "users" make a table to join "users" to "companies"
 
@neal but it keeps displaying a place holder if the record isn't there, but it shouldn't actually
any idea?
 
6 mins ago, by webarto
1 db, 1 application, multiple subdomains. period.
@hanleyhansen
 
@Neal I have done it many times before.
 
@LearnerExpress empty record and no record are different things...
 
@webarto ok so i should rewrite the subdomains right?
 
5:20 PM
my brain hurts
 
@weberto that's correct
i'm about empty record
 
@hanleyhansen What is with this and subdomains. why do you need subdomains?
 
neal.myultramegagigapp.com
 
and even if you do. Use one database.
 
that's what i want to mean
 
5:21 PM
@Neal ok i'll use one.
 
 
anyone ever used basecamp?
basecamp does what i am trying to do.
 
you should maybe contact them and ask
 
@hanleyhansen What does "basecamp" do?
@webarto LOL
 
@webarto you understand what i'm trying to do though right?
 
5:23 PM
@webarto me
 
@webarto myself
 
lol ^^ smh
i hate you guys lol
@Neal basecamp creates a subdomain per account!!!!!
 
no emotions please
It does not! I object!
 
@hanleyhansen and guess what? IT'S ALL ON THE SAME DB
 
@Neal that's great!!! how do i do it lol
 
5:24 PM
i guess anyone is familiar with the problem i'm explaining here
 
@hanleyhansen .... Learn.
 
@Neal I was ROFL when I read that :D It got deleted rig
 
@hanleyhansen Wow, just wow
 
@webarto lol yea
 
@Event_Horizon what?
 
thanks,
 
I'm too lazy to scroll up and read everything but when we needed our webheads to answer on all sub-domains we setup some sort of wildcard redirect.. *.example.com > 10.0.0.1
 
@Neal 3.5k to go :)
 
You have no clue what you are doing when it comes to databases do you?
 
@MikeB He wants to do dynamic redirects
@webarto :-P
 
5:26 PM
@Event_Horizon yes i do. what are you talking about?
 
let me f* quote myself again...
 
@hanleyhansen No, no you really really don't
 
If you did why would you ever think you would build a database per user? Or even a table per user? That's freaking retarded.
 
RewriteCond %{HTTP_HOST} ^([^.]+).webarto.com$ [NC]
RewriteCond %1 !^(www|ftp|mail)$ [NC]
RewriteRule %1$ webarto.com [R=301,L]
 
@Event_Horizon by user i meant application instance
@Neal how don't i?!?!?
 
5:27 PM
add a wildcard subdomain *, and add rules to .htaccess @hanleyhansen
 
@hanleyhansen Oy....
 
@hanleyhansen regardless what you mean, you don't sound like you know what you are talking about, at all
 
@Event_Horizon try me
 
@hanleyhansen LOL we just did!
 
9 hours ago, by webarto
I don't always know what I'm talking about, but when I do, I charge :P
@Event_Horizon :P
 
5:30 PM
All of you guys. Go to storageroomapp.com and create a free account. Then talk to me.
 
but I know f* dynamic subdomains, and the guy doesn't listen, and it's free!
 
@hanleyhansen wazzat?
 
@Neal So you can see an example of what i'm talking about.
 
@hanleyhansen You did not answer my question at all....
 
5:31 PM
@hanleyhansen just.....read books on SQL, you don't know, seriously
 
@Event_Horizon Retard. It has nothing to do with SQL!!!!! SQL isn't the problem!!!!!!!
 
@hanleyhansen Yes, yes it is...
 
@Neal It's a JSON based CMS.
 
You have no rights to be rude, especially when you behaving like an idiot. GTFO kthxbai
 
@Neal It's not. You obviously don't understand.
 
5:32 PM
@hanleyhansen When you are talking about connecting a DB per user for subdomain control, yes thats partly SQL related
 
@Event_Horizon I'm not talking about per user. storageroomapp.com/signup/free/new sign up. you'll see.
 
@Event_Horizon lol partly is an understatement lol
@hanleyhansen No. I am not signing up for crap. What is your login?
 
@Neal well the other part is sub-domains, which I have no right talking about, I haven't set any up before
 
I love building odd thigns
 
@Event_Horizon yes, true. but the bigger issue is MySQL
 
5:34 PM
1 message moved to bin
 
mysql_select_db($_REQUEST['db']);
 
@Neal i don't have a login. it's just an example of how they dynamically create the subdomain you want.
 
@ircmaxell Is moving to bin a rep requirement thing?
 
@Neal agreed, setting it up the way he suggests is horrifically misinformed
 
@ircmaxell sorry
 
5:35 PM
@ircmaxell Maybe you can help me. Have you ever used basecamp?
 
class HashCipher {

    private $algo = "sha512";
    private $rounds = 256;

    public function __construct($algo = "sha512") {
        $this->algo = $algo;
    }

    public function decrypt($key, $data) {
        $len = strlen($data);
        $dataL = substr($data, 0, $len / 2);
        $dataR = substr($data, $len / 2);
        $keys = $this->deriveKeys($key);
        for ($i = $this->rounds - 1; $i >= 0; $i--) {
            $tmp = $dataR;
            $dataR = $dataL ^ hash_hmac($this->algo, $dataR, $keys[$i], true);
@LeviMorrison no, it's a room owner thing. You need access to bin. Go ahead and request access, and I'll try to give you access
 
nice coding style
 
@hanleyhansen yes
 
@ircmaxell Ok so you're familiar with how they create a subdomain per company account right?
 
@ircmaxell DON'T GO THERE!111!
 
5:37 PM
I've read all his messages and I don't see what the problem is. It's a SaaS implementation.. wildcard all subdomains to go to the same script which reads the subdomain and boots the application for the requested subdomain
 
@MikeB That's the term i was looking for.
 
so you brainf* all of us just to get the SaaS word? @Neal are you still alive?
 
@MikeB It doesn't mean i don't know sql. i'm not talking about the coding. i'm talking about the implementation.
 
@webarto Huh? Wha? ZZZZzzzzzzzzzzzzzzzz
 
your question has been answered multiple times here, if you want consulting, that would be $100/h, $150/h for you @hanleyhansen
 
5:39 PM
@webarto retard. mikeb read the same messages you did and he immediately knew what i was talking about. all you guys did was proceed to insult my knowledge.
 
where 's me gun
 
i was wondering if POST works the same as GET when dealing with json i always see examples with some sort of url query
 
@webarto $149.99 :-P
 
5
Q: How to offer custom sub-domains for SAAS Application

RoccosHow do i offer Basecamp/SAAS App like sub domains to clients? For example, my website URL is http://www.example.com whenever the user signup i want to offer them url like http://company.example.com which should load files/contents from /app directory of the website. And later i want them to cho...

 
@hanleyhansen yes
@webarto ?
 
5:41 PM
or per Zend logic if you are from Europe €149.99 :P @Neal
 
@webarto Oh booo.
@ircmaxell Just don't
 
@ircmaxell just f* don't, read transcript
 
@ircmaxell Just found the SO question. I didn't know what it was called.
 
Ummm... creating a domain name?
@webarto best way to get me to read it
 
@ircmaxell No SaaS.
 
5:43 PM
you have been warned... @ircmaxell
 
Ben
@hanleyhansen I understand what you are trying to do however I'm not sure how easy it will be to manage.
you need to have a vhost conf file for each subdomain http://pastebin.com/FaWXCXVg (use this as a template) of course you'll have to reload the Apache config each time you create one of these new vhost files in /etc/httpd/conf.d/subdomain.conf
to reload your apache config you can use /etc/init.d/httpd reload
 
That code above is proof positive that you can use md5 to encrypt data :-P
 
women, get me AK47
 
@Ben No you don't. You can wildcard the subdomain DNS stuff and the vhost configs
 
@ircmaxell I wanted to know the best way to dynamically create the subdomain. I also asked if best practice was to create a db per account.
 
5:44 PM
here we go again...
 
@MikeB That makes more sense.
 
49 mins ago, by markus-tharkun
@hanleyhansen that's exactly what I just explained to you
 
@hanleyhansen DO NOT DO THAT
 
@Neal Do what?
 
5:45 PM
@hanleyhansen "create a db per account"
 
@hanleyhansen both questions are impossible to answer. It depends so much on what you're trying to do
 
@Neal Aye, DB per account is very much not SaaS :)
 
@Neal why not? I've done it plenty of times
 
@MikeB We went through this with @hanleyhansen already.... :-(
 
1 hour ago, by hanleyhansen
hey guys. what's the cleanest way to build an application with client-specific subdomain? should I make a subdomain for each client and a db for each client?
 
5:46 PM
@ircmaxell A WHOLE DB schema per account?
 
@ircmaxell Thank you. It's done all the time. idk why i freaking got flamed.
 
@Neal I know I'm getting into it late :(
 
@Neal yes
 
@ircmaxell why?
 
because the problem dictated that was the best solution
 
5:47 PM
Hard to argue that :p
 
now you are just trolling
 
@ircmaxell Ok. but in @hanleyhansen example, that is not the case :-P
it is the same app for all users
 
@ircmaxell the question is what problem dictates that kind of solution
 
Hard to argue the problem dictating such a solution, however wtf was the problem?
 
5:47 PM
@Bracketworks LOL
 
good morning folks
 
@Event_Horizon yep
 
how was your day so far?
 
@webarto afternoon. its good :-)
And yours?
@webarto Want to yell at my MVC implementation?
 
@ircmaxell I built an application for my congregation that manages the weekly speakers etc etc. i want to rollout the application to other congregations. So i wanted to make a solution where when the congregation signs up the subdomain: congregation1.myapp.com is created. My question was would it also make sense to seperate each congreagtions data by creating a db namely congregation1_db.
 
5:49 PM
@Neal good, I just arrived from lobotomy
 
or do this: @hanleyhansen
31 mins ago, by Neal
@hanleyhansen make a table for "companies" make a table for "users" make a table to join "users" to "companies"
@hanleyhansen So you want to do something like this? shulcloud.com
 
@hanleyhansen Alternatively, by consolidating them to the same schema, a root "network" site could easily query up cross-network feeds and such.
Sure it could be done with multiple schemas, but I foresee less issues with a single schema.
 
@Bracketworks don't insult his knowledge.
 
@webarto hehe
 
Furthermore, changes to a given schema won't propagate easily unless you repeat them, across multiple copies; maintaining one ensures conformity.
 
Using that question as an example.. why wouldn't I flag it as low quality or something instead of voting to close?
I have trouble understanding the distinction in cases like these
 
@Bracketworks That makes sense.
 
Does adding [closed] to the question instead of deleting it right away just give time for the author to clean it up and have it reopened?
 
it's a bit (lot) vague, IMHO
 
@tereško here ya go:
5
A: The difference between private and protected

cHaoprivate and protected are there to make it easier to write code that does the right thing. As you've noticed, there's nothing preventing you from bypassing that if you have to. It's not unbreakable or meant to protect you from stupidly written code that actively tries to do the wrong thing. Th...

 
5:59 PM
@hanleyhansen I think (for your case) the only reason you'd want multiple schemas, is for production vs. sandbox; you could have a sandbox account so that prospective organizations can play with it, you can beta features in it, and so forth.
 
44
Q: What are the best practices to follow when declaring an array in Javascript?

Lorenzo CWhen I need to declare a new array I use this notation var arr = new Array(); But when testing online, for example on jsbin, a warning signals me to "Use the array literal notation []." I didn't find a reason to avoid using the constructor. Is in some way less efficient than using []? Or is i...

Sweet mercy - has anyone asked how to declare arrays in PHP.. and would you expect 44 upvotes for it?
 
hi all. if i make an associative array, then start an output buffer, and inside that buffer, i set some values in that previously created array, then call ob_end_clean, will my array remain in tact?
 

« first day (639 days earlier)      last day (4294 days later) »