-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
Deprecated: Function eregi() is deprecated (Line 18)
.josh replied to TottoBennington's topic in PHP Coding Help
deprecated doesn't mean you can't use it, it means it's advisable that you stop using it because it will eventually go away and not be supported in future versions of php. -
scootah is pregnant? Wait I thought she was a he?
-
sum-1 and sum-2 are divs, they don't have value attributes.
-
Ok need help with tring to pass a variable to the same page
.josh replied to xtrax's topic in PHP Coding Help
I always put it as last. IMO it makes it more clear. Kinda same principle/order as [pre] if // case else if // case else if // case else // default [/pre] -
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...
-
based on the value, I'd put my chips on an a/b or mv test... quick, everybody click on the link and fuck up their test numbers!
-
Okay look, here is a piece of regex that will match "Box 12" and not match "1555 pine box elder rd" .*box(?!\s+[0-9]+$).* This does not match anything before "box" nor does it match other valid (or non, depending on which way you wanna go) formats. The problem is that with regex, you must regard what it is used for. You cannot write a valid regular expression unless you properly scope out the purpose of it. You can't just say "make it do this regardless of what I want it for" because you have to know what you want it for in order to make it work proper. Asking for things like this, and us helping you like this, is not helpful. We know what you want it for. You want to be able to only send to some 3rd party, addresses that are not po box addresses. Please for the love of God and country, stop making this harder on yourself than it needs to be. Or else, please give more explanation as to why you refuse to take the advice given and insist on trying to bandaid up a regex that is not going to work anyway! edit: Actually I had that backwards: .*box(?!\s+[0-9]+$).* will match "1555 pine box elder rd" .*box(?=\s+[0-9]+$).* will match "box 12" It doesn't really matter which you use, just have to reverse condition. But that doesn't take away from the additional statements I made, though maybe it sheds light on what your problem is to begin with: I think you're basically trying to match a negative. Matching for the absence of something is much harder to do in the regex world. Even where possible, it is a lot harder to read/understand the regex involved, and is completely unnecessary, as all you have to do is reverse the condition it is in. But again, your regex does not account for all (in)valid po box formats. Worse, it actually (dis)allows (in)valid po box formats because overall it is poorly written.