Jump to content

grucker

Members
  • Posts

    45
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

grucker's Achievements

Newbie

Newbie (1/5)

0

Reputation

  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
×
×
  • 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.