Copying <a> tag innertext to win clipboard when clicking href link

this might not be a PHP ? folks, but I have a report, and the left side table prints out and has hrefs in it via < a > tags printed by PHP’s “echo”. now I click the links to go to a 3rd party sight. however, the site doesn’t use GET[] with the ? qry. string spec to get explicit pages for certain criteria. thus, I have to copy the href link as text, click the link, go to the page, and past the text into the search box and submit the form I want to use. can I automated this anymore than I have now? here’s the code that gives the hrefs on the first page:

// printing table rows
            while($row = mysqli_fetch_row($sql)) {
                echo '<tr>';
                $index = 0;
                foreach ($row as $key => $col) {
                    if ($index == 0) {
                         echo "<td><a href='' target='_blank'>$col</a></td>"; }
                    else { echo "<td>$col</td>"; }
                    echo '</tr>';


Do you also control the third party site? If not, you can not do it directly this way. Since, you can not change the code on the other site.

BUT, you could load the other page into an iFrame and place the text into the text-field on the page.
It may not work as some sites protect users from loading into iFrames. But, here is a link that shows
how to fill fields on a remote site using iFrames. Never tried this myself, but, it is supposed to work.
Post To iFrame Good luck!

ummmm…ernie? i don’t think you understood what I have. the code you linked to refers to ONE page only. it looks like the code that has the SCR and the form’s action rolled into it are spose to work on the same domain. is that not right? that’s exactly what it looks like. the following code is not on a 3rd party site:


that’s code on the same domain. just diff page. the resource I need is NOT on my domain.

Well, I will attempt to explain again. You can NOT cross-domain transfer unless both ends are set up to handle the transfer of data. Usually handled by GET or POST thru HTTP. Therefore, without cooperation on the NOT-YOUR domain, you can not do it directly.

BUT, you can access the remote page by just loading it inside an iFrame. At that point it is really a webpage inside of a webpage, not really your page, but, you can control it somewhat. ( As far as their code goes, meaning you can only alter their fields and press their buttons. ) The link I gave you explained how to fill a field in another web page. You can have the webpage hidden and when ready to load it, add the text to the field. I have never done it, but, it should work. You would actually be combining their site into your site and could add a hide/show JQuery for it to bring it up when needed. If the third party remote site needs a login, you can still do it right inside your page in the iFrame. I did this once so someone could embed a full Google page inside their page to use when needed.

So, to recap, you can NOT transfer data of any type to another domain webpage without them assisting. No cross-domain transfers are allowed. ( Except, of course, with copy-paste, which is NOT a true transfer system. ) You could make a browser button to copy and load the data, but, that would be extremely complicated. Not sure if all this explains what I mean.

THAT is what I wanted. that is the only thing relevant. that explain the purpose of a frame. iFrames have been around forever. have never used one. that’s all. thanks my good man. I still reminisce about those 3 full days we spent trying to figure out godaddy’s server idiocy and security paranoia because of the huge targets on their backs. =) that was you, right? you and a few others here, @astonecipher being one of them, I find extremely valuable to talk to.

Yes, I remember talking with you about Godaddy! I have one of their servers I use for testing for other people. Oh, I do have a NFL pool up on it live. Hee! And, Astonecipher is much more a professional programmer than I am. I am more of an experimenter and researcher.

The main issue with your current task is due to hacker security, most servers do not let you transfer cross-domains without using code. After thinking further on this task, you could just use cURL and post to the page, but, it would not really show you the other page. I guess it depends on your needs. Is the 3rd party site a website you need to log into? Or is it an open site? Just makes a difference in how you would handle sending data to it. A page inside a page using iFrames would work if you need to log into the page. Sometimes iFrames have issues when you refresh them. So you may need to pass some data to the page using hidden input fields. I had to do that once passing some DB id keys.

one thing ernie:

i DO NOT do tasks. understand? if you wanna keep talking to me, you won’t say that again. thanks. I’m not a foreigner that has just immigrated to the USA. thanks. =) thanks for the advice. I’ll look into it. I’ll consider this issue closed. I’ll get back to ya if I have questions. later.

HUH? I meant your current programming task. What you are attempting to solve. Sorry if my wording annoyed you. Okay, good luck with it all.

