-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
The code you provided seems to work just fine for me. It lists all the files in my directory except the . and .. <?php $site_root = $_SERVER['DOCUMENT_ROOT']; $images_dir = $site_root; // I took out the path so I could test it on my server $dir_handle = opendir($images_dir); while($file = readdir($dir_handle)) { if(is_file($file)) { $fileCount++; echo "$fileCount - $file<br />"; } } ?>
-
complex logic help needed which is best switch or if in this case
.josh replied to kb9yjg's topic in PHP Coding Help
When I make a search engine type form, instead of making a query for every single possible combo, I try to set up the form so that I can I build the query string up piece by piece. The key is to look at all of your combos and find the common denominators and reduce, just like you learned in 2nd grade math, only you're using words instead of numbers. -
You can setup a condition in your loop to not count them. p.s.- no there's not really a "better" way to do it.
-
well I suggest you post it in their feature suggestions forum. I mean, we just use their software; we're not really affiliated with them.
-
/fail
-
There was a good reason for his topics being moved: they weren't in the right place, lol. On a more serious note: I don't really see how you can call moving a thread from one place to another "abusive conduct." And if by "disregard for members" you mean you weren't consulted about the topic being moved, well I guess I'm guilty on that count. Sorry. Next time I'll make sure the Topic Forwarded thread is cc'd to your inbox. On an even more serious note: Although we do have stickies and stuff to explain why the forums are called what they are called, we concede that most people don't bother reading them, and therefore would nonetheless be confused about the intentions of "PHP and MySQL," so therefore we have decided to remove the "..and MySQL." Doesn't it make you feel all warm and fuzzy inside to know that your input has made a difference? Proof positive that even the little guy's voice does not go unheard.
-
I wouldn't mind seeing a little quick link icon or something next to the username or somewhere on the user's postbar. However, this board is SMF, and although it would be an extremely easy thing to add, we don't want to have to keep up with making sure our own mods/hacks are compatible with the board every single time a new version is released. We've already been down that route and it's not really worth it. On the other hand, the last time we tried out that sort of thing, we only had 2 people with that kind of access and neither of them was really available to do that sort of thing. Maybe perhaps since we have more people with that kind of access and since they do seem to be around a lot more, it might be a possibility. On yet another hand, those same people already have their hands full with the main site. I personally wouldn't mind being in charge of doing stuff like this, but I don't have that kind of access.
-
Just another product of people willing to give up their rights due to 9/11. Don't worry though. The government is working hard to make devices capable of reading your thoughts and then those will be illegal too. hahahaha laugh it up now while you still can. Don't worry, I won't tell you I told you so...I wouldn't even think about it.
-
-
how do i unsubscribe from phpfreaks.com ?
.josh replied to carterson2's topic in PHPFreaks.com Website Feedback
unsubscribe..what do you think this is? This ain't no revolving door. Welcome to the hotel california! muahahahahahaha -
$conn = mysql_connect("localhost",'dbname','dbpass'); $db = mysql_select_db("dbname", $conn); $sql = "select * from table"; $result = mysql_query($sql, $conn); while ($list = mysql_fetch_assoc($result)) { foreach ($list as $key => $val) { echo "$key : $val <br />"; } echo "<br />"; }
-
[SOLVED] if(){}if(){}if(){}else{}if(){}return False;
.josh replied to Rebelrebellious's topic in PHP Coding Help
ahh dammit you know i noticed that very thing and I almost posted something about it but I wasn't sure since I didn't know the context of your data and then I got distracted. GJ! -
sorry I meant to move it to html I highlighted the wrong forum in the dropdown. edit: Oh I see what happened. The thread was originally in the PHP help forum and I meant to move it from there to html help but someone else beat me to it when I was still on that screen so it was already here when I highlighted it and ended up highlighting the next one which was css.
-
[SOLVED] Slight change in code, now I have blank page why?
.josh replied to dmccabe's topic in PHP Coding Help
If I remember correct, you can toggle it in wamp's settings menu, or you can edit the config file yourself, or you can toggle it in your actual script with this: http://us.php.net/error_reporting -
yep. your blah.fla is a source file. You need flash to compile it into a .swf (I think there are also some free programs out there that will do that, but not 100%, might want to google it). Once you do that, you would use the html embed tag to put it on your webpage. Moving to html help.
-
[SOLVED] if(){}if(){}if(){}else{}if(){}return False;
.josh replied to Rebelrebellious's topic in PHP Coding Help
Okay well I'm afraid I can't personally make sense of your code's intentions without seeing some example data (like, what you are feeding it vs. what it's supposed to look like, etc...) so I'm gonna kind of see if I can throw out there how I see the logic of the actual code. Maybe you can confirm or deny it or whatever. I see it like this: A - 1 - if arg = 0 do this 2 - if arg != 0 do this B - if arg > 1 do this C - 1 - if arg > 2 do this 2 - if arg <= 2 do this so let's use example numbers here: arg = 0 A - 1 - if arg = 0 do this : executed 2 - if arg != 0 do this : not executed B - if arg > 1 do this : not executed C - 1 - if arg > 2 do this : not executed 2 - if arg <= 2 do this : executed arg = 1 A - 1 - if arg = 0 do this : not executed 2 - if arg != 0 do this : executed B - if arg > 1 do this : not executed C - 1 - if arg > 2 do this : not executed 2 - if arg <= 2 do this : executed arg = 2 A - 1 - if arg = 0 do this : not executed 2 - if arg != 0 do this : executed B - if arg > 1 do this : executed C - 1 - if arg > 2 do this : not executed 2 - if arg <= 2 do this : executed arg = 3 A - 1 - if arg = 0 do this : not executed 2 - if arg != 0 do this : executed B - if arg > 1 do this : executed C - 1 - if arg > 2 do this : executed 2 - if arg <= 2 do this : not executed arg > 3 : same as arg = 3 -
add it to what? You can generate .swf files in php using libraries out there like the MING library, but as far as I know, there is no way to generate a flash source file (.fla) through php. If this is not what you are asking, then be more specific.
-
[quote author=Cloudy link=topic=112560.msg900789#msg900789 date=1212071168] Howdy! This sounds like a good enough place to make an introduction. 26.M.Married (Almost 2 months now!) I live in a medium sized flat in Michigan. I've got a meanie of a cuddle bomb Cat. I've played around with PHP off and on for several years now and am excited to learn more about the language. I'm big into LOST, portable gaming, and Any and All things Zombie. [/quote] My wife is a huge LOST fan. I watched the first 2 seasons on DVD right before season 3 came out. I liked the first season a lot, but I thought it lost (haha pun intended) something going into the 2nd...dunno what though, just thought it wasn't as great. Started watching the 3rd season and gave up after a couple episodes. I've seen several newer episodes (including the currently aired ones) from time to time, since my wife watches it, but I just think it's gone to crap now. I have yet to see any new episode that's made me want to go back and watch all the ones I have missed, or keep watching it, other than when it happens to be on and I happen to be in the room. Come to think of it, I don't really follow any series anymore. Things have just been getting to be more and more crap. I guess that's a sign of me getting old :O I did enjoy watching Eli Stone though :) . Well, I'm happy they picked it up for another season, but I wouldn't die if they hadn't. edit: Oh yeah, I guess I have been watching Battlestar Galactica. I don't think it's completely the uber awesome people make it out to be, but it's interesting enough to keep watching. I haven't seen any of the current episodes yet. I netflixed the first season about 2 months ago and I'm about halfway through season 3 now.
-
First question: I'm sure there's a better way than this, but: <?php $s = " Hell o There"; $a = explode(" ", $s); $a = implode("", $a); $a = strlen($a); echo $a; ?> 2nd question: Okay, this is the 3rd time you have asked the same thing. Personally I think the first question was a thinly veiled attempt to pass your question off again. If you cannot follow the rules, action will be taken against you. Thread closed.
-
there is nothing syntactically wrong with any of the suggestions...or the OP's posted code. So the only thing we can really do is ask him what he means by "it's not working." Is it insecure? Yes, but that's not the question (unless "it's not working" means it works, but it's not secure, but again, he needs to explain). At face value, all I can say at this point in time is that what he initially posted is in fact his entire code, in which case, I would ask him about connecting to the database first.
-
Please do not make multiple threads asking the same thing.
-
Do you get any errors? If so, then what? Without that info, I'd say check to make sure your table and column is spelled right (and exist). Is that the full extent of your code? Because if it is, then you need to connect to your database first...
-
sorry can you please post the code with the form in it too?
-
eh, I suppose I will agree with that. I agree that it would stop duplicates from happening from that venue, but I just think that since it's so easy to "get around" that, many people don't bother at all. Or perhaps for whatever reason(s) they just don't care, or look at it as some kind of issue. I guess first and foremost you'd have to judge the site on an individual basis.
-
As far as it printing twice: can you repost your current php code since I'm sure you've fiddled with it by now?