Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

php links?

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

php links?

Postby rob12 » Sat Mar 29, 2003 4:00 am

Hi,

I’ve seen a lot of places that have 1 php page for the entire site and somehow the script inserts the page into the site :S
Hmm not very well explained i know.. When you hover over a link it says something like: index.php?name=contact
and then for example the contacts page will be shown within the index.php page..

I was wondering how this was achieved, I thought maybe the script grabs the contents of a file called "contact" and simply pastes it into the main page? Although this seems very basic and full of security holes.

Any suggestion about doing this would be appreciated.
Thanks

Rob
:?::!::?:
rob12
New php-forum User
New php-forum User
 
Posts: 2
Joined: Sat Mar 29, 2003 3:48 am

Postby Romantik » Sat Mar 29, 2003 4:41 am

Romantik
New php-forum User
New php-forum User
 
Posts: 67
Joined: Mon Feb 24, 2003 2:55 am
Location: ../Ukraine/Kherson

Postby sleepingdanny » Sat Mar 29, 2003 4:49 am

Its very easy to do :!: :arrow:
Lets say your site URL is: http://www.site.com/index.php

<?
if($id=="1"){
echo "Content";
}
esleif($id=="2"){
echo "Different Content";
}
// ......
?>

This code should be placed in the index.php file and then you make a link to "http://www.site.com/index.php?id=1" or to "http://www.site.com/index.php?id=2" and it will echo the content that you added :P

(< a href="http://www.site.com/index.php?id=1" >1< /a >)
sleepingdanny
New php-forum User
New php-forum User
 
Posts: 13
Joined: Mon Mar 17, 2003 6:38 am

Postby rob12 » Sat Mar 29, 2003 8:08 am

Just as i suspected.. php is far too easy :)

Thanks
rob12
New php-forum User
New php-forum User
 
Posts: 2
Joined: Sat Mar 29, 2003 3:48 am


Return to PHP coding => General

Who is online

Users browsing this forum: Google Feedfetcher and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.