Best way to output html within php?
Yup so say i need the right referer before you can view a webpage but i dont want to redirect if the referer is wrong, rather just keep the same page but output different html depending on whether referer is right or not. So something like
PHP Code:
if ($_SERVER['HTTP_REFERER'] != "http://www.google.com"){
<html><body> This html ouput 1 <html><body>
}else{
<html><body> OR This html ouput 2 <html><body>
}
Its not pratical to use echo to output the html, whats the industry way of doing this?
Re: Best way to output html within php?
you can mix php conditionals with HTML code:
PHP Code:
<?php
if ($_SERVER['HTTP_REFERER'] != "http://www.google.com"){
?>
<html><body> This html ouput 1 <html><body>
<?php
}else{
?>
<html><body> OR This html ouput 2 <html><body>
<?php
}