![]() |
PHP Help Please Hi everyone, I need a nudge in the right direction if anyone can help please :smilies_confused: I am trying to output different H1 headers on my page based on the page id. For example, if someone lands on my page example.com/landingpage.php?id=1 I would like to display H1 version 1. landingpage.php?id=2 would show H1 version 2 ETC. So far I have HTML Code: <?phpHTML Code: <h1><?php echo($_GET["h1"]) ?></h1>Can anyone help me out please? :) Thanks |
Re: PHP Help Please Use this php code: <?php if (isset($_GET["id"]) $h1=$_GET['id']; else $h1 = ""; if ($h1 == "1") { $headline = "headline 1"; } else if ($h1 == "2") { $headline = "headline 2"; } else if ($h1 == "3") { $headline = "headline 3"; } else { $headline = "default headline"; } ?> And then to echo use: <h1><?php echo $headline; ?></h1> |
Re: PHP Help Please Quote:
Code: <h1><?= $headline ?></h1> |
Re: PHP Help Please Quote:
|
| All times are GMT -6. The time now is 11:53 PM. |