-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
p.s. - storing delimited values in a single cell in a db table is generally a bad idea. It will make it a lot harder for you later on if you want to write something that queries the db looking for individual values. I highly recommend you store your data in separate columns instead of a single column.
-
$string="Wed Jul 04 08:23:55 EDT 2012, johndoe(192.168.0.190) to all: testeeeeeeeeeeeeeeeeettttttttttttttttttttt"; preg_match('~([^,]+),\s*([^(]+)\(([^)]+)\)[^:]+.*)~',$string,$parts); array_shift($parts); // unset($parts[2]); // uncomment this line if you do NOT want IP address included $string = implode('|~|',$parts); echo $string; Output: Wed Jul 04 08:23:55 EDT 2012|~|johndoe|~|192.168.0.190|~| testeeeeeeeeeeeeeeeeettttttttttttttttttttt
-
Perhaps if you stop smoking the weed, your mind will be more clear... Also, do you really think your teacher is going to like seeing a game about drug dealing? Do you really think nobody is going to start eyeballing you more for this? Running around telling the whole world "HEY I SMOKE WEEEED!!" is a good way to put yourself in a position of NOT getting to smoke weed. Just sayin'...
-
Ok need help with tring to pass a variable to the same page
.josh replied to xtrax's topic in PHP Coding Help
did you echo out $ID to see if it has the expected value? If so, one thing I see is in your condition: if($_GET['page']=='$ID'){ You are using single quotes around $ID. Single quotes do not parse variables, you have to use double quotes. But you don't even need quotes around your variable in the first place. -
sounds like you are making an ajax call. Right before the ajax call, show your msg. append a div with a high z-index or something, I don't know how the rest of your site looks.. and then in the success callback function where you get the results, remove the div.
-
Hello All, We plan on moving from SMF to IPB (the forum software). If all goes well, all info should be ported correctly (login credentials, posts, etc..). Below is our migration schedule: Friday, Sept 21 - The forums will be put in read-only mode and will possibly be taken completely offline. Saturday, Sept 22 - Most of the main conversion process should be done, however we'll need time to do things like rebuild thumbnails for users & attachments (which takes a while for a board our size.) Sunday, Sept 23 - Internal testing will occur that morning with our staff, and will re-open if no issues popup. Monday, Sept 24 - All is back to normal, however some hotfixes might be required and thus some downtime might occur. Please let us know if any issues you spot. Our IRC Channels will remain open all weekend and will not be affected by the forum conversion. The main site should remain up as well, however some downtime might occur with it as well.
-
Well we don't want them either, no takebacks!
-
Basically the issue is that you have .*? which makes for an ungreedy match-all, but the U modifier inverts that and makes it greedy, so it is matching everything up to the last closing p tag. I see you have another thread where you ask about greedy vs. non-greedy, and more detailed explanation was given there. For your other modifiers... s modifier: By default, the . (dot) metachar will match most anything. One thing it does not match is new line chars, the s modifier makes the . (dot) also match newline chars, which you need since you are trying to grab the stuff between your p tags, which spans multiple lines. m modifier: You don't actually need this for your pattern. You only need this if your content spans multiple lines (which it does), but you are trying to match individual lines (by using anchor metachars). Since that is not something you are doing in your pattern, you can remove this.
-
I wish my wife were that cool :/ Uh, not that I don't love my wife, lol... but still...
-
Where do i find my old post sorry mate
.josh replied to hakimserwa's topic in PHPFreaks.com Website Feedback
You can also get to your profile by clicking on the "Profile" link at the top of the page, or clicking on your name in one of your posts. On the left side of your profile page there is a "Profile Info" section and a link called "Show Posts" which takes you to the same link Donald provided you. Also, if you want to see if anybody new replied to your posts, there is a "Show new replies to your posts" link at the top of any forum page, just below the phpfreaks logo. If someone has replied to your thread/post since the last time you viewed the thread, then a link to your thread will be there (also, any thread that you have posted in will show up there, as well). Finally, if you want to follow a post, you can click the "Notify" button in a specific thread. It is in the same line of buttons as the "Reply" button, at the top-right and bottom-right of the thread. You can see your current thread notifications by going to your Profile and under the "Modify Profile" section on the left, click on the "Notifications" link. This page will show you a list of all threads you have flagged for notifications. You can also change some settings about how you want to be notified. -
Do you have any experience in this sort of thing? As in, creating a database? Coding in general? Freelancing in general? What exactly are you asking for?
-
there is one small caveat about this though... it will match on partial matches. For example if you have "some string with John Smithsonian" and you have the name "John Smith" it will match. If that is a problem for you then will have to go back to regex.
-
There are a ton of things wrong w/ your regex but I'm not gonna get into that because you don't really need regex for this. foreach ($event_name as $ev) { foreach ($username_arr as $u) { if ( stripos($ev, $u) !== false ) { // array of found users $found_users[] = $u; } } }
-
Only thing really to add to scootah's code is the i modifier, since eregi is case-insensitive. Also $begin = preg_quote($begin,"/"); $finish = preg_quote($finish,"/"); preg_match("/$begin(.*)$finish/i", $stuff, $cont); edit: I had edited to add preg_quote at same time as xyph's post!
-
If it takes me less than 15 minutes, I usually don't bother. I generally don't bother with large freelance projects, where determining scope can be a timely endeavour. I just don't have the time, and the majority of the clients don't realize how costly custom software can be. The only "free" time I hand out is the time it takes to explain my pricing, philosophies and practices. I'll give the general statements and I'll answer any questions related to that. But once it becomes project-specific in any way, they have to start paying.
-
$100? pfft...that would barely cost even just preliminary scoping out the project w/ me....on that note...you guys aren't charging for that? Why would you waste hours of your time scoping out a project w/out charging for that time? You said it yourself, you just wasted your time in the end. There's a reason why most professional services charge even to take a look at shit and tell you what's wrong or what needs to happen, etc... kinda like the $50 i paid the air conditioner guy just to come out here and tell me what was wrong w/ my air conditioner...not even to actually fix it, etc.. you guys should be charging for that sort of thing. That was free work you just did. I see clients pulling that shit all the time to freelancers; suckering them into free project scoping so that they can get a better idea of what needs to happen, so that they can minimize the $$ they have to spend on the higher end clients. Seen that shit all too often. And I know a lot of clients aren't necessarily deliberately doing that...esp the "one-man-show" clients...they just don't think about that sort of thing. But you're still getting screwed out of your time. It takes time, knowledge, experience, etc.. to work out what needs to be done, negotiate prices, etc.. If you work that into the quote by padding hours a bit then that's cool, but it's a chance you take when you end up not landing the job. I dunno though.. maybe it's been too long since I've done freelance, maybe times are tougher than they used to be. Maybe it's a necessary evil these days to take that gamble. Yet another reason why I'm glad I'm out of the trenches of freelancing.
-
also, you can only make ajax requests to the same domain the script is calling from. You didn't give that level of detail, but just thought I'd throw that out there...
-
@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
-
You can work yourself up to at least Guru membergroup status and be able to post tutorials yourself. Or you can submit to can submit the tutorial to us for review.
-
This thread is not meant to promote using frameworks instead of using core javascript for everything. That is just silly. Frameworks are not alternative languages, they are tools built on existing languages to make certain things easier. This thread is about using a framework for AJAX specifically.
-
What this board is for If you have some code you are wanting people to debug, or a website you are working on that you want people to 'beta test,' post the code/link here. The idea of this forum is that you have finished your code, and now you wish for people to test it for weak spots, logic problems, etc.. While you can of course expect feedback from your testers, if you need more help fixing your code, use the Help forums. This forum is for testing and testing feedback ONLY. This is NOT a "rate my script/site" forum. Please go to the critique forum for that. Try to give a good description of what your code is supposed to be doing. We can do little more than find syntax errors if we don't know what it's supposed to be doing. Your topic doesn't show? All new topics are moderated, meaning that they will not show up until a staff member approves it. Read the rules for posting in this forum and follow the directions. Some advice to be cautious Be very careful on what kind of info you post, especially when it comes to posting links to your site. Posts of this nature are often times aliases of "please try to hack my site and tell me if you do, and how, so I can fix it." We cannot and will not be held liable for any kind of damage or loss that results from you posting any of your stuff here (or anywhere else on the site, for that matter). Not everybody out there is honest. Someone out there may read your post, go to your script, find a security hole and exploit it without telling you, all the while giving you the thumbs up. Rules Regarding "Exploit Scanners" Use of exploit scanners can be an effective way to discover exploits on a website, so we have no intention of banning posting scanner results. But these scanners can also return bogus results. Secondly: Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime. As of now, posting scanner results is only allowed under the following conditions: 1) You must share the name and how to get the scanner 2) You absolutely MUST explain every item in the result (why is this a risk, not just because the scanner says so) As with all forum rules, ignoring these could lead to moderation action. Ignorance of these rules is not a defense. Thank you for your cooperation.
-
...and you are NOT using a framework like jQuery or Prototype, think long and hard to come up with a very good reason why you are not! In all my years of coding, the only valid reason I have ever seen for not using one of these tools, is because someone is trying to learn it the old fashioned way (but not necessarily actually build websites with it). Or...someone is trying to build their own framework. That's it! IMO there has been no other reason worthy enough to warrant not using jQuery or the like! "It will bloat my website, increase page load time, blahblah" is not a good enough reason! These frameworks are compacted and browsers will cache them! So if you post an AJAX question here and your code and/or question does not involve the use of an existing framework like jQuery, then be prepared for you first response to be something along the lines of "Why aren't you using a framework?" Seriously. It is super easy. Way easier than that code you're trying to post. Save yourself the headache. Get jQuery or similar. DO IT.
-
Also, since we probably won't be jumping in individually welcoming every single person comes by, here's your generic welcome message: Greetings, ___________ ! Thank you for joining the board! Feel free to ask any question, but please don't be stupid about it. Make an effort to pick the right forum, make an effort to be detailed about your question, make an effort to read relevant stickies/rules, and we'll make an effort to help you. .CV