Open a href link in php

Asked

Viewed 32 times

-3

Good afternoon. I have the following code to follow and would like to open the sites I have and with a button to redirect to the login of the hosting and I’m not getting. The hosting link would be this http://www.example.com/webmail

My code is like this:

WELCOME
                <div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
                    <a target="_blank" href="<?= $site . 'webmail' ?>">
                        <h4 class="page-title">webmail</h4>
                    </a>
                </div>
            </div>

But it doesn’t open /Webmail, it only opens the normal site. Can anyone help me?

  • What is the content of the $site variable?

  • The $site variable opens several separate domains as it is configured by the customer. That’s why I can’t put the direct link

3 answers

-2

I suggest changing the line

<a target="_blank" href="<?= $site . 'webmail' ?>">

To

<a target="_blank" href="<?= $site . '/webmail' ?>">

  • Yeah, I did, but it didn’t work.

-2


Checks if the link is in this format: http://example.com target=_Blank

<a href="<?php echo $site . "/webmail" ?>" target="_blank">
  • In tests the $site is looking for this link :http://localhost/multicardapio.com.br/

  • He should add the /Webmail but is not adding

  • "/Webmail". Switches to double quotes. Ever tried? Are you setting the address of the site directly on the viewable? Add http://

  • It worked. Thank you

  • For nothing, if you have everything ok just accept the answer! : ) Hugs!

-2

Here’s how it works.

$site = 'https://www.google.com';
<a target="_blank" href="<?= $site . '/webmail' ?>">
            <h4 class="page-title">webmail</h4>
</a>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.