-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
well for one thing, it has an "m" on the end.
-
Wallboard / Dashboard MySQL database driven
.josh replied to jhottinger's topic in Application Design
I'm going to assume that you have a database that always shows the up-to-date info, that part is taken care of by some other system, yes? The way I would go about it: Have a page that shows your design, call it "status.php" or whatever. This is where you will have your design/layout as shown in your picture. In a separate script, let's call it getInfo.php, use php to query the db for the relevant info and output it as a JSON object. The script should be relatively simple, it would be basic db connection, query and echo. Now back on status.php, I would have a javascript function thrown in a setInterval to be triggered every X amount of time. In this javascript function I would use javascript's AJAX method to make a request to getInfo.php to get the latest info, and then update the areas of your page with the latest info. All this is pretty trivial with the use of a framework like jQuery. Anyways, if this doesn't work out, can I have that 50" screen? -
As a public service, I am closing this thread before heads esplode trying to come up with a suitable reply to this thread...
-
Because this is phpfreaks, not perlfreaks. Though admittedly the latter rolls of the tongue better...
-
hey now, I made an irc bot in php!
-
you don't need preg_match for this, you can use stripos
-
No, the mbstring regex functions are not deprecated. Was that an oversight, or did they specifically decide to make an exception?
-
2 legit use cases, both SEO related: 1) When you link to another site, you are giving that site "power" in search engine rankings. Search engine bots crawl your site and see links to xyz.com and it increase's xyz.com's rankings. To an extent, it also hurts your ranking, because it puts you more into "middleman" territory, which is BAD, especially since link exchange/farms sites utterly ruined that territory for everybody else. In short, you are flagging yourself as a site that is NOT the ultimate goal of a surfer, when performing a query, which is a huge part of moving up natural search rankings. 2) You don't want other sites looking at who is referring to them...and then selling spamming the fuck out of you, or selling your info to other sites who will happily spam the fuck out of you. Also, they will see that traffic comes from you and adjust their own SEO efforts accordingly. Bid on some keywords more directly related to you, even if they don't necessarily relate to them. This can hurt you because a) you could be bidding on those same keywords, b) it may moreso pit you against them in natural search rankings. In short, websites will happily step on other websites to gain higher ground, and this sort of thing is you bending over and holding out your hands to hoist them up. Is it "bad practice" to do this? Not necessarily. Afterall, that is kind of why the "no follow" thing was added. The problem is, it doesn't really stop #2 from happening.
-
We get posts asking about this error on a fairly regular basis, so here's a sticky detailing the error and what to do to fix it. PHP has a number of POSIX regex functions for performing regex matching/replacing/splitting. All of these functions are deprecated, which means they are currently still available in php, but are going to eventually be removed from a future version of PHP. This is an "annoyance" to you now, because it causes an error, which may or may not show up, depending on what your error reporting settings are. This is bad news for you in the future, because your code will break when you upgrade to a future version of PHP that no longer supports these functions. The solution is to convert the POSIX functions to one of the PCRE regex functions instead. Here is the manual entry summarizing the differences, as well as what the PCRE function replacements are. For most cases, you simply have to pick the PCRE equivalent and wrap a delimiter around your pattern. You may also need to use the i modifier if you are using a case-insensitive POSIX function (eg: eregi vs. ereg). Example: Check if a username is only numbers, letters (case-insensitive) and 6-12 chars long. POSIX regex if ( eregi("[a-z0-9]{6,12}",$username) ) { // good username! } else { // bad username! } PCRE regex if ( preg_match("~[a-z0-9]{6,12}~i",$username) ) { // good username! } else { // bad username! } In the PCRE regex example, I use ~ as the delimiter and added the i modifier to make the regex case-insenstive. If doing this doesn't fix your problem, then more than likely your pattern itself has POSIX-specific stuff in it, and you will need to change that, in which case, feel free to post in this forum asking for help.
-
Okay well in my head, "hide the referrer" and make it "thinks the referer is the first Iframe" (from OP) are two different things. If you want to "hide" or obfuscate the referring URL from the target page, the bottom line is there is no elegant, 100% way to do this (see ignace's post for a link to what you can do).
-
Okay, you need to be a little bit more proactive in a) explaining what you actually want, b) being our eyes as far as what is actually happening. Do you see your div update with that 'Retrieving...' message? In firebug there is a Net tab. Do you see a request being made to your script when you click the button? If so, does the request show your data? Don't just tell us "It doesn't work," tell us what you DO see happening.
-
Doctor Who Red Dwarf Hyperdrive Green Wing
-
We can discuss it internally, but I for one am not a fan of letting users reorganize the order of the forums. Well okay, let me rephrase: as long as we can make it to where we can always have xyz forum on top no matter what, and users can reorganize anything else under that, then I am fine with that. Basically I always want the announcements/question/comments/etc.. forums to be on top.
-
It is not. It is a general principle, language agnostic. I'm actually surprised to see coders who haven't heard of GIGO...I guess it's an "old school" term not really used anymore? Which is kinda odd to me, since it still holds true as a principle to this day... wtf do classes teach you kids these days?!? And on that note... How is any less vague than the OP? MOAR GIGO.
-
iframes will show the immediate parent page as the referring URL. So to answer your question exactly, if you have iframe content within iframe content, yes, that inner iframe will show the iframe as the referring URL. However, I suspect what you may really mean is, "Is there a way to make the 2nd iframe think the referrer is the top/parent page?" And the short answer is no. The more complicated answer is no, there's no way to make it think the referring url is the parent page, but you may possibly be able to find out that parent url, if the iframed page you want to act on, is on the same domain as the parent domain. Basically you will run into XSS issues if on different domains. But if the pages are on the same page, you can work your way up the DOM ladder to the parent page and get the url (or in case the "middle-man" iframe is diff domain, you can do top.location.href on the inner iframe). But if the inner iframe page is on different domain than the top page, only way to find that out, is to explicitly pass the top URL as a query string param to each iframe src attrib and grab it from there. In any case, this: <iframe src='http://www.google.com'> <iframe src='http://www.phpfreaks.com'></iframe> </iframe> ...is not possible, that's not how iframes work. The stuff you put between an iframe tag only gets rendered if iframes are disabled or are otherwise not renderable in the browser. Basically it's the equivalent of a noscript tag, used to show alternate content in the event that the iframe will not render. Example: <iframe src='http://www.google.com'> sorry, your browser doesn't support iframes! </iframe> This will attempt to load the contents of google.com on your page (within the iframe boundary...normally you specify height and width attribs in the tag...). But if for some reason your browser hates iframes, it will instead show that "sorry, your browser doesn't support iframes!" message. Here is an example of how a real iframe-within-an-iframe works. Make 3 pages: test.php hello from page 1! <br/> <iframe height='50%' width='50%' src='test2.php'></iframe> test2.php hello from page 2! <br/> referring url: <script type='text/javascript'> document.write(document.referrer); </script> <br/> top url: <script type='text/javascript'> document.write(top.location.href); </script> <br/> <iframe height='50%' width='50%' src='test3.php'></iframe> test3.php hello from page 3! <br/> referring url: <script type='text/javascript'> document.write(document.referrer); </script> <br/> top url: <script type='text/javascript'> document.write(top.location.href); </script> This will output something like this: In this example, all pages are on the same crayonviolent.com domain, so you can see the both referring and top url values. But lets say the pages were located at: site1.com/test.php site2.com/test2.php site3.com/test3.php You will still see document.referrer showing the url the script was included on, but the top url will no longer work. It will either display nothing or undefined depending on the browser, and you will see an access denied error thrown (XSS). But you can do for example: site1.com/test.php site2.com/test2.php site1.com/test3.php Since test3 and test are both on the same domain, you will be able to get the top url.
-
IMO the issue here basically boils down to "I have no idea what I want to build (or else I'm not telling you), but can you tell me which tool is better for the job?" GIGO.
-
At best, the question is too vague.
-
Nope, you haven't. And that's why you continue to get trollish answers. If you want better answers, ask a better question.
-
also, going with a paid solution guarantees a certain level of support that you just can't get from free solutions.
-
now hold up here, *I* call shenanigans. "sims" games aren't technically what jesi was looking for, "zero player" games ARE, and I pointed that out first. It just so happens that some sim games offer settings that can (sometimes) act/behave like "zero player" games. "But you didn't actually give game examples!" you say? Technically true. HOWEVER, I *was* going to specifically mention the game of life, but since it is listed right there at the beginning of the link I gave, I opted not to post it here, since she would quickly see it soon enough anyways. So I TAKE your cupcake and I EAT it.
-
are you looking for a specific game you once played, or just more games like that? If you are looking for a specific game, can you provide more details about what you remember about it? If you are looking for more games like that, "zero-player games" is what you are looking for, and alternatively, a lot of simulation games offer various modes/settings to effectively do the same thing.
-
http://en.wikipedia.org/wiki/Zero-player_game
-
Nope. I subscribe to the "Fuck you, pay me" school of business. In my experience, people offering equity are those who are too cheap to pay for quality labor while desperately trying to get their ill-conceived and doomed to fail Facebook/Twitter/Kickstarter/Craigslist clone launched ASAP. This more or less mirrors my sentiments exactly. If their site/idea is really all that and a bag of chips, then they should be able to come up with the cash to pay for development from friends or family or from a loan (there are plenty of investors out there willing to throw their money at you for good ideas). But if I were to consider it..it would have to be something I believe in and want to put my own self into. It would have to be an equal partnership, sort of thing.