-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
wait..all you want to do is simply list the most recent 10 right? you don't need all that extra code and conditions and stuff. The initial scandir gets all of them into the array and orders it by most recent. If all you wish to do is list the first 10, then simply do a for loop, from 0 to $toplist (it looks like $toplist is your variable that holds 10 so you can change it to something else?) for($x = 0; $x < $toplist; $x++) { echo $file[$x]; }
-
Deleting several Posts by the use of checkboxes.
.josh replied to liam1412's topic in PHP Coding Help
okay then you might also enjoy this bit of advice: if you have a list of checkboxes and you do that, it will post the ones you checked, but the array will always start at 0 and count from there, so even if you check the 1st, 5th, 6th, and 8th checkbox out of 10 (for example), the array will be posted as $select[0]-$select[3]. The point is, you don't know which checkboxes were checked. To get around that, you can explicitly assign the array position in the form, like name = 'select[0]', name = 'select[1]' etc... that way it will post the $select array, but the info will be posted in the specific element positions, so you can know which ones were checked. -
thx for that! okay yeah...there really isn't anything there that netadmin doesn't do. it's just a different style/layout.
-
$count = 0; while($file[$count]) { if($file[$count] !== "." && $file[$count] !== "..") { echo "this is " . $file[$count] . "<br>"; $count++; } } or foreach($file as $val) { if($val !== "." && $val !== "..") { echo "this is " . $val . "<br>"; } }
-
okay, you're going to have to modify it a bit. first, scandir accepts the actual path string as the first argument, not the resource handle, so you would use your $dir var not that $dh resource handle. It should look like this: $file = scandir($dir, 1); 2nd, scandir returns an array of all of the files, so you don't need to include it in the loop. You will have to loop the $file array that is returned, to display your info though.
-
well it's pretty much the same as readdir. mostly. just give it a try.
-
The only thing you should have to change is use scandir instead of readdir and set the sort order argument to 1 (did you look at the link to the manual I sent you?)
-
[SOLVED] Php authentification, and flash remoting.
.josh replied to Ninjakreborn's topic in PHP Coding Help
okay it worked now. I'm not seeing any problems with entering text in. The only thing I am seeing issues with is the name. But I can't know if that's flash or php, without looking at the whole setup (like the .fla file for flash, etc..). If you have gone down and made sure everything is being referenced right in flash, etc.. and also on the php side, then I'm afraid I'm out of suggestions. All I can really do from here is if you give me access to the scripts and source files and maybe I can find something you missed or something... but I'm not going to do that, because then that would turn this into something you should be paying for... I would suggest contacting the person who made the flash chatroom. Technically speaking, you didn't mention this was a 3rd party script... -
[SOLVED] Php authentification, and flash remoting.
.josh replied to Ninjakreborn's topic in PHP Coding Help
it says login failed -
yeah site5.com has their own "home-brewed" cpanel, called netadmin. I like it, but I do wish it offered cpanel as an alternative, because I've only messed around in cpanel a handful of times, and seeing as how cpanel is really popular, I would like to know my way around it better. Not that netadmin in any way fails to measure up to cpanel. It's just a different style.
-
[SOLVED] Php authentification, and flash remoting.
.josh replied to Ninjakreborn's topic in PHP Coding Help
so just out of curiosity, does your actionscript call the php script to get the username/message every cycle? By cycle, I mean every time the frames loop; I assume that this being a chatroom, in order for it to be "live" you have the actionscript looped, constantly getting the most current info from the db through php. I'm just trying to narrow this down here and find out if php is at fault or actionscript is at fault. Maybe you aren't properly handling the variables inside flash. -
okay sorry, my brain was somewhere else. Actually, if your filename looks like this: 020107-11-57am - Test.php you can use scandir() to sort it in descending order, because the more recent the date/time, the higher the number string will be.
-
You can first read everything and put it into a multi-dim array and reverse the order and then loop through it, with your tables. edit: i guess i should actually look at your code.. yeah I think doing the multi-dim array thing is your best bet
-
php code library ---- Its empty!!!
.josh replied to larry777's topic in PHPFreaks.com Website Feedback
well that settles that. thread closeded. -
[SOLVED] Php authentification, and flash remoting.
.josh replied to Ninjakreborn's topic in PHP Coding Help
so your name initially appears in the flash interface? -
I used to register domains at registerfly.com but a couple months ago xfered my domain names over to godaddy.com. My stuff is hosted by site5.com though.
-
[SOLVED] Php authentification, and flash remoting.
.josh replied to Ninjakreborn's topic in PHP Coding Help
First off, you select id, emailaddress, is_admin but you list $uid, $nickname, $is_admin. is the user's nickname supposed to be their email address? I don't think that's necessarily related to your problem though. As far as your problem: You say all your other things are being registered except for your nickname: a) I don't see anywhere in the code you posted where you insert anything into your db. b) are you sure it's not being inserted? Did you actually check the db to see if it is physically there? This might narrow down your problem. Maybe it is being registered, but it's just not displaying correctly (from your code above, I guess...) c) if it is not being inserted into the database, check to make sure your variable is spelled correctly in your actionscript. Make sure that your dynamic text field is properly labeled, with the variable name there and everything. Make sure you are using the right path to the object when you reference it (like _root.blah.varname or whatever). d) if all of that is right, make sure you spelled your var name right in the php script that is getting the info from flash, etc... I can't really check to see if it looks solid, seeing as how you didn't post any of that code. e) if you still haven't found the bug after all that, post the code where you get the info from flash and insert it in the db. -
php code library ---- Its empty!!!
.josh replied to larry777's topic in PHPFreaks.com Website Feedback
hmm... it used to be full of all sorts of code snippets and stuff. I wonder if someone accidentally messed something up... -
LoL, it's not really THAT hard... I mean, you use variables to push data all over the place and manipulate it etc... in the first place. It really is the same concept. It is good for things where you don't necessarily know what all of the variables would be. Like for instance, making a configuration file for your program...kind of like php.ini, actually. Turning certain flags/options on/off will create/not create x amount of variables with whatever names. You wouldn't want to waste the memory by creating variables you aren't going to use, would you? But you don't know what the user will turn on/off. That's where variable variables come in.
-
$user and $pass are not the same as $_POST['user'] and $_POST['pass'], unless you have your register_globals set to ON, which you shouldn't.
-
well this might be a dumb answer, but you say the filename is password.php but in your code you include up.php. Did you mean up.php or is that the problem? edit: whoops. didn't see your $pull thingy..sec
-
The short answer is that you can't. However, you can keep track of the user's activity with a timestamp column that is updated every time a page is accessed/refreshed, and then base your userstatus on the timestamp being no longer than x minutes/seconds or however long you wish.
-
well, the manual has some examples...
-
[SOLVED] Warning message when I try to run script
.josh replied to mariocesar's topic in PHP Coding Help
so did you try including your config.php in your changepw function? -
well, what's the principle behind variables? Variables abstract data. Variable variables are the same principle, but taken one step further. Variable variables abstract variable names.