Jump to content

Corona4456

Members
  • Posts

    244
  • Joined

  • Last visited

    Never

Everything posted by Corona4456

  1. It does persist across refreshes just not when you close and reopen your browser.
  2. <?php session_start(); if (!isset($_SESSION['file'] || $_SESSION['file'] == 55)) { $_SESSION['file'] = 0; } include "file{$_SESSION['file']}.txt"; $_SESSION['file']++; ?> I believe Thorpe has already shown you how to fix this. Have you tried this? Are you not reading? It doesn't seem like you are even considering other's suggestions.
  3. <?php foreach($_POST['selection'] as $k => $v) { $query = 'INSERT INTO tbl_product_risks (fld_username, fld_risk) VALUES ('.$_SESSION['username'].','.$v.')'; mysql_query($query); } ?>
  4. D'oh ... thorpe beat me to the punch on that one . The only thing wrong with the code though is that it's based on a per session basis. Meaning that every user who first visits your webpage will always see 'file1.txt' and then 'file2.txt', etc. If you want each user to see a subsequent file (i.e. User A visits then he/she will see 'file1.txt' and then if User B visits the site after A then he/she will see 'file2.txt'), then I would suggest using a database or reading/writing to a file to keep track of the number.
  5. err... oops... sorry for that, here's the updated code: <?php foreach($_POST['selection'] as $k => $v) { $query = 'INSERT INTO tbl_product_risks (fld_username, fld_risk) VALUES ('.$_SESSION['username'].','.$v.')'; } ?>
  6. I'm not quite sure what you mean. Could you elaborate a little more? By the looks of it... it seems like you are trying to show a range of pages according to the current page. For example: If you are on page 5 then you want to show 3 4 [5] 6 7 If you are on page 7 then you want to show 5 6 [7] 8 9 Am I correct in assuming this?
  7. By the looks of it. It seems like you want to maintain state (between refreshes, or clicking on a link or whatever) which means you'll have to use the $_SESSION variable.
  8. foreach($_POST['selection'] as $k => $v) { $query = 'INSERT INTO tbl_product_risks (fld_username, fld_risk) VALUES ('.$_SESSION['username'].','.$_POST['selection'].')'; }
  9. The advantage of wampserver is that it provides an easy interface to configure all your tools... you can enable and disable extensions at the click of a mouse.  WAMP makes it fairly easy for you to get a webserver up and running as soon as you finish the install.  This of course only applies to the windows environment although there is a linux equivalent but I'm not sure how similar they are to one another.
  10. So the server doesn't even stop the script?  It should give you a fatal error of some sort, letting you know which one is the script that caused the problem.  Maybe your php log file will clue you in to what it could be... see if you can find something like: PHP Fatal error:  Maximum execution time of 'n' seconds exceeded in <filename> Just a thought heh...
  11. Heh... I couldn't have explained it any better than Crayon :).
  12. The best way to do this would be to use a mysql database to contain your video information. That way you can call http://www.mydomain.com/video.php?id=3 and query the mysql server for the video and show the proper video on video.php page. If you need help with mysql let me know and I can give a brief explanation or you can search the [url=http://www.phpfreaks.com/tutorials.php]tutorials[/url] section of this website.  There are also plenty of resources out on the web for setting up a mysql database, tables and fields.  Just google it :)
  13. Perhaps this could be of use? http://httpd.apache.org/docs/2.0/mod/mod_proxy.html
  14. Corona4456

    Help me

    are your mysql extensions loaded for php?
  15. No problem ... glad to help :)... Sometimes it takes another person to look at your code and point stuff like that out to you... I've done that so much in my 8 years as a programmer :).
  16. [quote author=steelmanronald06 link=topic=106377.msg425509#msg425509 date=1157045415] Mine is obvisouly my name :)  Backwards and my year of high school graduation.  [/quote] so your name is dlanornamleets?  Looks german :D Anyway, mine is kind of obvious... I love the beer and my numbers are my 2 football numbers when I played football in high school 44 and 56, coincidentally 4,5 and 6 have been 3 numbers that have been part of my life.  My social security number has only those 3 numbers in it (trust me you don't want to guess what it is... my credit is shot and the odds of you trying to pull fraud with it are slim next to none... since someone else already beat you to it :) ).  My son was born at 4:56 AM. Those are just a few things that I can remember off of the top of my head.
  17. method is spelled wrong in your form.  I tested your code and changing mothod to method seemed to do the trick
  18. Yeah! You can't just ask us to do it without you telling us your story!
  19. is it possible to see your form code as well? thanks. Now does the JS script not work because there is something wrong syntactically? Or does the function get called but it just doesn't do what you expect it to do? Make sense?
  20. [quote author=JayBachatero link=topic=106340.msg425162#msg425162 date=1157003392] Auto increment fields CAN'T have a default falue since they increase on each row added unless specified in the INSERT query. [/quote] What he said... by default auto inc starts at 1 not 0.
  21. Well it seems like you are limiting your query to just one row in your sql query: [code]$SQL = "select * from online_logs where forumid='$forum_id' order by `id` desc limit 1";[/code] Take off the "limit 1" and you should get every matching row: [code]$SQL = "select * from online_logs where forumid='$forum_id' order by `id` desc";[/code]
  22. for the a = bool ? true_val : false_val all I see is a = val ? true_val : false_val... don't you need to test that first val against something before something is returned?
  23. Why are you defaulting an auto increment field to 0?
  24. I tested your code and it is working fine on my end.  I don't know what the problem could be. I type in 'psb' as the password and it works just fine
×
×
  • 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.