-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
What actually happens after php interpreter parses code?
.josh replied to blacktie524's topic in Miscellaneous
Trolls do all the actual legwork. They receive instructions for doing things like open db connection so they run to the db to fetch whatever info you ask (or throw information into it, etc...). Nobody likes trolls, you see them stirring up shit on forums all the time, but we put up with them because they are vital for making the internet work. Also they are kind of funny sometimes. -
IMO freelance forum is good enough - or at least, a good enough compromise. IMO having a full forum like that would just further promote the "Someone please do my work for me for free" agenda many people seem to have.
-
Force new topics to have code in them??
.josh replied to cunoodle2's topic in PHPFreaks.com Website Feedback
We could spend all day coming up with legitimate questions that do not require the posting of code. I agree that it is annoying when someone asks for help and doesn't bother to make the effort to provide relevant details, but there's no way we can really automate qualifying posted content like that within an acceptable margin of accuracy. Anyways, when I walk into a thread and see that someone clearly hasn't made an effort to properly explain a problem and give details, I usually walk right back out the door. I'm not here to help people overcome lack of common sense, and I know from experience that 9/10 times you will be spending much of the time just trying to wrestle info out of someone and get them to stop being retarded about listening to you, than actually fixing the problem. The overall point here is that most people don't "forget" to do things like post relevant code/details. They simply don't do it because they don't think about it at all. Or they somehow think you're psychic. We have posted general rules and guidelines for making posts and even doing it the smart way. We even up until recently w/ forum upgrade had in big bolded red letters a link to the rules/guidelines right above the post button (it got lost in the forum recent forum upgrade and needs to be added back). If people don't bother with that, they aren't going to bother with this other stuff. To sum up, I think I can speak for most people here in saying that we aren't interested in helping people who can't be bothered to help themselves or make an effort on their end. We're here to teach, not do people's work for them, and the more we hand-hold them, the more we promote the notion of not making an effort on their end. -
Most Optimised way of Blocking Whole Country...
.josh replied to natasha_thomas's topic in Miscellaneous
"deny from all" That will ensure they are all blocked -
Regex to Find all "e and replace with quote literal ONLY WHEN..
.josh replied to BizLab's topic in Regex Help
$string = "some random 'link' to [link href="glossary.php?term=myterm"]My Term[/link] blah "blah""; $string = preg_replace('~\[link([^\]]*)\](.*?)\[/link\]~ie','html_entity_decode(\'<a$1>$2</a>\')',$string); -
$var = @$_GET['q'] ; $trimmed = trim($var); $searchpieces = explode("+", $trimmed); $searchpieces = "'" . implode("','",$searchpieces) . "'"; $sql = "select * from gallery where tags IN($searchpieces) order by date DESC " . $limit;
-
You aren't using quotes properly. use single quotes for the outer quotes, double for the inner, or visa versa. Or escape the inner ones.
-
yes you probably aren't handling cookies correctly, setting a cookie jar file etc... but as always, it is hard to help when you don't post code.
-
preg_match('~<!--start editable content-->(.*?)<!--end editable content-->~s',$content,$editable_content); $editable_content = $editable_content[1];
-
Regex to Find all "e and replace with quote literal ONLY WHEN..
.josh replied to BizLab's topic in Regex Help
$string = "[link href="glossary.php?term=myterm"]My Term[/link]"; $string = html_entity_decode(preg_replace('~\[link([^\]]*)\](.*?)\[/link\]~i','<a$1>$2</a>',$string)); -
Well, since you didn't really fully define what you consider to be "normal" symbols, this regex will only accept letters, numbers and any of the symbols above the numbers on your keyboard. if (preg_match('~^[a-z0-9!@#\$%\^&\*\(\)]{8,16}$~i',$password)) { // valid } else { // invalid }
-
I strongly advise against doing this, as MrAdam said, you should NEVER do this sort of thing client-side. But I'm not your mother so here you go... <script language="javascript"> function pasuser(form) { var up = { 'user1' : 'pass1', 'user2' : 'pass2', 'user3' : 'pass3', // etc... }; if (typeof(up[form.id.value]) != 'undefined') { if (up[form.id.value] == form.pass.value) { document.location="http://quickonlinetips.com/"; } else { alert("Wrong Password"); } } else { alert("Wrong Username"); } } </script> <form name="login"> Username: <input name="id" size="6" type="text"><br> Password: <input name="pass" size="6" type="password"><br><br> <input value="Login" onclick="pasuser(this.form)" type="button"> </form>
-
How Do the Google Estimated Ad Clicks Per Day Get Calculated?
.josh replied to chaseman's topic in Miscellaneous
My guess is somewhere in there there is a distinction between total searches by visitors vs. total searches by unique visitors. For example, Search Term 2 may have been physically searched for about 450k times but there could have been a lot of people searching the term more than one time, so Search Term 1 could have more unique visitors searching for the term. And then they could be basing the estimated daily clicks based on unique visitors making searches, which is more accurate than just basing it off of total searches overall because while someone might search the same phrase more than once at the google level, they are far less likely to click on your link on the SERP more than once. I have no idea if that's what's really going on but it makes sense that they would be doing it that way. -
[Suggestion] Unread posts filter
.josh replied to ZacTopher's topic in PHPFreaks.com Website Feedback
Yes, would be nice for a custom filter that lets you specify which forum(s) to show unread posts from in a centralized location, but there is a forum-specific "unread posts" link for each forum (see screenshot attached). You can also minimize the forum sections you don't visit, which helps in having to scroll up or down for the sections you do go to. [attachment deleted by admin] -
The regex tester link you posted does just that: test regexes against a string, and outputs matches. That is not what you asked for. You asked to have the character position of the first occurring digit after the hyphen, not counting what's there at the beginning (interpreted as "between the brackets"). The regex tester cannot give you that answer, because that is not what it does. My code does what you asked for. As to your question about handling strings with no numbers, in my code example, if there is no number, $pos will return NULL.
-
preg_match('~^[^\]]*[^–-]*[^0-9]*([0-9])~',$string,$pos,PREG_OFFSET_CAPTURE); $pos = $pos[1][1];
-
soo...you want someone to maintain a database of current business contact and location information and "other info" (whatever that implies), keeping it up to date etc..provide you with an API to access said information on-demand...and for free?
-
I'm not so sure I agree with putting them in the sticky. That list holds *real* hosts in the sense of whether they offer shared, vps or dedicated hosting packages, it's still do-it-yourself.
-
Well there you have it then. Don't be so quick to pull the trigger and you'll often be surprised about how events turn out
-
S.O.S need help with code links -->hard for me simple for you?
.josh replied to oli22's topic in Javascript Help
That is correct, there currently is no official regex based selector (though why not is kind of beyond me...). However, there are some neat hacks out there that do it. For instance this regex selector code. Just drop it in your jquery file or wherever you keep your plugins (or on page if you want, I guess) and follow the syntax instructions in the link. Also, you can do this with native jquery by making use of .filter() : $('a').filter(function() { return this.id.match(/various[0-9]/); }).fancybox({ // fancybox stuff }); -
and you also need to put these lines before the "while" loop. echo "table"; echo "<tr>"; (and you also need to have "<table>" not "table")
-
remove the "for ($y...)" loop. In the example code, that loop was meant to simulate the "while" loop you already have for looping through the files.
-
And it also says read the ToS to find out the rules/conditions/limitations surround that statement. Do yourself a favor: stop being retarded and accept responsibility for your mistake and learn from it. I know it's really hard in this day an age, seeing as how it seems society encourages you to to point the finger at other people, but that's a pipe dream. Unless you are already on top, you will not get very far by trying to hold other people accountable for your mistakes, and in many cases, you will wind up getting burned even worse in trying to do so.
-
Not sure I understand the question. The example code only outputs one table. It starts out by echoing out the opening table tag and opening table row tag. Then in the loop it outputs a closing and then opening table row tag based on the condition, meanwhile outputting individual table cell tags for each value. Then after the loop, it finishes off by outputting a final closing table row tag and finally the closing tag for the table.
-
hmm..kinda odd that adding slash doesn't do it for you...anways, yes, ([0-9]+) means to match one or more numbers and capture into $1