Jump to content

oni-kun

Members
  • Posts

    1,984
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by oni-kun

  1. Yep, Sessions can be called on pages required using session_start(); , Note this must be the first line of every page that uses sessions, or it may not work. As well, do not output anything (echo/whitespace/html etc.) before this line of code, outside the php tags.
  2. I believe he means $lang['en'] ="what ever text you need"; $lang['fr'] ="what ever text you need"; $lang['de'] ="what ever text you need";[ $lang = $lang['de']; //Assign to language 'de' switch($lang){ case'en': include 'lang/en.php'; break; case'fr': include 'lang/fr.php'; break; } Also, $HTTP_GET_VARS is a registered global, which has been deprecated for nine years.
  3. Well if you're on a shared host, maybe you can assume upload throughput is 64Kbs In Bytes: 4096(4mbs)/(64/8)/60 = ~8.5 minutes upload time
  4. Yep, it seems it's just some weird server problem, many servers are misconfigured (as yours, is setting default folders to non-default areas, which are clearly not built right). Whois: "ipage.com is associated with about 605 domains" Appears they're not as big as they put out to be.. (Did you try Thorpe's code up there btw)?
  5. From looking at the source, it appears index.php has the 'active' class on, You'd need to make those other links if you want to test if the other ones work, because from what I can see, your code is solid.
  6. ASC and DESC would help, I 'think' this is correct: SELECT * FROM Product WHERE `ProductC` = 'Beer' ORDER BY Price DESC EDIT: Beat to it.
  7. session_start() does not have an index, You know, I may have to say your server is at fault, I've never seen session cookies stored at /var/php_sessions before, and if you're truly not sending content before the header, then it makes no sense to show the error it has. Try using ob_start(); before session_start(); , to start output buffering and possibly fix bandaid the session setting problem.
  8. I'd have to agree that (the secure shell part of what I used in my other post) is the only thing I use for automation, If I'm lazy and am on a Windows laptop without too much resources (or lack thereof) to SSH, I'd find a webmin-like interface something I'd have to stick with, albeit IP-cop's shell like web interface is better for what i'm specifically doing (network/authentication tasks, not anything that shell would allow).
  9. You should run some quieries on the table to ensure it is in unicode format mysql_query("SET NAMES 'utf8'"); mysql_query("SET CHARACTER SET 'utf8'"); Or export them as a unicode compatible charset. It should save the file in a unicode document. If you want to create a file that is unicode with the proper BOM, you may want to download a capable editor (such as Notepad++) or as mentioned, use the 'encoding as UTF8' in notepad. To read a table that contains unicode characters, you MUST run utf8_encode on the string taken from the database row/file to be able to display the farsi text.
  10. Add session_start(); , to the beginning of any page you want to access the sessions. Then you'll be able to access them like <?php session_start(); echo $_SESSION['Details']; //Will echo the session value defined in the other page ?> Sessions are serverside data that will remain until the cookie expires, it can be accessed anywhere that calls session_start();
  11. Just a note, the validator does not do anything to the php, nor does it tell you of any errors, just html stuff. And yes, upon looking at your code the IF statements are incorrect, they should be: <?php $page ="index.php"; include("includes/header.php"); ?> <ul id="navigation"> <li <?php if ($page=='index.php') { echo 'class=aktiv'; }?> ><a href="index.php">home</a></li> <li class="trenner">/</li> <li <?php if ($page=='gallery.php') { echo 'class=aktiv'; } ?> ><a href="gallery.php">gallery</a></li> <li class="trenner">/</li> <li <?php if ($page=='portfolio.php') { echo 'class=aktiv'; } ?> ><a href="portfolio.php">portfolio</a></li> <li class="trenner">/</li> <li <?php if ($page=='about.php') { echo 'class=aktiv'; } ?> ><a href="about.php">about</a></li> <li class="trenner">/</li> <li <?php if ($page=='contact.php') { echo 'class=aktiv'; }?> ><a href="contact.php">contact</a></li> </ul> .. PHP error reporting would tell you this.
  12. Just look up an ajax tutorial, there are many out there and it doesn't require too much Javascript knowledge. Essentially what happens is, Javascript creates an HTTP request to your PHP page (telling it to update the SQL table for example) and retrieving the result, such as 'updated' or 'error', and will put it into a div or message without refreshing the page.
  13. At what lines is the undefined index? That error is usually called when in 'strict' error mode and is usually not the problem, but for some reason PHP cannot set the cookie for the session. It states headers have already been sent, which just leads you back to whitespace beforehand..
  14. Yes , AJAX is your only solution as PHP is a serverside language, meaning it would have to refresh to be sent any content.
  15. And there ya go. Are you ouputting anything, including whitespace (Newline/Space/HTML) before session_start() ? This will cause the session cookie to be voided, as headers are being sent after content.
  16. Add the following code at the top of your page right after the <?php element, and see if it reports any errors: ini_set('display_errors',1); error_reporting(E_ALL); What error are you exactly getting, is that all your code? What are you expecting to get? You're not giving us a lot to work with.
  17. Why isn't it saving sessions to (the default) /tmp? Are permissions set up properly in /var/php_sessions? CHMODDED to 755 should be sufficient, although i'm not sure if it is your direct problem as it should have warned you up front if the session could not be created. Add the following lines above session_start(); : ini_set('display_errors',1); error_reporting(E_ALL); And see if it reports any errors.
  18. You can of course do something as simple as: $_SESSION['privileges'] = $row['privilages']; $_SESSION['applicationPath'] = $row['applicationPath']; $_SESSION['code'] = $row['code']; And work from that code, What would be ideal is to create a function such as 'checkPrivilages' to read the session, and allow only parts of that application that are authorized.
  19. Yeah, I've got a lot of spare time on my hands at night, I'm (atleast a year) into learning PHP, I've not taken any official courses but I'm already adept enough to create fair scale projects (like my site), hehe. "You can only master learning, by teaching" eh!
  20. Welcome here, there's a nice array of questions that are asked daily (a lot by regulars, so you get to know them and what they're trying to do) so it's fairly laid back and easy to get in depth. The misc. section has a nice selection of things to talk about as well, a good place to blab about software or the news.
  21. Ah, didn't spot that. Makes sense being 8 years older and containing a complete overhaul in the GUI, shell/Networking (Homegroup)
  22. Shouldn't matter, I believe that wasn't his problem.
  23. <?php session_start(); // Check if we have an authenticated user if (isset($_SESSION['authenticatedUser']) && $_SESSION["authenticatedUser"] != 'admin') { //If user is not admin, but accessing admin page: $_SESSION["message"] = "You do not have access to this page"; header("Location: home.php"); //or wherever } else { echo 'Welcome Admin!'; } ?> EDIT: Fixed your code up a little.
  24. There is no direct upgrade path from XP to Win7 as far as I know. You would have to upgrade to Vista and then to Win7. I believe it is available for both x86/64 systems to be upgraded directly from XP, as noted here: http://windows.microsoft.com/en-CA/windows7/help/upgrading-from-windows-xp-to-windows-7 Albeit, keeping (very possibly) deprecated software in the process.
  25. Yes, as mentioned session_register is a very old and deprecated method of assigning variables to the session. It should always be in the format, $_SESSION['key'] = 'value';
×
×
  • 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.