Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. soo...don't you think you should have mentioned all that in the beginning? I mean how are people supposed to help you when you post a different query than what you are using and a bunch of extra "rules" to follow?
  2. okay then as mentioned, you need to use fopen, fread and fwrite along with a loop to loop through each word on in the file.
  3. LIMIT has an optional offset you can specify. Keep track of the current offset with a variable, changing the offset as you move from next to previous in your code (however you do that, clicking on a link or with a loop or whatever). Offset should be (n-1)*numrows subtracting 1 from n because as with everything else rows start with 0, and then multiplying by number of rows you are selecting (in this case 4). I suggest you read a pagination tutorial as part of pagination is doing something like this.
  4. In general you can have a dot in a directory name so at face value that css.php is just a regular folder name. But more than likely that link is being rewritten to with mod_rewrite to point to css.php and pass someDirectory and style.css as params, something like ../css.php?dir=someDirectory&file=style.css and is done for SEO/search bot/content optimization purposes.
  5. argh too long to edit, new post: anyways, as far as that replace... for instance: <script language="Javascript"> var x = "www.company.com"; alert(x); alert(x.replace(/\.com/ig, ".co.uk")); </script> That replaces both instances just fine. There's got to be more to your code than you've posted or maybe you didn't post the right code.
  6. you can have as many subdomain levels as you want..... a.b.c.d.e.domain.com but yeah...I find it interesting that your .replace has the global modifier and yet only replaces the first instance...but you can for instance have urls like www.somesite.com/page.html?ref=http://www.someothersite.com and then what?
  7. tbh if it were me I'd make that splash page and animation in flash.
  8. first off, that regex is flawed. It will match and replace all ".com" instances in a URL. So for instance if you have something like www.comedy.com you will end up with www.co.uk.edy.co.uk 2nd, there is no easy way to do what you're asking because a domain can have more than one suffix. Could be a single extension like .com or double like .co.uk and there are a ton of them out there and the hostname itself (minus extensions) are completely arbitrary. In short, there is no reliable way to replace all domain suffixes with .co.uk. The "easiest" thing to do would be to create a whitelist of all the domain suffixes you expect to show up and match against that...like if you have a handful of known domains you are wanting to redirect or whatever. But if you are looking to do "any" or "all" and it can be any or all domain suffixes then...I'm afraid you're out of luck.
  9. As pikachu has already mentioned, the proper way depends on what the expected value is. Is the value supposed to be a number? Range? A string? some particular length or format? The first step in sanitizing input is figuring out what value/format you expect in the first place.
  10. but anyways..if you insist on moving forward with your plan...if you are looking to save an array to a flatfile and retrieve and add to it, etc... look into serialize and unserialize. Basically you would do something like : // get current list from your file $keywords = file_get_contents('file.txt'); $keywords = unserialize($keywords); // add new keyword to list $keywords[] = $keyword; // put it back into text file $keywords = serialize($keywords); file_put_contents('file.txt',$keywords); But depending on traffic and what kind of history of keywords you want to keep track of...file could get to large for something like this. Will have to read /write one line at a time with fopen/fread/fwrite. But even then...using a database is your best overall option.
  11. Is there a particular reason you're trying to reinvent the wheel? Tools like Google Analytics, Yahoo Web Analytics, etc... are around for just such reasons as this. Even out-of-the-box, just throwing the default coding on all your pages, will answer those questions for you.
  12. nothin' wrong with that line. Look at lines above it. That error usually means you forgot to close a quote or improperly closed/escaped quotes or something and that line is the first place that failure of handling quotes or other syntax became a problem to parse.
  13. well, virtually all companies benefit from having an analyst on their team. It's what helps them figure out what works and doesn't work for their website, as far as user experience. A good analyst figures out the key actions on a site, looks at the data trends, makes reports to suggest what can be improved on the site to increase conversions (conversion could mean anything from filling out a form to making a sale to any other actionable thing). Most mid to large size companies with websites employ an analyst or two (or whole department) on their own payroll or hire a 3rd party analytics company. As far as 3rd party companies that specialize in that sort of thing, you can start by looking at the "partner" or "consultant" lists of web analytics tools like Google Analytics, Yahoo Analytics, Omniture, WebTrends, etc... for instance here's yahoo's consultant list: http://web.analytics.yahoo.com/ywacn (that's your freebie to get started, you can google for other lists ) All of those companies specialize in helping clients implement tracking code and making sense of the data coming in. More often than not they also focus on SEO/Marketing so you might also want to expand your job search for companies that do that sort of thing, as well. As far as what to go to school for... having some programming background certainly helps. In my experience what stumbling block a lot of analysts have is having virtually no coding experience, which makes it really hard for them to talk to the coders about what they want, or understanding a coder when they try to explain limitations, etc... as far as the whole analyzing part, most analysts I know have at least a business degree of some sort. General business practices, marketing etc.. is good so that you understand the general philosophies and goals of a business (to make money obviously, but the method to the madness is what you're after!). Learning about Design in general, especially user experience best practices (UX) is also a must. Understanding the purpose of A/B and Multivariate testing, etc... You can also pick up a lot of certifications from the various analytics tool companies out there, like GA certification. Omniture offers a ton of different certification courses for implementation and reporting for relatively cheap (starting at like $300 for just straight up taking the tests).
  14. Get into web analytics. As an analyst in that industry, you would do stuff like look at data coming into tracking tools such as Google Analytics, Yahoo Web Analytics, Omniture, etc..look at trends in the data, decide what things to track on websites that are beneficial to clients.. etc... and you would work with coders to implement tracking code, telling them what you want tracked and how values should be, etc... and they would go about doing the actual code implmentation.
  15. Which is effectively the same thing as saying "looks for anything enclosed in double-curly-braces" which salathe's description is overall better because he was explaining the code overall, not just a single bit of the actual pattern. If all you wanted to know was that specific thing, next time be more specific in explaining what you want to know.
  16. hmm...not sure about the alleged deleted post but as for the "edited" part...if a mod or admin edits your post, it will have a note at the bottom of the post. This is something automatically put at the bottom of the post by the SMF software. Only way to get around that is for someone with direct database access to edit your post from there - something I find highly unlikely someone did. And you would have more than likely received a warning about it. The point being, I've never known the phpf staff to ninja edit posts like that (for "regular" reasons anyways...) More than likely you posted something that may have bugged SMF software or maybe it really was a foresight on your end. NOTE: see the "edited" comment below in this post: you would see the same thing in your post if it was edited.
  17. I think what people are trying to hint at here is that there really is no good reason for doing this and consequently, will not provide such code.
  18. You do n=""; every 5th loop iteration. By the time setTimeout actually performs the alert even the first time, the for loop is already finished and the final value of n is "". So it just alerts a blank string every time. setTimeout does not take what the value currently is at the time (a "snapshot", if you will) and put it in some queue. When the alert happens, it takes the current value of n. The overall principle to understand is that setTimeout is not like "pausing" the script (what most languages would call "sleep"). It is asynchronous, meaning it bumps the specified code in the first argument back X amount of time (specified by 2nd argument), but continues to execute other code on the page.
  19. var rating = parseInt($("#cfp").text()); Also, your order of operations in your conditions may be screwy... Do this (and to your other ones): else if((rating > '2501') && (rating < '6999')){
  20. that's because document.write() will overwrite the current document. You should either hardcode the div on the page somewhere and make it initially hidden and then change the content of the div (and the styling to make it visible etc...) or create an object and append it to the current dom (research document.append).
  21. well if you have control over what the format of $text is and you need it to be a string, I would suggest you serialize the data (array) into a string for $text and then unserialize $text when you need it, which will restore it to the original array. If you do not have access to change the format of the $text string, assuming the format is regular (looks like what you have up there, but all the time), you could explode at the delimiter loop through and explode at => for the key => value pairs, basically simulating unserialize(). Though you may run into issues if values happen to be your delimiter or => as well... Otherwise the safest way to do it would probably be to do what premiso suggested.
  22. google jquery dialog. It shows examples of it in action where you download it.
  23. Have you learned any frameworks and 3rd party scripts (like cms scripts like wordpress, joomla, etc...)? Learning existing stuff can open doors for you for clients that use things like that.
  24. no, php cannot do this. You may possibly be able to do it client-side with an ActiveX control.
  25. you could mod-rewrite your url in your htaccess file, or if you can't do that, you can do something like session_start(); if ($_GET['x']) { $_SESSION['x'] = $_GET['x']; header("Location: {$_SERVER['PHP_SELF']}"); exit(); } // perform check and query with session var
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.