This is a discussion on "[SOLVED] Session Code (Were to place it)" within the PHP Forum section. This forum, and the thread "[SOLVED] Session Code (Were to place it) are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] Session Code (Were to place it)
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
[SOLVED] Session Code (Were to place it)
When starting a session from user login, do i have to put the session code located below in every page??? For instance if the user logs in & is directed to a profile page\ then the user decided to say "view some site content on another page" would i have to put the code below in both pages to keep the session going from page to page, or is the process automatic..
It appears am still a bit confused with handling a php session
|
|
|
|
||||
|
Re: Session Code (Were to place it)
Yes, you need to start the session on each page that you want access to previously set session variables.
This is unless you have set the php.ini directive session_auto_start.
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
|||
|
Re: Session Code (Were to place it)
Thanks Mate! I thought it had to go on each page needed!
Can you just confirm my code is correct for doing this, and i will be on my way!
|
|
||||
|
Re: Session Code (Were to place it)
This is fine but it will only track the views and only show to the currently browsing user. It won't store the amount of profile views for everyone to see.
In order to do that, you would have to store the amount of views of each profile in the database.
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
|||
|
Re: Session Code (Were to place it)
I use the session code below in my edit profile page & the logged in users data loads into the page with no problems.
Also is the session code above the right code to use in my profile page to help tackle this problem of mine?? Thanks mate |
|
||||
|
Re: Session Code (Were to place it)
That's a completely different question
What does the URL look like when you are viewing someone's profile page?
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
|||
|
Re: Session Code (Were to place it)
Different question
Here the url dude one the user has logged in & transfered to the profile page: http://localhost/Content%20managment/Accounts.php The profile doesnt display!!! |
|
||||
|
Re: Session Code (Were to place it)
NO, I mean what does the URL look like if you were looking at someone else's profile? If you need to direct a user the their profile page you simply need to send them to the URL for their profile.
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
|||
|
Re: Session Code (Were to place it)
I used dreamweavers in built functionality (So when i appled the login user to the form, i also used the option in the wizard to direct user to the profilepage once the user is logged in)! After this i attempted to use session code mentioned in the last post at the top of the page, then used record sets & bindings & were-function to display the logged in users profile data from the database!!!
I have posted the whole of the page code below:
|
|
||||
|
Re: Session Code (Were to place it)
But that doesn't answer my question
When you are browsing your site, say when you do a search for users and click on a user link to view their profile, what does the URL look like? That's all I want to know for now.
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
|||
|
Re: Session Code (Were to place it)
Sorry feller!!
Here is the code from the view user profile button :
Here is what is in the parrameter:
Hope this helps |
|
||||
|
Re: Session Code (Were to place it)
So it's just a matter of sending the user to that page when they log in...
Say this is their log in script
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
|||
|
Re: Session Code (Were to place it)
Cool!!
So the code below needs to go into my login page - Not my Accounts.php page??
And thats it, the logged in user data will display in the Accounts.php page?? |
|
||||
|
Re: Session Code (Were to place it)
That's a blueprint it's not valid code.. It's a concept.
Bascically, when the user is logging in you will have access to the user's id. WIth that, you can just send the user to accounts page and append their id so it goes to their page. It's the general idea.
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
|||
|
Re: Session Code (Were to place it)
Thanks Rakuli!!! I get your drift but fear i dont completly have the skill to manage it right now!!!
If i post my login script could you input a quick example to get me going... Also do i still need to put the session code in the Accounts.php profile page!! This is my last code problem and my site is good to go, i used the content managment site to test features out before implimenting them into my proper site... Once i see somthink once i no how its done, but always half kills me getting there... Here is my login script:
|