Current location: Hot Scripts Forums » Programming Languages » PHP » Advanced if statments


Advanced if statments

Reply
  #1 (permalink)  
Old 05-09-04, 11:44 AM
Eclipse's Avatar
Eclipse Eclipse is offline
Coding Addict
 
Join Date: May 2004
Location: Long Island, New York
Posts: 356
Thanks: 0
Thanked 0 Times in 0 Posts
Question Advanced if statments

Hello,
How would you make an if statement than needs more than one variable to be true.
if($date == $today || $time == &now){echo("now is now today is today");}

makes it so only one of then them needs to be true in order for it to print the trext, but how would i make it so both need to be true?

Last edited by Eclipse; 05-09-04 at 12:20 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 05-09-04, 11:48 AM
Bonzo's Avatar
Bonzo Bonzo is offline
Coding Addict
 
Join Date: Jan 2004
Posts: 340
Thanks: 0
Thanked 0 Times in 0 Posts
I have not done this before but try :

if($date == $today && $time == &now){echo("now is now today is today");}

Anthony
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 05-09-04, 12:20 PM
Eclipse's Avatar
Eclipse Eclipse is offline
Coding Addict
 
Join Date: May 2004
Location: Long Island, New York
Posts: 356
Thanks: 0
Thanked 0 Times in 0 Posts
Nope, that didn't work. It gave the same output as useing the: ||. Thanks anyway.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 05-09-04, 02:23 PM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
why are you putting the refrence sign (&) in now?!
try this:
PHP Code:

if ($date == $today and $time == $now) {

  echo 
'now is now today is today';

__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 05-09-04, 08:37 PM
Eclipse's Avatar
Eclipse Eclipse is offline
Coding Addict
 
Join Date: May 2004
Location: Long Island, New York
Posts: 356
Thanks: 0
Thanked 0 Times in 0 Posts
Ah thanks alot that worked, in case you where wondering i was making a login script without a database i'm using encypted txt files, i'll post it when i'm done
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
15.000+ scripts and no advanced search or sorting?!?! lee3001 General HotScripts Site Discussion 5 06-03-04 02:35 PM
Advanced programming assistance needed. Dnbuy Job Offers & Assistance 3 04-23-04 04:45 AM
where can I get an advanced auction script sebans Script Requests 0 02-16-04 08:30 PM
Advanced Search YourPHPPro HotScripts Site Bug Reports 0 09-19-03 08:43 AM


All times are GMT -5. The time now is 12:18 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.