linkage problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
cheatboy00
Forum Contributor
Posts: 151
Joined: Sat Jun 29, 2002 10:36 am
Location: canada
Contact:

linkage problem

Post by cheatboy00 »

my links arent working, i'm using if statements to get a link and saying if the link is equal to whatever do this etc... yet when i click on the link nothing shows up, heres the code:

Code: Select all

$links = "<HR width=75% height=3> 
<A HREF=main.php?id=dbpics>Home</a> - 
<A HREF=main.php?id=dbpics?page=kv>King Vegeta</a> - 
<A HREF=main.php?id=dbpics?page=toma>Toma</a> .....";

if(!$page)&#123;
   echo "<BR><P>Welcome to the Dragonball pictures page. ";
   echo "<BR><BR>$links";
&#125;

else if($page=='kv')&#123;
   include ("dbpics\kv.php");
   echo "<BR><BR>$links";

&#125;

else if($page=='toma')&#123;
   echo "toma";
   echo "$links";
&#125;
i put dots in the $link meanign theres more links that are in ther but thats too much code. but shouldnt this work i dont understand nothings showing up except for the if(!$page) part thats the only part that works any time you click on a link it wont work
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

For starters, this:

Code: Select all

main.php?id=dbpics?page=kv
should be

Code: Select all

main.php?id=dbpics&page=kv
// OR
main.php?id=dbpics;page=kv
Mac
User avatar
cheatboy00
Forum Contributor
Posts: 151
Joined: Sat Jun 29, 2002 10:36 am
Location: canada
Contact:

Post by cheatboy00 »

thanks that helped....

another question could you used more &stuff=blah... or whatever to the address?
User avatar
RandomEngy
Forum Contributor
Posts: 173
Joined: Wed Jun 26, 2002 3:24 pm
Contact:

Post by RandomEngy »

Yes you can.

Code: Select all

http://www.froo.com/jumping.php?submit=squirrel&text1=buttons&text2=rabbits
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

from my php book.. by wrox

"POST can also allow a greater amount of information to be transmitted - there is a physical limit to the amount you can transmit as part of a URL"
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

And it looks kinda messy.

Mac
conthox
Forum Commoner
Posts: 39
Joined: Tue Jun 25, 2002 1:44 pm
Location: Sweden

be careful using include

Post by conthox »

if u have a adress like this:

http://adress.com/main.php?page=some.php

and the main page includes the some.php page, hacker may use the line

http://adress.com/main.php?page=/etc/passwd

(or something)

to get your passwords or another "secret" fil or data.
Post Reply