Jump to content

WebStyles

Members
  • Posts

    1,216
  • Joined

  • Last visited

Everything posted by WebStyles

  1. Don't get me wrong, It's, by no means, what I do. I never ask questions. I'm only here on phpFreaks to answer as many as I know, but I still thing the above "project" is possible and would be an interesting experiment.
  2. ok, so instead of a 1 and a 0, consider a 0 and a timestamp. if you grab the users timestamp (on login to start with) and then on each activity ( just by using time ), you can then decide whatever you want. Say you want everyone to be logged out after 5 minutes of inactivity... hang on... Just the other day there was another post about this, check here: http://www.phpfreaks.com/forums/index.php?topic=340233.msg1603821#msg1603821
  3. you need to escape your string. check out addslashes and stripslashes
  4. that logout page is also not setting the variable to 0 in the database. Why do you have 2 different logouts? and why on earth would you put login and logout in the same file? what do you even call that file? login? logout? login-logout? it must be confusing. Just create a nice little logout page, and always use the same one. Include mysql statement to reset the database variable in it, before you reset the session array.
  5. this thought has been in the back of my mind since I started helping out on phpFreaks... Can't help but feeling there are people here who manage to finish entire projects with scraps of code they find around the internet and slap together in the most appalling ways, then someone here fixes bits of this 'n that (most of the times without knowing the full scripts or where and how they'll be applied) and suddenly they have a whole project up and running, with probably tons of security holes and memory leaks. It's just scary, but it gave me a cool idea that I hope to try one day, just for the heck of it: One day, I'll come up with a huge project, devide it all into tiny modules, and try to do the whole thing done without having to write a single line of code, just relying on kind people around the forums that will end up writing it for me if I insist enough, (pretending to be foreign and not understanding English)... I figure if I, or someone who wishes to try it, documents the whole thing, not only will they have the project done, but I'll also have enough material to write a fun book on how to get someone else to do your work for you. Just thought I'd share this.
  6. well, to start with, your code will only work if the users actually press your logout button. What if they login and then just close the browser? you should set a timestamp for each login, and then check their activity at regular intervals so you can decide how and when they get logged out.
  7. then the problem is somewhere else. echo $_SESSION['username'] to see what's in it.
  8. or just: if( shell_exec(some codes.....) ){ header("location: images/index.php"); }else{ echo"Error"; }
  9. instead of: mysql_query("UPDATE users SET logged_in = '0' WHERE username = '{$username}'"); try $username = $_SESSION['username']; mysql_query("UPDATE users SET logged_in = '0' WHERE username = '$username'");
  10. I'm quite sure I answered that yesterday. in_array
  11. man.. you just published an entire list of personal email addresses. try strip_tags
  12. Hi guys, (I confess, I didn't read through all the suggestions to see if this one had already been suggested.. Sorry if it has.) Been doing a lot of helping around here and I've noticed most of our answers consist of a <this is how you do it> but... <you can also do it like this> What if there was a little category dropdown (optional of course) when answering so the responses are automatically flagged as "question reply" or "another method" or "security issue" (or whatever) so that the Original Poster can easily skim through the answers... (although they should, some people don't care if there's a better way to do things, they just want a quick-fix) I know, it's a far-fetched detail, but I'm a sucker for little things cheers, Simon
  13. you can do something like this: <?php // list of pages where you WANT <style> to show: $listOfPages = array("news","articles"); if(in_array($_GET['page'],$listOfPages)){ ?> <style> .... </style> <?php } ?> but it's better to have your css in external files.
  14. something like: <script type="text/javascript"> function timedSubmit(){ document.FORMNAME.submit(); setTimeout("timedSubmit()",1000); // 1 second } // initiate: setTimeout("timedSubmit()",3000); // 3 seconds </script> change FORMNAME to whater your <form name=""> is.
  15. or you could do something like this: <?php $outputMessage = array( '1' => 'There are <b>' . $numORD . '</b> PIREPs.'; '2' => 'There are <b>' . $numApps . '</b> applications.<br />There are <b>' . $numLoa . '</b> Leave of Absense requests.<br />There are <b>' . $numHub . '</b> hub change requests.'; '2' => 'There are <b>' . $numApps . '</b> applications.<br />There are <b>' . $numLoa . '</b> Leave of Absense requests.<br />There are <b>' . $numHub . '</b> hub change requests.'; '4' => 'There are <b>' . $numORD . '</b> PIREPs.'; '5' => 'There are <b>' . $numDFW . '</b> PIREPs.'; '6' => 'There are <b>' . $numJFK . '</b> PIREPs.'; '7' => 'There are <b>' . $numLAX . '</b> PIREPs.'; '8' => 'There are <b>' . $numMIA . '</b> PIREPs.'; ); echo $outputMessage[$position]; ?>
  16. I like it man. Cool design for a gaming site. just 1 thing: the bogus text on your footer div (just below the video) seems to overlap the green line a bit, maybe a little more padding. Nice work.
  17. if ($position == 2 || $position == 3) lol. I'm too slow. AyKay47 beat me to it.
  18. what's in $query ? are you doing a JOIN of some sorts ? (please post the rest of the code)
  19. it's being sent through POST, so if you access the page without submitting the form, it will not be present. what you could do to solve that is place it in a session variable, so it will always exist.
  20. $select .= '<option value="'.$file.'"; should be: $select .= '<option value="'.$file.'"'; (missing a single quote on the end)
  21. instead of this line: echo $data['event_name'] .'<br />'; try this: echo trim($data['event_name']) != '' ? $data['event_name'] .'<br />' : 'Database contains empty event name here<br />' ;
  22. You seem to be confusing a lot of things. keep it simple. <?php $rt=mysql_query($query); while($data = mysql_fetch_assoc($rt)){ $dr[] = $data; echo $data['event_name'] .'<br />'; } ?>
  23. use file_get_contents to load the file. explode to seperate the emails into an array, and a foreach loop to remove the ones you don't want.
  24. instead of this: if($_POST['widget-scr[3][image1]'] == $file) $select .= 'selected'; try something like this: if($_POST['widget-scr'][3]['image1'] == $file) $select .= 'selected';
  25. what EXACTLY does not work? post / explain the errors you're getting please.
×
×
  • 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.