Jump to content

tonit

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

tonit's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Configuration File (php.ini) Path C:\Windows Loaded Configuration File C:\php\php.ini I'm getting this error when trying to read a file: "fopen(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function....". Although i fixed it in the c:\php\php.ini(because the file doesn't exist in c:\windows). Restarted my server but still no changes. Any help ?
  2. I'm trying this simple script on my windows server 2008 standard edition but keep getting errors. <?php error_reporting(-1); ini_set( 'display_errors' , 1 ); $file=fopen("2.txt","a") ; fwrite($file,"Hai"); ?> Warning: fopen(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Paris' for '1.0/no DST' instead in C:\inetpub\wwwroot\10.php on line 3 Warning: fopen(2.txt): failed to open stream: Permission denied in C:\inetpub\wwwroot\10.php on line 3 Warning: fwrite(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Paris' for '1.0/no DST' instead in C:\inetpub\wwwroot\10.php on line 4 Warning: fwrite() expects parameter 1 to be resource, boolean given in C:\inetpub\wwwroot\10.php on line 4 Any help is appreciated.
  3. Hello, I have a website where only a couple of people can access it, so the number of IPs logged in is very limited. Everything submitted by the 'admins' logged in is sent to a specific folder dependent of their IP Address. Again they can't access the website through a proxy or anything because there's a limited range of IPs that is allowed. Can I trust $_SERVER['REMOTE_ADDR'] to give a valid IP so the log-system would be 100 % stable and efficient ?
  4. Ah, I changed the "<?" to "<?php" and it's working right now. Thank you very much, if it's that what you meant ^^.
  5. Hello, I'm trying to test a simple login system without a db, just for testing purposes. I have created a php file that checks if the username and pass are valid and register a session. <?php session_start(); define("ADMINUSER", "user"); define("ADMINPASSWORD", "pass"); $user = $_POST['user']; $pass = $_POST['pass']; if (($user==ADMINUSER) && ($pass==ADMINPASSWORD)) { $_SESSION['logged_in'] = true; header("Location: main.php"); } else { header("Location: auth.php?flag=wrong"); } ?> and include this in other files to check if the user is logged in: <? session_start(); if ($_SESSION['logged_in'] != true) { header("Location: auth.php?flag=not"); exit; } ?> But this doesn't seem to work, as I closed the window, clear my cookies and shutdown my PC and when I try to open it again and it doesn't redirect me to the login page(auth.php). What am I doing wrong ? Any help is appreciated.
×
×
  • 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.