RussellReal
Members-
Posts
1,773 -
Joined
-
Last visited
Everything posted by RussellReal
-
PHP parse_str() help needed.. (low priority)
RussellReal replied to nirvana43's topic in PHP Coding Help
foreach ($contacts as $k => $v) { echo preg_replace("/^(.*?&ids=([^&]+?).*)$/","\2",$k); } that SHOULD work.. sorry watching the cooking channel (I'm such a nerd ) -
PHP parse_str() help needed.. (low priority)
RussellReal replied to nirvana43's topic in PHP Coding Help
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. -
How can I "activate" an account after recieved payments
RussellReal replied to Rifts's topic in PHP Coding Help
paypal doesn't cost $300 lol... paypal is free, they charge you per transaction. -
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
-
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
-
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()
-
<?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
-
Targetting multiple variables in an array? Possible?
RussellReal replied to phantomlimb's topic in PHP Coding Help
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 . -
<?php $dir = "d:\\asecmenu\sample\sample"; $z = new Zipper; $z->open('d:\\asecmenu\sample\zipToMake.zip',Zipper::CREATE); $z->addIntoDir($dir,'sample'); ?>
-
[SOLVED] How to randomize mysql_fetch_array($result) ?
RussellReal replied to deko's topic in PHP Coding Help
that would be even worse than using ORDER BY RAND() -
Targetting multiple variables in an array? Possible?
RussellReal replied to phantomlimb's topic in PHP Coding Help
can't tell you since you're using your own class there -
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()); ?>
-
[SOLVED] getting the value in between 2 characters
RussellReal replied to ldb358's topic in Regex Help
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 -
Alternative To Post Count!
RussellReal replied to RussellReal's topic in PHPFreaks.com Website Feedback
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 -
[SOLVED] getting the value in between 2 characters
RussellReal replied to ldb358's topic in Regex Help
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; ?> -
Alternative To Post Count!
RussellReal replied to RussellReal's topic in PHPFreaks.com Website Feedback
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 -
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
-
no problemo
-
[SOLVED] Can't display and link image correctly
RussellReal replied to iamsofuckingcool's topic in PHP Coding Help
lol I put "comments" instead of "comment" change: return str_replace('comments/','',$files[0]); to return str_replace('comment/','',$files[0]); -
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
-
I actually second this =o even tho Daniel already DENIED us
-
[SOLVED] Can't display and link image correctly
RussellReal replied to iamsofuckingcool's topic in PHP Coding Help
ok judging from the code my post above should put an end to your woes -
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 :'(
-
[SOLVED] Can't display and link image correctly
RussellReal replied to iamsofuckingcool's topic in PHP Coding Help
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