Jump to content


Photo

Might be a little confusing ...


  • Please log in to reply
2 replies to this topic

#1 ItsWesYo

ItsWesYo
  • Members
  • PipPipPip
  • Advanced Member
  • 110 posts

Posted 21 August 2006 - 09:48 AM

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?

#2 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 21 August 2006 - 10:04 AM

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.
follow me on twitter @PHPsycho

#3 ItsWesYo

ItsWesYo
  • Members
  • PipPipPip
  • Advanced Member
  • 110 posts

Posted 21 August 2006 - 10:09 AM

Well, it's not in the database ..... here is my current faq.php page:

<?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();
}



?>





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users