Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP If and Else operating incorrectly

The following PHP should determine if there ?purpose=email and then if it is determine the sting contains ?emailaddress or not. If there is an emailaddress then it triggers one set of scripts and if not another. But regardless it is acting as if emailaddress !== ''; Any idea why.

<?php if($_GET['purpose'] == 'email') {?>
<?php   if($_GET['emailaddress'] !== '') {?>
  <script type="text/javascript">
    alert('<?php echo $_GET['emailaddress'];?>');
    window.setTimeout(function(){
      $('.dirops .loadpanel div span', window.parent.document).html('Complete');
      $('.dirops .loadpanel', window.parent.document).removeClass('slideup');
    },1000);
  </script>
<?php } else { ?>
  <script type="text/javascript">
    window.setTimeout(function(){
      $('.dirops .loadpanel div span', window.parent.document).html('Loading');
      $('.dirops .confirmemail', window.parent.document).addClass('slideup');
    },1000);
    $('#confirmemail', window.parent.document).attr('href', 'http://www.golfbrowser.com/A4/directions.php?purpose=email&start=<?php echo $_GET['start'];?>&end=<?php echo $_GET['end'];?>')
  </script>
<?php   } ?> 
<?php } ?> 

Any ideas?

Marvellous

like image 301
RIK Avatar asked Sep 21 '11 13:09

RIK


1 Answers

Try if($_GET['emailaddress'] != ''), i.e. != instead of !==

like image 106
user558061 Avatar answered Sep 30 '22 19:09

user558061