HTML links executing PHP? ;/

Questions about programming languages and debugging
Post Reply
User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

HTML links executing PHP? ;/

Post by ayu »

I was just starting to make another page for my site, and i realized that i never covered this bit....

for example if i make it like this (doesnt work, just an example)


http://justbgeek.com/info2.txt


now as you can see i want a regular link that does something "whatever" using PHP when submitted =/

can't figure it out....well the clock is 00:58 atm so might be that ^^

Anyway, any ideas?
"The best place to hide a tree, is in a forest"

p99
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 291
Joined: 14 Oct 2006, 16:00
17
Location: Some hippy's van
Contact:

Post by p99 »

Your close but not quite

Code: Select all

[?php
if($_GET['link'] == "./?home") {
echo "something";
}
?>

]form action="./?" name="link"]
[a href="./?home]
[/a]
You want it to be like this:

Code: Select all

[?php
if ($_GET['name'] == 'home'){
go hthere;}
?]
 [a href="?name=home"]  home  [/a ]
You don't even need a form to do this.
I had to replace the html tags with "[]"
Mods can't you guys use php to display html in a friendly way? Otherwise how do other forums allow tags that don't do anything?

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Post by ayu »

yeah i thought about something like that, thanks p99 =)

appreciate it
"The best place to hide a tree, is in a forest"

p99
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 291
Joined: 14 Oct 2006, 16:00
17
Location: Some hippy's van
Contact:

Post by p99 »

No problem. I had the exact same speedbump in learning php myself like 3 days ago.

Post Reply