Forum Moderators: coopster

Message Too Old, No Replies

Automatic javascript usage

         

chrisjoha

10:46 am on Aug 4, 2005 (gmt 0)

10+ Year Member



Is it possible to use php to "click" a link? I'm asking because I have a service that redirects user to another page. When they come there, I want to preserve as much info as possible. In order to do this two javascript <a>-tags should be already "clicked" when the user enters. Is it possible?

zulu_dude

1:33 pm on Aug 4, 2005 (gmt 0)

10+ Year Member Top Contributors Of The Month



If I'm understanding your question correctly, I don't think PHP is the way to go.

PHP is server-side, so once the page has loaded up in the user's browser, there is nothing more that you can do with PHP (until they click onto another page or refresh the current one).

chrisjoha

2:14 pm on Aug 4, 2005 (gmt 0)

10+ Year Member



Well, I was thinking that I may be possible to send some headers or something that will carry out the action?

pureform

6:32 pm on Aug 4, 2005 (gmt 0)

10+ Year Member



You could echo hidden form fields, then submit the form with JavaScript once the user enters the page.

Like this:

<body onload="document.getElementById('formID').submit;">

<form id="formID" action="" method="">
<input type="hidden" name="" value="" />
.
.
.
</form>

mcibor

9:22 pm on Aug 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think that's it is impossible with <a to make it clicked. What you can do however is to make the links appear to have been clicked by changing the style eg:

<style><!--
a:vlink a.clicked:link, a.clicked:vlink..{color: rgb(255, 153, 0);...}//normal clicked link and class clicked have to be the same.
//-->
</style> I may have made some mistakes there, as I don't recall now css

then in those links:

<a href="whatever.html" <?php if($clicked) echo 'class="clicked" ';?>target="_blank">bla</a>
This will make the links appear to be clicked.

Hope this answers your question.
Michal Cibor

chrisjoha

6:00 am on Aug 5, 2005 (gmt 0)

10+ Year Member



Thanks for your replys. The links I need to click are on another server that I don't control. So I guess it's not possible...