I found , in the past , a website . In this the website page there are two links

link1

link2

when I click on the first link (link1) a red sentence appears , in the web page , saying that the link is desactivated .

then , when I click on the second link (link2) a red sentence appears too , in the web page , saying that the link is desactivated .

but something odd and strange happened and surprised me : when I clicked the second link(link2) and then , after that immediately , the first link(link1) , **a new sentence appeared saying , the first link (link1) is activated.
**
apparently , the link1 is enabled throughout the link2

my questions are :

what is the name of this technical method or this technique ? any information about it , how it works?
how do we explain the fact that only after click the link2 that the link1 become enable?
it really confuses

It is called Javascript ;). It would work something like:

<script>
function activateLinkOne()
{
    displayMessage('Link 2 is disabled.');
    link1.activate();
    return false;
}
</script>

<a href="link.com" onclick="return false;">Link 1</a>
<a href="link2.com" onclick="activateLinkOne()">Link 2</a>

(Note that this code will not work; it is merely an example).

ok , to add more information

when I click the first link

the url becomes for example

www.example.com/something.php?link=1
second link
www.example.com/something.php?link=2

"It is called Javascript ;)"

is not called php security method ??????

does it has something to do with php script and get method ????

another important question . when the link is desactivated we cannot get its content. How to bypass the link desactivation to get its content????

Do you have the code that we can look at? At this point belated in your description, those that respond are simple guessing.

This may be javascript or some server side scripting that is controlling this behavior.

Bypassing a deactivated link of another site to get to its content would be hacking, which isn't something discussed here. If you would like to replicate this effect in a site you're developing we can provide examples of how to
do this as minitauros did.

In essence there are two ways to accomplish this, server side and client side. The client side would revolve around using a Javascript event bound to clicking on the second link, which uses DOM manipulation to activate the first link. There are methods to bypass JavaScript restrictions like this but I will not discuss them here.

If you're clicking the link and it's actually taking you to a separate page (reloading the screen) which gives you the red message, it's probably server-side - Most likely done with a sookie/esssion variable set when you click link 2, that when you then visit the page link 1 points to, it recognizes the session variable and allows access.

anyway, I found the solution . It has nothing to do with all what you wrote guys but thanks

Yes u can do someting like ....

<?php
function somefunction(){
.....
}
if(!empty($_GET['function'])){
  $_GET['function']();  
}
?> <html> <head>
    ........
    </head> <body> <a href="currentpage.php?function=somefunction"></a> </body> </html>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.