Results 1 to 8 of 8

Thread: PHP sessions

  1. #1
    Join Date
    May 2004
    Location
    Colorado
    Posts
    948

    PHP sessions

    Hi everyone..
    me, my friend apoc4lyps3 and a few other of my friends are working on a website for our highschool.
    Until we can get the site hosted by the school i wanted to have it hosted off of someones computer so we can actually see it.. as it is php you need the parser to view the site, seeing as i cant host the site from my internet connection because there are some things that stop me from hosting it.. i dont have acess to one of the routers on my network and cant set it to portforward..
    so we attempted to set php apache and mySQL up on apoc4lyps3's computer.. i couldnt manage to configure apache so that it would load the php extensions that i needed so we decided to try xampp...

    however.. the site works, for the most part now hosted of his computer, except when i attempt to login on my site (i have written a small login script that allows you to login if you are registered in the database and then allows you to add new news entries and edit posts etc...
    but it apears that the sessions do not work for some reason, i assume it is the way his server is set up (in fact im certain as all the code works on my own computer when i test it)

    any help would be greatly appreciated, thx

    [The latest version of xampp has PHP 5 apache 2 and mySQL(not sure which version i would have to go look it up on their site) ]


    Absolute Power, its the only way to roll!

  2. #2
    Join Date
    Jul 2004
    Location
    N29° 22.725' X W95° 6.452'
    Posts
    343
    What errors is it generating? Thats the most helpful thing to post if you are incountering problems that you need help with.

    With out knowing what errors may be occuring the only thing I could suggest is to check your php.ini setting for session.auto_start = "0" and change it to "1" if it is not already. If you want it turned off then you neet to use session_start() on every page you want sessions enabled.

    If you already know all this then post back with any errors you are getting and we can go from there.

  3. #3
    Join Date
    Dec 2003
    Posts
    2,034
    Im running the server. I checked the php.ini file and the session.auto_start was set to 0 so I set it to 1. I restarted all apache, php, and mysql and tried to login. It let me login usign any password. Im not sure if wraith made it that way so he wouldnt have to type in his password everytime or what. But it still doesnt work like it should.
    Im really just learning php and mysql so I might be overlooknig some obvious things.

    EDIT: would it help at all if i posted the link to the website so you could see what I mean?

  4. #4
    Join Date
    Jul 2004
    Location
    N29° 22.725' X W95° 6.452'
    Posts
    343
    You may have to post your login script for analysis. There is definitely an error somewhere.

    EDIT: I wont say definitely but its highly likely.
    Last edited by mcarman; 11-13-2004 at 12:39 AM.

  5. #5
    Join Date
    Dec 2003
    Posts
    2,034
    I can kind of figure what the php means but im not sure. I cant talk to wraith right now, hes asleep. So would it be safe to post the script, could someone hack the site or something if they see the script?

  6. #6
    Join Date
    Jul 2004
    Location
    N29° 22.725' X W95° 6.452'
    Posts
    343
    They would need more than just the login script but if you are not comfortable posting it then PM it to some one you trust who knows what to look for. But if you look around this forum you will see lots of people have posted their login scripts and other scripts for review. Or you could just wait for more suggestions. Some one else may know exactly what the problem is and can post a solution for you. Its your call, no need to rush in to it unless you are unter a time restraint.

  7. #7
    Join Date
    Dec 2003
    Posts
    2,034
    well we are kinda under a time restraint. I will wait till tomorow and ask wraith. he did say it works on his computer so it may be a config problem.

  8. #8
    Join Date
    May 2004
    Location
    Colorado
    Posts
    948
    yeah... the site works fine when i have it running off my own computer, but as that is not an option to host it off my computer cuz my internet wont let me do it we have tried to set it up on apoc4lyps3's computer however the sessions dont appear to be working..

    i have a login page and a login script that i wrote, you click to go to the admin page, and if there is no session variable for the user set it will show the username and password entry box, when you go back to the page after logging in it will give you some different options that only logged in users are able to use, that is what should happen, however after i log in and then go back to the page (this is when it is hosted off apocs comp) it just shows the login form again

    i wont be home tonight i dont think but hopefully sometime tomorrow in the afternoon

    thx


    Absolute Power, its the only way to roll!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •