Jump to content

Linking inside own file


XeroXer

Recommended Posts

Hello again.
Back with another problem.
I want to make my guestbook into only one file.
Therefore I want to link inside the own file.
So I took from a tutorial this code:
(part1)
[code]<a href="index.php">default</a>
<a href="index.php?id=1">id 1</a>
<a href="index.php?id=2">id 2</a>
<a href="index.php?id=3">id 3</a>[/code]
(part2)
[code]<?php
switch($id) {
case 1:
echo "Number 1";
break;
case 2:
echo "Number 2";
break;
case 3:
echo "Number 3";
break;
default:
echo "No number between 1 and 3";
}
?>[/code]

They said it should work on the site.
But regardless of what link I press the result always ends up with the default.
So is there another way this should be done.
I just need to get my guestbook into one file. :-)

Please help...  ???
Link to comment
https://forums.phpfreaks.com/topic/15947-linking-inside-own-file/
Share on other sites

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.