Ask a Question related to Dreamweaver AppDev, Design and Development.
-
barbedwire103 #1
If statements in PHP?
How do i get something to show only if the user is logged in? For example, "log
out" should only show if the user is logged in and "log in" should only show if
the user is not logged in. How would i do this in PHP? Thanks for you help!
barbedwire103 Guest
-
If Statements????
guys i was wondering if anybody here could help me. I have a page done up with all dynamic text and attributes on it that come from a management... -
2 sql statements in one <cfquery>
hi. is it possible to do something like this? <cfquery datasource="chDev" name="test"> SELECT * FROM test WHERE id = #url.id# INSERT INTO test... -
conditional sql statements
I have a shopping cart that I want to load items in that come from a huge scrolling form. In other words, when someone clicks on a category in our... -
Include statements
I am currently using a perl script to process form data. I don't want to lose the functionality I have with this script but need to output the data... -
If/else statements - help.
Sorry to post so much code all at once but I'm banging my head against the wall trying to get this to work! Does anyone have any idea where I'm... -
David Powers #2
Re: If statements in PHP?
barbedwire103 wrote:
Logging in and out is normally controlled by session variables. So, if> How do i get something to show only if the user is logged in? For example, "log
> out" should only show if the user is logged in and "log in" should only show if
> the user is not logged in. How would i do this in PHP? Thanks for you help!
you have a session variable called 'username', you would handle it like
this:
if (isset($_SESSION['username'])) {
// code for logging out
}
else {
// code for logging in
}
If you are using the DW User Authentication server behavior, you should
be aware that it breaks in modern versions of PHP. See the following
explanation (you need read only the first post):
[url]http://friendsofed.infopop.net/2/OpenTopic?a=tpc&s=989094322&f=8033053165&m=3241024 21&r=324102421#324102421[/url]
--
David Powers
Author, "Foundation PHP 5 for Flash" (friends of ED)
Co-author "PHP Web Development with DW MX 2004" (Apress)
[url]http://computerbookshelf.com[/url]
David Powers Guest



Reply With Quote

