Hi guys, a nice easy one for you now.
So at the moment I've got a FAQ section that requires me to manually create a new page for each question.
See it here http://www.bentinckfencing.co.uk/skiphire/useful_information.php
I've got my questions and answered stored like this
<?php
define('Q1','How big are your skips?');
define('Q1A','You can find a full list of our skip dimensions<ahref="hire_a_skip.php">HERE</a>');
?>
and at the moment i'm just outputting them onto their own individual page like this:
<p class="heading"><?php echo Q1?> </p>
<?php echo Q1A ?><br /> <br />
It's a pain in the ass creating a seperate page for each question so here's MY question:
How can I send Information to a php file via a clicked link, so that I can write a program to display the one they've click on?
At the moment I can do exactly what I want via this method:
but it requires a form.
<?php
$choice = $_POST['choice'];
switch ($choice) {
case "1": $answer ="<p class=\"heading\">Question: </p>" . Q1 . "<BR/><p class=\"heading\">Answer: </p>" . Q1A;
break;
case "2": $answer ="<p class=\"heading\">Question: </p>" . Q2 . "<BR/><p class=\"heading\">Answer: </p>" . Q2A;
break;
}
echo $answer;
?>
Can I create the same effect by catching what the user clicks? so that I don't have to have a page for every question?
Check this link to clarify what i'm talking about
http://www.bentinckfencing.co.uk/skiphire/useful_information.php
On the right hand side, I want to be able to create a page depending which question the user clicks..
Thanks in advance, I know it's a long one, but I'm sure there's an easy answer!