Echo and If

This is a discussion on "Echo and If" within the PHP Forum section. This forum, and the thread "Echo and If are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Aug 27th, 2007, 12:23
simonb's Avatar
Blog Moderator

Join Date: Dec 2006
Location: Norwich
Posts: 675
Blog Entries: 4
Thanks: 4
Thanked 2 Times in 2 Posts
Send a message via Skype™ to simonb
Echo and If

I have this code on my site. If you are logged in you see ""Logged in stuff"
and if not you see "login"

PHP: Select all

<?php if (isset($_SESSION['MM_Username'])) { 
echo(
"Logged in stuff"); 
} else {
eecho ("login");
 
?>
Here is the problem. I want links in there a form. If I add code i get this error
Quote:
Warning: Division by zero in D:\Program Files\wamp\www\admin\index.php on line 24
Last Blog Entry: Whats your Niche? (Jun 10th, 2008)
Reply With Quote

  #2 (permalink)  
Old Aug 27th, 2007, 15:09
alexgeek's Avatar
Technical Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,770
Blog Entries: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alexgeek
Re: Echo and If

Quote:
Originally Posted by simonb View Post
I have this code on my site. If you are logged in you see ""Logged in stuff"
and if not you see "login"

PHP: Select all

<?php if (isset($_SESSION['MM_Username'])) { 
echo(
"Logged in stuff"); 
} else {
eecho ("login");
 
?>
Here is the problem. I want links in there a form. If I add code i get this error

try this:
PHP: Select all

<?php
 
if (isset($_SESSION['MM_Username'])) { 
echo 
"Logged in stuff"
} else {
echo 
"login";
}
 
?>
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Reply With Quote
  #3 (permalink)  
Old Aug 27th, 2007, 16:22
simonb's Avatar
Blog Moderator

Join Date: Dec 2006
Location: Norwich
Posts: 675
Blog Entries: 4
Thanks: 4
Thanked 2 Times in 2 Posts
Send a message via Skype™ to simonb
Re: Echo and If

That was a Typeo. I found a way round this

PHP: Select all

<?php if ($_SESSION['MM_Username'] < true) {  ?>What ever Code you want
<?php }  ?>
Last Blog Entry: Whats your Niche? (Jun 10th, 2008)
Reply With Quote
Reply

Tags
echo

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
echo proxy to csv stiassny JavaScript Forum 1 Apr 13th, 2008 16:51
How do I echo <?php ..... AdRock PHP Forum 12 Sep 14th, 2007 13:20
how to echo 2 classes geyids PHP Forum 3 Aug 9th, 2007 13:47
Echo and Sessions kool77 PHP Forum 6 Jun 1st, 2007 22:32
Echo vs Print Sqrlgrl PHP Forum 3 May 30th, 2005 22:31


All times are GMT. The time now is 11:43.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43