0

I have a feeling that I am going to feel silly when it is explained, but can someone let me know what the following statement does?

href='<?= $authUrl ?>'

It is taken from the Google API Authentication login code below.

<div class="box">
  <?php if (isset($authUrl)): ?>
  <div class="request">
    <a class='login' href='<?= $authUrl ?>'>Connect Me!</a>
  </div>
  <?php elseif($_SERVER['REQUEST_METHOD'] == 'POST'): ?>
  <div class="shortened">
    <p>Your call was successful! Check your drive for the following files:     </p>
  </div>
  <?php else: ?>
  <form method="POST">
    <input type="submit" value="Click here to list your tables" />
   </form>
 <?php endif ?>
</div>

1 Answers1

0

Php has a shorthand version of echo

<?php 
    $foo = "bar";
?>
<a href="<?= $foo ?>">I'm linking to bar </a>
Robin Knaapen
  • 606
  • 4
  • 12