Go Back   Novahq.net Forum > phphq.Net > phphq.Net Forums
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-26-2004, 06:40 AM
AoS.Tecoma2
Unregistered

Posts: n/a

Need some help with db's

Well i'm not sure if its related with db's, but i'm making a website with PHP & Mysql, and i was woundering how you get something like "index.php?view=news", is it anything to do with connecting with db's, and can someone run through what i do to do this.
-Warm regards
Reply With Quote
  #2  
Old 10-26-2004, 06:53 AM
Dane
Unregistered

Posts: n/a

Hi,

Its just a simple little bit of code that you have to enter into your page. When you slice up your website, Insert the line into the Main Content part, the part where everything is going to be opened.

<? if(isset($page)) { include("$page.php"); } else { include("news.php"); }; ?>

The main page will be news.php and it will do as so...

index.php?page=news
index.php?page=members
index.php?page=results

etc

Hope this helps,

Dane
Reply With Quote
  #3  
Old 10-26-2004, 10:14 AM
Stu is offline Stu
Resident Member

Join Date: Aug 2003
Posts: 3,319

RE

Thnx m8, that helped alot.
- Warm regards
Reply With Quote
  #4  
Old 10-26-2004, 10:46 AM
Stu is offline Stu
Resident Member

Join Date: Aug 2003
Posts: 3,319

Ooo a bit of a boo-boo here lol, erm it went wrong...
www.masterd.co.uk/fleabib-studios/uploadedsigs/bo-bo.jpg
Thats what went wrong, and i can't spot any problems there :?
Reply With Quote
  #5  
Old 10-26-2004, 01:13 PM
Dane
Unregistered

Posts: n/a

Hmm mate...

This is the code that you should enter....

<? if(isset($page)) { include("$page.php"); } else { include("news.php"); }; ?>


You have entered....

<? if(isset($page)) { include("$index.php"); } else { include("test.php"); }; ?>

------------------

You have changed the $page.php with $index.php ... Change that back mate and keep it how it is...

That should work...

If you want to change anything change the "news.php" to whatever.php

Then see if it works.

Thanks

Dane
Reply With Quote
  #6  
Old 10-27-2004, 07:52 AM
Stu is offline Stu
Resident Member

Join Date: Aug 2003
Posts: 3,319

Ahh thnx m8
Reply With Quote
  #7  
Old 10-29-2004, 07:05 AM
XinG
Unregistered

Posts: n/a

Also you could use this too, it will go into your index.php

<?
if ($page == "") $page = "news";
if (!file_exists($page.".php")) $page = "error";
include($page.".php");
?>

if you want it to be ./?view=news then change the "page" with view, simple as
Also, if a page doesnt exist when they try click a link, an error will appear
Reply With Quote
  #8  
Old 10-30-2004, 10:42 AM
Stu is offline Stu
Resident Member

Join Date: Aug 2003
Posts: 3,319

cool, thank you, i will try both methods
Reply With Quote
  #9  
Old 10-30-2004, 02:53 PM
XinG
Unregistered

Posts: n/a

oh and also, when making hyper links for it, all u have to do is put ./?page=link
thus when u click it, wont have index.php on it


wots the website addy
Reply With Quote
  #10  
Old 11-01-2004, 11:36 AM
PHP-Largo
Unregistered

Posts: n/a

a lil explanation of what your doing there...

basically your passing info like you wouldin a variable throught the url so... if you did /?action=insert

then you did
if(action=="insert"){
$result = mysql_query"INSERT INTO db VAULES()";
}

it takes that info ... ... just a lil tell you what it is..
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
{DB} RECRUITING server koutking Gaming Talk 0 10-09-2007 07:45 PM
maps db -Tigger- phphq.Net Forums 0 08-02-2007 06:54 AM
Map DB -Tigger- Feedback / Novahq.net Support 3 06-26-2004 04:19 PM
db staffy bull Sigs and Graphics 3 09-11-2003 12:33 PM
Map db almost complete! Scott News 0 05-10-2002 12:34 PM


All times are GMT -5. The time now is 07:21 AM.




Powered by vBulletin®