Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. As far as your Birth fields. Separated by year, month day in old, but a single string in new; Just select them from the old, and concat them together for the new $newBDay = $birth_month . '-' . $birth_day . '-' . $birth_year;
  2. If you remove the 'at' strtotime will convert it, so you can do $string = "24th Dec 2009 at 13.19"; $string = str_replace('at','',$string); $timestamp = strtotime($string);
  3. do you know how to do basic database interaction with php? Like, pulling data from the old table?
  4. Run the query. Echo a opening select tag. Loop through the results, wrapping option tags around them. After loop, echo closing select tag.
  5. It's been discussed. Several times. Even as far as moving away from SMF in general, not necessarily to vB. I guess the bottom line is it's not a big enough deal to warrant the change at this time.
  6. that line initializes/declares the array, before using it. PHP does not technically need it to work, however, depending on your error message settings, it may output a notice when using an array before initializing it. Apparently your setup is not, uh, setup to show notices, otherwise you would have uh, noticed it. So in other words, it's not necessary, but it's generally good practice.
  7. <?php foreach($CustomerList_result->getRecords() as $CustomerList_row){ $cust_name[] = $CustomerList_row->getField('d_company'); } ?>
  8. And you are posting this here, instead of on the SMF community board...why?
  9. I can vouch for what Dan said.
  10. I don't have a blackberry. Or iphone. I have a retarded samsung gravity Its battery runs out in like 30m (okay that's exaggerating but seriously it runs out in like an hour) and the volume needs to be like twice as loud as it can go. And the manual claims it can use 4gb microSD cards but it will only recognize 2gb. And it doesn't have a regular usb charger so if I lose my charger I have to pay extra money for one. And earpiece, as it uses the same plug. Apparently Samsung doesn't quite understand the concept of locking your phone. I press the * for a couple seconds to lock the keys right, but if I slide it open even a microfraction it unlocks (so it gets unlocked all the time when in a tighter pocket or pocket full of other stuff or even just holding the damn thing). And I tried memory card, bluetooth and direct cable connect; can't even install a fucking game on it unless I go through t-mobile's stupid game download place. And they offer a scant collection of different flavors of CRAP. I don't even mind paying for the damn game, but they don't even offer anything good. I'd like to get a blackberry but I really can't justify it. Can't really even justify having a cell phone at all, working from home. I originally got it thinking hey, I need a dedicated phone line for work, so why not just get a cell phone, no? I do have to call in to meetings on a regular basis but it's been my estimation that I could have just as easily used my home phone and it wouldn't have conflicted with anybody. When I first bought it, I got this unlimited everything under the sun plan, thinking hey, work from home, gonna need it, right? Next month into it I changed my plan to the lowest one they have, and I still don't even use half of that. Like 100m a month I use. But I'm stuck in this stupid contract for a while. Ah well, live and learn.
  11. They all look for a string within a string, but with slightly different behaviors. Read the manual entries for them and decide which one best suits your needs.
  12. .josh

    pages

    I've you're looking to build your own script, the term you are looking for is "pagination" here is a tutorial about it http://www.phpfreaks.com/tutorial/basic-pagination
  13. if it's a simple string within a string (no pattern) you can use strstr or stristr
  14. hmm...dunno about that touché smiley...looks more like a shy smiley. I was trying to visualize a smiley that would be recognized as touché and I guess I can't really think of anything. I guess a nodding/bowing smiley but still seems kind of lacking. Ah well.
  15. PFM was asking the OP to put that in his code and post whether register globals is on or off...
  16. I also thought I'd mention that it looks like from your script you have register_globals turned on and are using them. That is not very secure, and it's also deprecated. So for instance, you should be using $_POST instead of $post and if you have for instance a form field named 'something' you should be referring to it as $_POST['something'] instead of $something.
  17. off the top of my head, couple things to check for: a) make sure you are using session_start(); on all of your pages b) make sure you aren't accidentally for instance doing unset($_SESSION);
  18. $cancelDates[] = date("d", strtotime($r['date'])); You did not update that to reflect the year/month. Also, "d" returns the day with a leading zero, whereas $day_counter will not have a leading zero. You will either want to use "j" which is day without leading zero, or pad $day_counter.
  19. date expects a timestamp for the 2nd argument. So you would need to strtotime $datedone, before using it in date(). But you can skip all that and reformat it in your query.
  20. in_array does a string comparison of the value vs. all the values in the array, so as long as it's formatted the same, no, there's nothing special you need to know. But I'm looking at your code and I see that you have initialized $selectedDates as an array but I don't see anything in there as far as you having any elements in that array, so you're just comparing $fullDate to an empty array...
  21. Really? Because the only difference between what I posted and phpORcaffine posted is that he threw an @ in there to suppress potential warnings...
  22. just remove the condition altogether? 1 $path = "photos/".$date."/".$id.".jpg"; 2 unlink($path); 3 $sql2 = mysql_query("DELETE FROM images WHERE id = '$id'");
  23. You can use cURL to post form data and the results page will be returned as a string of the actual html content (like when you rightclick > viewsource). From there you can use DOM to parse the page for info or use your own custom regex.
  24. right...but the point is, different things would have different formats, right? For instance, you may only want a username to be just letters, no spaces, etc.. or only 5-15 chars long, etc... passwords you may want them to be at least x length long and have at least x amount of numbers or capital letters in them or whatever. You may want to only accept certain emails. You have to figure out what you want to accept for each input field, and then go from there. After you figure out what you do and do not want to accept for each one, you can figure out the best way to validate it. The ideal solution may be regex for one, but not another, etc... You can use regex to verify the format, characters, length etc... But you would actually want to sanitize input with methods such as mysql_real_escape_string. mysql_real_escape_string may not be necessary, depending on what kind of validation is figured out. For instance, if OP decides he only wants to accept letters for the username, I can do this, and there would be no need to use mysql_real_escape_string: if (preg_match('~^[a-z]+$~i',$_POST['username'])) { // valid } else { // invalid } If it's valid, there'd be no reason to escape it, as it would only be letters.
  25. do you do something with $array2d sometime between where you assign it and run that foreach? Invalid argument means it is not an array. ..
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.