Jump to content

Might be a little confusing ...


ItsWesYo

Recommended Posts

Alright. I'm going to make a FAQ section on my own.

When you click on 'FAQ' on the navigation menu, it will go to 'faq.php'.

When you're at 'faq.php', there will be different faq sections. Such as 'general', 'account', 'other', etc.

Right now, when you click on one .. it has an id ...
example: if i click on 'general', it goes to 'faq.php?id=1'.

What I want now is ... in that page ... i want people to see a list of the questions...when they click on a question, i want the url to be 'faq.php?id=1&q=1' and so on.

How would I do that?
Link to comment
https://forums.phpfreaks.com/topic/18179-might-be-a-little-confusing/
Share on other sites

use the parameters set in the url to query the database for the relevant info....

you have already done so for 'id' do the same for 'p'. You will need to use if statements based on which parameters are set and adjust the queries accordingly.
Well, it's not in the database ..... here is my current [b]faq.php[/b] page:

[code]
<?php
include ("http://wes.hypreed.com/header.php");
$page = $_REQUEST['id'];



if($page == "1"){
echo ( "

question 1<br>
answer 1<br><br>

question 2<br>
answer 2

" );
die();
}





elseif($page == "2"){
echo ( "

question<br>
answer<br><br>

question<br>
answer

" );
die();
}


else {
echo ( "

<a href='?id=1'>Account</a><br>
<a href='?id=2'>General</a>

");
die();
}



?>[/code]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.