-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
hmm okay, well here are some possible reasons it's not working: - you are using a browser that doesn't have .onunload (it is not a standard) - I noticed specifically that the function is being called on unload, but alert is being blocked in my current version of FF and Chrome. You could try using .onbeforeunload instead... window.onbeforeunload = goodbye;
-
So you tried changing this: window.onunload = goodbye(); to this? window.onunload = goodbye; notice the lack of () after the goodbye. p.s. - my username is .josh and the "advanced member's" username is nogray. Our usernames are in the light blue header of each post, same as where it shows your name!
-
so are you saying you get that "Thank you for visiting. come back soon!" message when your page first loads?
-
preg_quote escapes all characters in your string that mean something special to the regex engine. The dot is escaped because it is a meta character that matches (almost) any one character. Since you want to match for a literal dot instead of any character, it is escaped. So in other words, it is working as intended. p.s. - If you had read the manual entry for preg_quote, you would have seen this right there at the top. In case you didn't know, php.net has a nifty shortcut to their functions, just go to www.php.net/functionNameHere
-
Likely your problem is with your server-side code; at face value I don't see anything wrong with the js. If you posted your server-side code on pastebin, the link is invalid, so I cannot see it.
-
According to the documentation, it will remove the target element and all elements within it, including any events bound to it. As always, the best way to find out if it works for you is to try it out.
-
3.3m USD to build a website: what are your thoughts?
.josh replied to peppericious's topic in Miscellaneous
$100/hr is pretty damn cheap for an agency to be charging...I doubt many do, except for possibly a super small company of like 5 people... I would expect an enterprise level agency to be charging more like $250-$300/hr minimum. I don't really get involved in the money end of things at my job but I've seen a few SOWs of ours and from 3rd party agencies for clients we've worked together with, and that's what I've seen... -
3.3m USD to build a website: what are your thoughts?
.josh replied to peppericious's topic in Miscellaneous
I'm guessing you probably have little or no experience trying to do projects for big companies or governments. There is a lot more cost associated to doing a project than the actual coding of the website. I have done plenty of projects with big company clients where we easily burn through 100 hours just talking about and planning and getting approval for shit...and when it came down to actually coding something..barely a handful of hours of actual coding. Spending (and charging for) 20 hours worth of < 1 hour worth of "coding" is not uncommon in the business world. -
list three websites in this like - "or" operator
.josh replied to toolman's topic in Javascript Help
You need to make a nested loop. The outer loop would loop through links, and the inner loop would loop through your newWin array. Also, this is wrong: if (links[i].getAttribute("href") == 'newWin') { you are comparing the href value to the literal string 'newWin'. You want to compare it to newWin[ii] where ii is the counter for the inner loop (which you don't currently have). But also, this would be an exact match. You would actually want to either do a substring match or else first pull out the domain part of the href. But even then, your newWin values don't have any subdomains listed, so you will need to add them in if you want to stick with exact matches... Also, supposing all that is sorted out, FYI, you are overwriting the onclick attribute w/ that new function. So if anything else is already hooked to it, you are overwriting it. Also, are you using a framework like jQuery? This whole thing would be a lot easier if you were... Also, it would help if you explained what you are actually trying to accomplish when you find matches.. -
Okay well I can't give you any specific insight without knowledge of the tracking script. But are you looking to suppress the code from executing and reporting data, or are you looking to have the data routed to a different "account"?
-
I think perhaps you may want to try using getimagesize instead.
-
read the manual entry for imagesx and imagesy. It requires an image resource, not some arbitrary filename (string).
-
well at face value, you can do this: preg_match("~<td style='font-weight:bold'>(.*?)</td>~s",$file_string,$price); $price = trim($price[1]); But that will 1) require an exact match of that td tag, 2) seeing as how that td tag is pretty generic.. it's possible that there may be other td tags like that on your page and it may match that instead...
-
Does this by chance have to do with a tracking script such as Google Analytics or Omniture SiteCatalyst? I only ask because whenever I see a question like this, it is almost always about tracking code, and making it not pop on dev/qa sites. If by chance this is what it is about, you should know that most tracking tools have solutions for dealing with this. I can go into more detail if that is what this is about.
-
load balancing isn't usually done w/ php...
-
Here you go... preg_match("~.*~",$url,$match);
-
It's when you have to hunt for your thanksgiving dinner but the damn bird keeps running around you and won't sit still.
-
javascript cannot do this.
-
yeah sorry OP but a few questions in I decided to call it quits..I wasn't really diggin' waiting 10-20s per page load.
-
maybe it's just me, but that site runs super slow...
-
The most immediate reason why your regex is failing is because ^ and $ tell the regex engine to match the beginning and end of string. So in other words, you are telling the regex engine that the whole string must be that hash, nothing else. If you remove those anchors, you will get it to match. However... it will match any 32 alphanumeric substring within the content you are scraping. Ideally you should use a DOM parser like requinix suggested, but if you really must go the regex route, this will work and is fairly flexible: $expression='#(id\s*=\s*["\']Qform__FormState["\'][^>]*)?([a-z0-9]{32})(?(1)|[^>]*id\s*=\s*["\']Qform__FormState["\'])#i'; This will allow for some format variation tolerances: random spacing, order of attributes, and quotes. The matched hash will be in $match[2]
-
No, the mbstring regex functions are not deprecated. Was that an oversight, or did they specifically decide to make an exception?
-
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.
-
@kicken: lol I remember playing #2 w/ paper/pen when I was a kid, sittin' in church w/ my siblings
-
I'm a big fan of "generator" type scripts, especially ones that have to do with words. Example: IT Department [name] Generator from seventh sanctum