Page 1 of 1

Sessions and Frames

Posted: Mon Aug 14, 2006 10:03 pm
by yakatz
I created a login and logout script for my website. on the header of the page i put a login and logout link. it is supposed to change when you login or logout. it does not work. if you would like to see it, go to troop613.com.
if anyone knows of a way to get php to update content in another frame on the page please tell me, or do i need to use some other language :( ?

Posted: Mon Aug 14, 2006 10:15 pm
by RobertGonzalez
Are you refreshing the frame when the link is clicked? Remember, PHP is server-side, so if the server is never told about the click, it won't know to change anything.

Posted: Mon Aug 14, 2006 10:17 pm
by CrazyPHPMan
here try using something like this in your login/logout part

Code: Select all

<?php
if ($_SESSION['user_name'] {
echo '<a href="url">Logout</a><br>';
}else{
echo '<a href="url">Login</a>';
}
?>
just update the url part and add it into your script where it should go and might want to change the user_name to what you have as for the user_name part..


CrazyPHPMan

Posted: Mon Aug 14, 2006 10:28 pm
by yakatz
i know how to make it change the link the problem is getting it to refresh in another frame (thanks Everah). I am looking for suggestions though about how to do it.

Posted: Mon Aug 14, 2006 10:31 pm
by RobertGonzalez
You may have to use some JavaScript and an onClick event. Just a thought.

Posted: Mon Aug 14, 2006 10:31 pm
by CrazyPHPMan
why not do it in tables its alot easier and dont have to mess with frames.. frames are way old school lol

Posted: Mon Aug 14, 2006 10:40 pm
by CrazyPHPMan
If you need help on building a site with tables using php give me a shout. accually i have a script that might help you out if you want it give me a shout and if you want i can even customize it for you..

Posted: Mon Aug 14, 2006 11:19 pm
by RobertGonzalez
Using tables as design elements is kinda old school...

Frames are acceptable, but using proper markup for design is better than a series of nested tables for design.