...

View Full Version : pHp website help



lazyserv
03-16-2010, 09:20 AM
Hi guys,

i wanted to make a php website but im still new on all of this, i want to ask how do i make my php website like this?

/index.php?site=news

i dont get how they do it... i can make a index.php but "?site=news" is what? any tutorial for me? so i know how to make this kind of website

abduraooft
03-16-2010, 09:56 AM
Take a look at http://www.digital-web.com/articles/easypeasy_php_2/

Goldfish
03-16-2010, 01:31 PM
Basically there isnīt much difference between

/index.php?site=news

and

/news/somefile.php

While the second solution simply accesses the file somefile.php, the first solution has in its index.php an if() or switch, checking something like



if($_GET['site'] == "news")
{
include("/news/somefile.php");
}


The advantage of this is, that the index.php can include other stuff, like checking login or cookies, loading a menu, etc., before including the page.

lazyserv
03-17-2010, 04:22 PM
i see.. i hope i can sort it all with both of your answer, i will come back here if i cant figure it out :)

thanks alot guys :D

lazyserv
05-08-2010, 04:12 PM
sorry to bump old topic but i saw some website got this kind of extention.

example:
http://www.facebook.com/#!/?ref=logo
http://teamlz.com/home/?p=1235

what is the different between above link and

http://www.example.com/index.php?page=test

sorry for asking this dumb question but i hope someone can make me clear what is that diffrent :)

Phil Jackson
05-08-2010, 04:48 PM
index is always processed if present .co.uk/ is the same as .co.uk/index.php also .co.uk/index.php?foo=bar is the same as .co.uk/?foo=bar

And for a guess ( not realy know ) #!/ can be applied to any url and is related to the name of an anchor.

lazyserv
05-08-2010, 05:01 PM
then how to hide the index.php from the broswer? i mean like how to do from

http://www.example.com/index.php?page=test

to

http://www.example.com/?page=test

met
05-08-2010, 05:16 PM
mod_rewrite (http://www.google.co.uk/#hl=en&source=hp&q=mod_rewrite&aq=0s&aqi=g-s1g9&aql=&oq=mod+re&gs_rfai=&fp=4539c0d4d3cba382)

Phil Jackson
05-08-2010, 06:28 PM
<a href="./?foo=bar">link</a>

lazyserv
05-08-2010, 08:11 PM
fastest solution! thank phil :)
u really is my master ^^



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum