Forums

general php code edit question (3 posts)

  1. hbalagh
    Member
    Posted 6 years ago #

    I have a script that when you select the a certain time zone it will show you the current time in that zone...

    But before you select the time it says

    Time:

    then after you select the time it would say something like this

    Time: 2005-09-06 02:04 GMT

    this is the part of the code that pulls up the info... how can i edit this, so Time: doesn't show up untill after the zone is selected...hope this all makes since...

    Time: <? echo GetTime($input_location_id); ?>

    Thanks

  2. Kafkaesqui
    Moderator
    Posted 6 years ago #

    If $input_location_id is undefined or empty at first, something like the following should do:

    <?php if($input_location_id) : ?>
    Time: <? echo GetTime($input_location_id); ?>
    <?php endif; ?>

  3. hbalagh
    Member
    Posted 6 years ago #

    Thanks Kafkaesqui it worked like a charm :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.