-5

What i wanna do is create two hyperlinks and both links take them to xx.php.

so what i want is if someone clicks link 1 it shows them echo "hello"; and if link two is clicked then it shows echo "Hi";

but both statements are on something.php

Regards,

djEthen
  • 29
  • 1
  • 1
  • 7

1 Answers1

0

Then add this code on your so called something.php

1)Link 1

<a href="xxx.php?link=1>Link 1 </a>

2) Link 2

<a href="xxx.php?link=2>Link 2 </a>

Then on xxx.php

do this

<?php

    if ($_GET['link'] == "1") {

       echo "hello";
    }
    if ($_GET['link'] == "2") {

       echo "hi";
    }
?>
chandresh_cool
  • 11,753
  • 3
  • 30
  • 45
  • 1
    Whilst technically correct, just doing everything for a user who has made no effort at all to address their own problem does not really help them, just makes them more reliant on other people to do everything for them. – Anigel May 15 '13 at 08:05