it’s not annoying, ernie. you know why it was created don’t you? the word TASK is now popular because the undisciplined masses are immigrating into the country and don’t understand capitalism and work in the USA. thus, corporate people have used the word TASK for control and discipline purposes. it has both good and bad effects. if you didn’t know that, now you do. =) it turns some people into robots, and sits well with others. It doesn’t sit well with me. and I’m not solving anything. I’m simplifying my current setup.

LOL I know what you mean now… I see said the blind man!

BUT, caps mean the difference. “task” is not the same as “TASK”… I said “task”… Ha! Okay… All good!

[quote=“ErnieAlex, post:10, topic:33090, full:true”]
LOL I know what you mean now… I see said the blind man!

BUT, caps mean the difference. “task” is not the same as “TASK”… I said “task”… Ha! Okay… All good!
[/quote] are you calling yourself a blind man? Like I said I will get back to you if this works and I’ll try to figure it out soon. but the iframe is using a little too much time because this is a marginal annoyance that doesn’t even need a solution. Furthermore are you a moderator here? Because I’ve told @astoneciphermany times through private messages that some IP addresses that I log in from whether they be phones or machines are blocked by your software for no reason and he fixes the problem every time but had no answer. I just ran into that again using a US cellular network IP address from Wisconsin and you’re blocking that too want to see a picture?

And speaking of something else, apparently this website software isn’t the greatest because it didn’t quote your last text but the tags came through obviously. I’m on a phone at the moment but that problem happens on machines too FYI


this political non-sense crap rubs me wrong…

“The main issue with your current task is due to hacker security,” - 100% completely NOTHING wrong with that comment… and any of this his comments that used the word TASK! (stop making trouble where there is none!)

Mental note: never help vba_php… (ever)

sorry whispers. I do fine. I’m sorry you took offense. but I’ve found that people who are overly political read my words like this and think I’m one side or the other. not saying anything about you, but I can tell you that I’ve seen the same behavior for 20 years out of many people. and I generally don’t talk to them for that reason. and now it’s the worst than it’s ever been. if you don’t want to talk to me, you don’t have to. there’s 7 billions people looking at screens around the world. apparently ernie can be relaxed and understand the jokes. some can’t. this issues is closed until i get back to him. have to research. thanks. on a side note, this might be of interest to you or others, which gives a clear indication of how dumb and insane the human race has really become at this point (and for good reason, as they’ve almost reached the point of destroying themselves due to their ridiculous behavior of fighting for money and power over the last ‘‘x’’ thousand years):

you can probably thank the grandstanding weirdos in the USA government for this reality coming to pass. =(

Ha! Funny how helping someone turns into a rant session from several members… ( And, I mean that is funny, not annoyed about it at all…)

So, Astonechiper is an administrator as I and a few others. We have no control over the way the site works. We do have access to assist members and fix problems like lock-outs and ban’s. Yes, I would help you , but Astone already did… Let’s try to get back to the problem and tell us if you create a good work-around for cross-domain text transfers…

[quote=“ErnieAlex, post:15, topic:33090, full:true”] Let’s try to get back to the problem and tell us if you create a good work-around for cross-domain text transfers…
I’ll let you know. give me a bit. thanks. I’ll send you a PM with a screenshot of the ‘‘banned IP’’ error. it has happened on my machines before and made no sense. this time it’s on a phone. all astone did last time was switch the toggle to allow. i think it was a one-off

oh hey ernie and the rest here, just one more thing…

I’m not grandstanding myself, but i’ll tell you guys this…I once heard astonecipher tell someone here, who thought they knew it all but was asking BASIC questions:

““well if you won’t take my advice and won’t accept my answers (or similar), then don’t ask. after doing this work for 15 years and managing 50 people across 6 different countries, I think I can say I know what I’m doing. good luck””.

LOL. yep! I praise instances like that because obviously it happens quite a bit. I’ve turned people down who offered to pay me because they wouldn’t listen. and I’ve had some of them come back and say “why did this happen”? i’m sure you have too ernie. anyway, this is the last post from me. i’ll get back to ya.

Sponsor our Newsletter | Privacy Policy | Terms of Service