-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
so...it looks like you still didn't escape it. Alternatively, you can use a different delimiter than /
-
you don't need those first 4 \d's since your pattern is expecting the 2 \d's after the 20. $input = preg_replace("~/20(\d\d)~", "/19$1", $input);
-
the dot normally does not match \n so it is not necessary to have all that extra junk in there.
-
preg_match('~^Subject: (.*)~',$content,$match); print_r($match); edit: that assumes that there is also a \n before "Subject: ..." you may need to remove that ^
-
anyways, where is this array of dates coming from? From a db? How about doing the math in the query instead?
-
Alternate way to do it. Dunno which is better per se... $mondays = array( strtotime("October 12, 2009"), strtotime("October 19, 2009"), strtotime("October 26, 2009"), strtotime("November 2, 2009"), strtotime("November 9, 2009"), strtotime("November 16, 2009") ); $t = time(); $mondays[] = $t; sort($mondays); $k = array_search($t); echo $mondays[$k+1];
-
okay, assuming that your form elements are called 'day' 'month' and 'year' and you're submitting via POST method, it should look like this: $dd = $_POST['day']; $mm = $_POST['month']; $yyyy = $_POST['year']; $datestring = $yyyy . "-" . $mm . "-" .$dd; $dob = mysql_real_escape_string(stripslashes($datestring));
-
I'm not going to write code for you but the key ingredient is javascript's "window.open"
-
well you can use dd-mm-yyyy in your php. You can display it to the user like that just fine. You just have to go through the extra step of converting it back and forth.
-
php cannot do that. You would need a client-side language like javascript to do that.
-
You can't. That's the standard. If you really want to store it in your own format, you can use a different field type, like varchar, and store it as a string. But then you are going to run into issues when you later on want to go back and do things like only select things between date ranges, etc... My advice to you would be to keep it as-is in the db and you can reformat it when presenting it to the user. The db has built-in functions to reformat it in your query when you are selecting the data. Alternatively there are php functions such as date and strtotime to help you reformat it. Alternatively, since it's simple yy-mm-dd you can just explode at the hyphen and concatenate it back together in your desired order.
-
[SOLVED] user validation always displaying invalid ? please help
.josh replied to Jnerocorp's topic in PHP Coding Help
ah okay I was making sure it wasn't an int or bool type because "true" != true but I see your issue: $validation = mysql_query("SELECT validated FROM `members` WHERE `username` = '$username'") or die(mysql_error()); $validation is a result source, so you are comparing $validated to a result source. You need to use mysql_fetch_array to get the value of `validated`, just like how you did when comparing the passwords -
hmm... it makes no sense that this: $source .= $result; would work, but changing it to this: $source .= urlencode($result); would somehow make an extra url in there. Are you sure you didn't change anything else?
-
[SOLVED] user validation always displaying invalid ? please help
.josh replied to Jnerocorp's topic in PHP Coding Help
I didn't ask you what values you had in your table. I asked you what the field type is. -
String concatenation. $dd = "12"; $mm = "10"; $yy = "2009"; $dateString = $yy . "-" . $mm . "-" . $dd; edit: from above post, yes, you got it right, though with php it's . not +
-
[SOLVED] user validation always displaying invalid ? please help
.josh replied to Jnerocorp's topic in PHP Coding Help
You said `validated` can be "true" or "false"; what field type is `validated` in your table? -
In you opinion, what do you think is the most "badass" built-in php function? Like..."Holy shit I didn't know there was something out there for xyz, I somehow feel like I just learned a new kung-fu move! <swipe hands in air pretending you really know kung-fu>"
-
http://www.phpfreaks.com/tutorial/php-basic-database-handling
-
"level system" is pretty ambiguous... care to be more specific?
-
http://www.phpfreaks.com/tutorial/php-add-text-to-image
-
GENERAL RULES AND GUIDELINES FOR POSTING This forum is not meant to be a formal freelance service system. It is available for those who wish to seek out services or work from other people, as a courtesy to the members of the phpfreaks community. phpfreaks.com does not specialize in freelance services. This forum is an informal mechanism, as a courtesy to the community. We have no formal mechanism in place (like escrow) to guarantee payment, refund, work done, etc... phpfreaks.com shall not be held responsible for any losses you incur. we have never and continue to not act as any kind of mediator or verification/compensation source for people/organizations who use those forums. We will not be held responsible/liable for any damages, loss, etc. that occur from use of those forums. If you hire someone and they rip you off, don't come crying to us. If someone hires you and they rip you off, don't come crying to us. Those forums are a convenience. If you want something more official that offers guarantees, go to a real freelance site! If you have any questions regarding the freelance forum, feel free to ask them here. RULES: WHERE TO POST:If you want to offer your services, post in the Service Offerings sub-forum.If you want to offer a job or position of employment, post in the Job Offerings sub-forum. DO NOT post your 'resume' in job posting threads. You must directly contact the person you wish to reply to. The only reason replies are allowed is to ask for clarification/details about the job. Failure to adhere to this rule will result in all kinds of things, like you getting banned, or us disallowing replies. DO NOT make more than one thread offering your services. You can edit/reply to your thread to reflect additions/changes. DO NOT post advertisements to other sites offering freelance system services. For example, rentacoder.com, odesk.com, etc.. we have no partiality for or against those sites, but posts such as those are regarded as advertisement, which is against our main site rules. We fully acknowledge that this freelance system is limited, but we aren't here to provide free advertising for other places. If you prefer to do actual business through one of those sites, please specify in direct contacts with the person. You are allowed, as a freelancer or freelance company, to post a link to your personal portfolio/company to those sites, or a site that you own. But general promotions to those other sites are not allowed. GUIDELINES: When posting in the freelancing forum it's important that you provide a way for users to contact you. They will not be able to reply to your topics so they need a way to contact you privately. This can be using PMs, emails, any type of instant messaging service (MSN, Gtalk, AIM, Jabber, etc.) or however you see fit.The more specific you are about your skills, previous experience(s), availability, rates, etc.. the better your chances of getting serious inquiries. Posting vague "I'm available for anything and everything" might get more inquiries on average, but there's a good chance that it will come to nothing, based on any number of things that you could have posted here in the first place. Better to receive 10 emails from people who have some idea of your qualifications/terms, than 100 emails that don't.Be honest about your skills. All day long we see people posting about how they jumped on a job and bit off more than they could chew. They tell the client they can do everything they need and more, promise them the moon, and then promptly crap their pants about 5 minutes into it. Don't be that person! Some people get lucky and figure it out. Some people get lucky and get help that figures it out. Most people end up having to give up the project. Which leads us to....Wasting people's time and money. You waste the client's time. You waste your own time. That bad rep will more than likely come back to haunt you. All day long we get people trying to get us to delete their posts because they don't want their skeletons to come out of the closet (no we won't hide them for you). So be smart! Do the simplest easiest thing to avoid all this headache: be truthful about your skills. If you feel that being truthful will limit your potential clients, then get off your bum and hit the books. You can't seriously be in the business of trying to con people, are you?Be very clear about what you are doing. Some clients know your job, and are just looking for extra set of hands. Most do not, and therefore seek someone who does. Therefore, if you want to avoid headaches, it is your responsibility to be very clear about what it is you're going to do. What you're willing to do. What kind of support you offer after the fact, etc... on that note..Be up front and thorough about your prices. Take a look at the situation. Quote a price for it. Quote prices for things that might come up later. The more you have to go back later saying that xyz was unforseen or xyz wasn't part of the deal, regardless of whether or not you are in the right, the more you are going to come off as shady, to the client. It's like when you take your car to a mechanic and that funny noise goes from being one little $50 thing to a $2000 rebuild because the mechanic kept coming back to you saying something else is wrong. That stuff may indeed be needed, but the fact that you didn't think about it and let them know ahead of time speaks volumes about your skills as a coder. Some things just aren't foreseeable. Most things are.
-
I believe thorpe is working on something like that right now. Don't have an ETA or anything.
-
How about a captcha tutorial? Lots of them around, but we're supposed to be a resource, right? I may do it myself, if someone else doesn't volunteer.