Call a wordpress page in PHP page

Asked

Viewed 441 times

0

I tried to use the following command to go to a wordpress page, but it did not work.

echo '<meta HTTP-EQUIV='Refresh' CONTENT='0;URL=$buscahttp>';
<script>location.href = 'http://www.xxx/¨'.$buscahttp</script>');

header('Location: '.$buscahttp);

Can someone help me?

  • Use only the function header().

  • THE CALL PAGE IS DYNAMIC OR VARIABLE, FIXED ADDRESS WORKS.

  • 1

    What doesn’t work exactly, it goes to an invalid page? It seems to me a mistake in the variable $buscahttp and not in redirect. More details.

1 answer

4

Apparently you are mixing PHP with Javascript ai.

To make this redirect (correct me if I’m wrong) you can do the following:

Using PHP: (remembering that to work should be done before any html output that php can perform)

$redirect = 'http://suaurl.com.br';
header("location:$redirect");

Using Javascript:

<script>
  location.href = 'http://uol.com.br';
</script>
  • Thank you all was solved but I had to put the ob_start command();.

Browser other questions tagged

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