Jump to content

RussellReal

Members
  • Posts

    1,773
  • Joined

  • Last visited

Everything posted by RussellReal

  1. foreach ($contacts as $k => $v) { echo preg_replace("/^(.*?&ids=([^&]+?).*)$/","\2",$k); } that SHOULD work.. sorry watching the cooking channel (I'm such a nerd )
  2. I'm sorry.. I think I speak for most people whose viewed this post when I say this topic is EXTREMELY long, and its awefully late here, but I'm going to attempt to help.. lol.. could you show us a print_r of $emails before the foreach loop.
  3. paypal doesn't cost $300 lol... paypal is free, they charge you per transaction.
  4. you should use a different format for your database.. you should make a new row for each date set.. for example: TABLE: dates id | uid | name | dateField | 1 | 12 | Bud | 05/30/1990 | 2 | 12 | Bud | 10/20/2009 | 3 | 10 | Paul | 10/22/2009 | then you just sort by UID to get all the dates in order of person and filtering and any other management type actions are a TON easier
  5. just google for an image upload script.. once you put the file input then all you need to do is handle the file when its uploaded
  6. I'm assuming the datefield is just a text field since your dates are 'xx/xx/xxxx' instead of 'xxxx-xx-xx' DELETE FROM table WHERE STR_TO_DATE(datefield,'%m/%d/%y') < NOW()
  7. <?php // way 1 function formulateDropDown($m) { $arr = array($num = 0); while ($m > ($num += 500)) $arr[] = $num; return $arr; } $s = mysql_query("SELECT MAX(price) As max, id, name, description FROM products"); $loop = 0; while ($r = mysql_fetch_assoc($s)) { if ($loop = 0) { $drop = formulateDropDown($r['max']); $loop++; } // do whatever with your results. } ?> <?php // way 2 function formulateDropDown($m) { $arr = array($num = 0); while ($m > ($num += 500)) $arr[] = $num; return $arr; } $s = mysql_query("SELECT MAX(price) As max FROM products LIMIT 1"); $drop = mysql_result($s,0); $s2 = mysql_query("SELECT * FROM products"); while ($r = mysql_fetch_assoc($s2)) { // do whatever with your results. } ?> not sure which was is faster
  8. I'd LOVE to help you but I just really can't without some more information, post the class here and I'll see what I can whip up .
  9. <?php $dir = "d:\\asecmenu\sample\sample"; $z = new Zipper; $z->open('d:\\asecmenu\sample\zipToMake.zip',Zipper::CREATE); $z->addIntoDir($dir,'sample'); ?>
  10. that would be even worse than using ORDER BY RAND()
  11. can't tell you since you're using your own class there
  12. is what you got so far echoing what you want? lol if so: <?php $it = new RecursiveDirectoryIterator("/home/content/e/n/v/<website name>/html/"); ob_start(); foreach(new RecursiveIteratorIterator($it) as $file) { echo "~\n"; echo $file . "\n"; echo date ("F d Y H:i:s.", filemtime($file)); echo substr(sprintf('%o', fileperms($file)), -4); echo "~\n"; } mail('YourEmail@whatever.com','FileList',ob_get_clean()); ?>
  13. okay.. its a warning which means the loop is gonna terminate because the offset no-longer exists.. <?php error_reporting(E_ALL); $data = "hello {abc(0)}, {ab} and like it!"; $abc = array("worl{d}"); $ab = "eat the banana!!"; $start = 0; while ($start = @strpos($data,"{",$start)) { $end = strpos($data,"}",++$start); $in = substr($data,$start,$end - $start); if ($ns = strpos($in,"(")) { $var = substr($in,0,$ns); $index = substr($in,++$ns,strpos($in,")") - $ns); $repval = ${$var}[$index]; } else { $repval = ${$in}; } $data = str_replace('{'.$in.'}',$repval,$data); $start = strlen($repval) + $start; } echo $data; ?> just throw in the @ to suppress warnings and you're all set
  14. awe! okay I guess. Point taken lets make a party mod instead where everybody syncs up to the same stream of music and the screen flashes in black and white polka dots and vibrant backgrounds so everybody can dance when a topic is solved
  15. r u interested in using regex.. or you want to do this solely in php (well you know what I mean..) regex would be easier but with plain old php you'd do <?php $data = "hello {abc(0)}"; $abc = array("world"); $start = 0; while ($start = strpos($data,"{",$start)) { $end = strpos($data,"}",++$start); $in = substr($data,$start,$end - $start); if ($ns = strpos($in,"(")) { $var = substr($in,0,$ns); $index = substr($in,++$ns,strpos($in,")") - $ns); $repval = ${$var}[$index]; } else { $repval = ${$in}; } $data = str_replace('{'.$in.'}',$repval,$data); $start = strlen($repval) + $start; } echo $data; ?>
  16. for the category field though you can just type-cast it $category = (int) $_GET['category'];
  17. ok then a 'helped by' dialog in the topic solved mod. where it'll pull up a drop down menu with all the users who posted on that particular post and the OP can pick the user who helped them the most or helped them solve the problem and then they get a +1 in their 'help-o-meter' because honestly you can't have people with absolutely no experience helping someone with absolutely no experience, they're gonna break things.. so a way to show a poster who is more reliable is a good way of keeping broken scripts less broken
  18. Reputation, if I helped someone they'd give me +1 reputation, if I managed to mess up their database they'd give me -1 reputation lol, I think thats a pretty good idea
  19. no problemo
  20. lol I put "comments" instead of "comment" change: return str_replace('comments/','',$files[0]); to return str_replace('comment/','',$files[0]);
  21. so sad.. 1,000 posts was like a RECOMMENDED tag under our username now we're all assumable noobs except for the mods and gurus ofcourse
  22. I actually second this =o even tho Daniel already DENIED us
  23. ok judging from the code my post above should put an end to your woes
  24. I WANNA SEE MY POST COUNT :@:@ lol it was like a goal of mine when I got here.. MAN I WANNA HAVE 1,000 POSTS~!!&*%^!&*! and now I've been helping people ever since and like 100 posts afterwards you guys decide to steal my post count away :'(
  25. change return $files[0]; to return str_replace('comments/','',$files[0]); thats the only thing I can see to fix that maybe glob somehow gets the 'comments/' or whatever but if its not THERE it hasta be somewhere else in your script
×
×
  • 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.