Atli's Profile User Rating: *****

Reputation: 3758 Guru
Group:
Moderators
Active Posts:
6,540 (3.79 per day)
Joined:
08-June 10
Profile Views:
84,554
Last Active:
User is online 9 minutes ago
Currently:
Viewing Topic: Trouble with Sessions

Previous Fields

Country:
IS
OS Preference:
Linux
Favorite Browser:
Chrome
Favorite Processor:
Intel
Favorite Gaming Platform:
PC
Your Car:
Mitsubishi
Dream Kudos:
275
Expert In:
PHP, Databases, Web Development
Icon   Atli has not set their status

Posts I've Made

  1. In Topic: Trouble with Sessions

    Posted 28 Feb 2015

    RamonRobben is absolutely wrong there. You should definitely not be using cookies to store login details. Sessions are a far better tool for that. It gives you better control over the data, hides it from the browser, and doesn't require you to keep sending it back and forth between the client and server.


    As for your problem. Do you have error reporting turned on?
    A common mistake for developers new to sessions in PHP is that they use the session_start() function too late. It has to be executed before any output is sent to the browser. If you have error reporting turned on, it will produce a warning when you call that function too late.

    You should always have the errors turned on during development anyway.
    They can be turned on in the PHP config file (look up the "error_reporting" and "display_errors" directives), or you can set them on a per-page basis by adding these lines to the top of the PHP code:
    ini_set("display_errors", true);
    error_reporting(E_ALL);
    
    
  2. In Topic: Having problem displaying japanese character from mysql

    Posted 28 Feb 2015

    The manual is your friend: mysqli::set_charset

    Google is very efficient at locating the right PHP functions, based on searches like (in this instance): mysqli set charset.

    By the way, using both the set_charset functions and issuing a SET command is redundant. Read the notes section in the manual page I linked to.
  3. In Topic: Having problem displaying japanese character from mysql

    Posted 28 Feb 2015

    For one thing, the charset query is being executed by the legacy MySQL API (mysql_query), while your other queries are using MySQLi. They don't mix like that. What you do with the legacy API won't affect MySQLi.


    If found in the past that phpMyAdmin is unreliable when it comes to showing correct non-ASCII values. Not sure if there has been a fix for this, but I wouldn't count on it.

    Generally in PHP with MySQL, you get out what you put in. It's not enough to set the charset on the way out, you also have to set it on the way in. So whatever query inserted your data into the database needs to be done using a UTF-8 connection as well.


    However this may not be a MySQL problem at all. Your HTML page seems to be invalid, which might affect the way the browser renders the page. Make sure the HTML markup is valid: add the doctype (which is a required element in all HTML pages), as well as adding the closing </html> tag.

    You could also try adding a Content-Type header from PHP, just to cover all the basis:
    header("Content-Type: text/html; charset=UTF-8");
    
    

    Make sure you put that before any content is printed/shown.
  4. In Topic: PHP Payment System

    Posted 27 Feb 2015

    Moved to the PHP help section. Questions like these do not belong in the PHP Advanced Discussion section.
  5. In Topic: make the carousels in a horizontal row

    Posted 24 Feb 2015

    Try using the Bootstrap 3 classes, instead of the Bootstrap 2 classes you are currently using. (See the link in my previous post.)

    That would be col-md-6 for a 50% wide column on desktop screens.

My Information

Member Title:
D.I.C Lover
Age:
28 years old
Birthday:
September 5, 1986
Gender:
Location:
Iceland
Full Name:
Atli Ţór Jónsson
Years Programming:
11
Programming Languages:
Mainly: PHP, SQL (MySQL, MSSQL, PostgreSQL), Web Development, (HTML, CSS, Javascript, jQuery).

Additionally: C#, VB.NET, Java, Node.js, ActionScript 3, LUA, C/C++, Python.

Contact Information

E-mail:
Private
Yahoo:
Yahoo  atli.jonsson@ymail.com
Twitter:
Atli_Thor

Comments

  • (2 Pages)
  • +
  • 1
  • 2
  1. Photo

    Anuraj23 Icon

    24 Nov 2012 - 00:43
    hi
  2. Photo

    Atli Icon

    21 Sep 2012 - 03:19
    Hey lyster. Please post questions like that in the forums. That's what they're there for.
  3. Photo

    lyster Icon

    21 Sep 2012 - 00:40
    i just can't figure out what are the possible tables,,i want to know normalization well..u_u
  4. Photo

    lyster Icon

    21 Sep 2012 - 00:34
    hi there mr. atli..i hope you could give me some advices and idea on how to make an erd on my mini mortuary_system,thanks god bless you..
    by the way im a student of a state college here in the philippines.
  5. Photo

    kimimimi Icon

    26 Aug 2012 - 00:37
    please help me
  6. Photo

    xenoslash Icon

    19 Jul 2012 - 23:35
    You are quite possibly the most helpful member of the community. I wish I could +1 you more than once for every long (and useful!) post you make.
  7. Photo

    Maryam.m Icon

    23 Jun 2012 - 10:52
    hey i understood what should i do!!!
    i'm so happy :D :D
    tnx
  8. Photo

    polyosis Icon

    11 Jun 2012 - 16:49
    I would like to thank you on your advice with my site path and installation problems, you are most kind my friend.
  9. Photo

    Atli Icon

    14 Apr 2012 - 05:22
    Yea it seems to like you, Dimitri ;)
  10. Photo

    DimitriV Icon

    08 Apr 2012 - 19:20
    Your avatar… it blinked at me.
  11. Photo

    Atli Icon

    06 Nov 2011 - 19:49
    Hehe. Thanks guys :)
  12. Photo

    Dogstopper Icon

    06 Nov 2011 - 19:19
    Lookin' a little blue there. Cheer up man! You're a mod! Congratz!
  13. Photo

    codeprada Icon

    06 Nov 2011 - 18:34
    It's about time. Congrats on reaching blue status.
  14. Photo

    n00l3 Icon

    05 Sep 2011 - 12:59
    Happy birthday! :D
  15. Photo

    cupidvogel Icon

    03 Sep 2011 - 23:06
    I can't seem to like your reply to my jQuery post an hour ago (fantastic explanation it was), because the Javascript in my browser is somewhat malfunctioning. I will like it later, ok?
  • (2 Pages)
  • +
  • 1
  • 2