Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by grucker

  1. Thefirst didn't work but the array did, Thanks. Regarding earlier post. $_SESSION['usr'] = "AINSCOUGH"; $_SESSION['pswd'] = "*****"; I had to readd this didnt work without it on the linux server
  2. I wrote this session_start(); if(!isset($_SESSION['usr']) || !isset($_SESSION['pswd']) || $_SESSION['type']!="this") if(!isset($_SESSION['usr']) || !isset($_SESSION['pswd']) || $_SESSION['type']!="that") { header("Location: /index.php"); } It seems to work and only allows the 2 users to view the page. Is the code written correctly? If so I can mark it solved
  3. I have tried this code. It appears to be almost what I require. Two things, I had to change if(!isset($_SESSION['usr']) || !isset($_SESSION['pswd'] || $_SESSION['type']!="this")){ header("Location: /index.php"); } To if(!isset($_SESSION['usr']) || !isset($_SESSION['pswd']) || $_SESSION['type']!="this"){ header("Location: /index.php"); } I only point this out for anyone else who may try it. Secondly, the code for multi viewrs is fine but I really need a code so only "this" and "that" can see the page and not "other" Thanks ever so much for your help
  4. Once again I agree with you. If I was updating these files I would follow your instruction. Unfortunately these accounts and files are updated by non it office staff. This method was the easiest method for them all to understand. I have taken your advice and removed $_SESSION['usr'] = "AINSCOUGH"; $_SESSION['pswd'] = "*****"; Thanks for your help
  5. I know what I mean I just find it difficult to explain without breaking the rules. session_start(); if($_REQUEST['usr']=="AINSCOUGH" && $_REQUEST['pswd']=="*****"){ $_SESSION['usr'] = "AINSCOUGH"; $_SESSION['pswd'] = "******"; header("Location: ../accounts/AINSCOUGH/location.php"); } elseif($_REQUEST['usr']=="AINSCOUGH" && $_REQUEST['pswd']=="*****"){ $_SESSION['usr'] = "AINSCOUGH"; $_SESSION['pswd'] = "******"; header("Location:../accounts/AINSCOUGH/SiteName/Teesside/showfolders.php"); } Are the 2 users. I can make either the only one able to see the page by changing $_SESSION['pswd']to eg. twit and then on the page session_start(); if(!isset($_SESSION['usr']) || !isset($_SESSION['pswd'])){ header("Location: /index.php"); } Change pswd to twit which allows, only the one allowed to see one page. I just wanted both to see this page and leave the original code on the other pages to only allow pass word ***** to see the pages. Is that more explanatory?
  6. You are perfectly correct. There is no database and the information to be viewed is not earth shattering, just test reports from boring electrical equipment. At the mo I send different users to different pages and the one who is just supposed to see one would have to know the names of the other pages to see more. I just wondered If it was possible.
  7. On many pages I have the code session_start(); if(!isset($_SESSION['usr']) || !isset($_SESSION['pswd'])){ header("Location: /index.php"); } This allows a logged on viewer to see the many pages. Trouble is I now would like another person to log in to view just one page. Imagine the if should have an elseif but I struggle to get it to work. Any help please
  8. Thank you, both suggestions work perfectly well. I used the second method.
  9. include ("../../../../../accounts/accounts/LINEAR LTD/PERIODIC/listofpdfs.php"); I have the above line of code and would like the company name, in this instance, LINEAR LTD, to be replaced with file, name.php which contains the words LINEAR LTD. It will save an enormous ammount of work as new clients are added.
  10. Thank you ever so much that is the answer
  11. the files are 1 through 31 .php <?php // Change $day_images to the location of images $day_post = "includes/days"; $today = date(''); if (file_exists($day_post."/".$today.".php")) { /**echo "$day_post/".$today.".php"; **/ include("$day_post/".$today.".php"); } else { echo "No thoughts came into my head $today"; } ?>
  12. Dont think its that. When I called the files monday etc. and asked for the daily message everything worked fine. Renaming the fies to 1, 2 3 etc. and calling the month day number results in error message but for the day in question. So no wiser.
  13. I renamed the files 1.php 2.php etc. but the else message came up. I tried the various other letters in the code you advised but the else message still came up with the name of todays day i.e. Thursday so it doesnt seem to have changed anything. I even cleared the letter from the parentheses so it was $today = date(''); and the day name still came up. Could you give more advice please.
  14. I have had a different message appearing evry day based on the name of the day. I now want a message based on the date up to 31. I have tried messing to no no avail. Help will be appreciated $day_post = "includes/days"; $today = date('l'); if (file_exists($day_post."/".$today.".php")) { /**echo "$day_post/".$today.".php"; **/ include("$day_post/".$today.".php"); } else { echo "No thoughts came into my head $today"; }
  15. Do you want to change a page or an image (flash or otherwise) depending on month? include ('<img src='images/test.png'>'); didnt work echo "<img src='images/test.png'> "; did work. just wanted to know how to insert image to include
  16. That seems to be the format I will use. The code didn't work but the idea is good. For some reason I had to insert{ } and change from jun to 06 and on the page M to m and it worked fine. I also managed to include an image with your idea. Thank you.
  17. You should not have a bunch of different files that only differ in the content they contain. You should have one file, then use the power of the php server side scripting language to dynamically get or produce the correct content within that one file. This will mean that your displayed output will be consistent and easier to maintain or alter. To change the layout, you only have one place that needs changing and to add or change the content, you simply add or change the data that defines the content. Must be too old, I do not know what you mean. I use the include in the index.php page. Usually a swf file that changes due to season. Would you explain what you meant in a different context and then I may understand. I still don't know about including images.
  18. Like that better. How does one show 3 months of one file then 3 months of another and so on for year? On a different matter. Is it possible to show an image ? I have only succeeded by using echo.
  19. I have got this code I just wondered if there was a better way. <?php $month = date("m"); switch($month) { case 06: include('includes/no.php'); break; case 07: include('includes/yes.php'); break; } ?> Mod edit: change [m][/m] (manual/doc) tags to tags
  20. I would like a little help with the code to load a different page depending on the month. I have done it for date but haven't mastered the month way Regards
  21. Thank you that works fine. I only have one rogue so far. I will keep the other code for future use kindest regards David
  22. I use the following: <?php $deny = array("111.222.333.255", "333.333.333.1", "" ); if (in_array ($_SERVER['REMOTE_ADDR'], $deny)) { header("location: http://www.yourchoice.co.uk/"); exit(); } ?> To ban ip's however when I use 111.111.111.* including a wildcard it does nothing. I have tried double.. but to no avail. I do not understand ereg so any ideas? Thanks
  23. Thanks for the promp replies I only want to put a a simple code ie. discount or member. If I press the buy now button it goes to PAYPAL I have included the function files involved for a more detailed look. Thanks again [attachment deleted by admin]
  24. I have a simple shopping cart with a paypal submit button. I would like to add a box for a discount code and have the refreshed page include a discount from the sub total before adding the postage. Any help? Regards David
  25. I think it is documents. I will know better tomorrow all being well. I am not sure how paying and accessing would work but that sounds good. Thanks for giving a little hope. Kindest regards David
  • 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.