Jump to content

[HTML/PHP/JAVAscript] popup box or "copy" button

I have a small website for fun use (self host, so PHP and scripts are fully open)

I want a link of some sort that either makes a pop-up with a IP/HOST and a port number. (doesn't have to be dynamic, would be awesome tho'), or it could simply be a button that highlights and copy a specific text to the clipholder-folder-thingy.

 

If some one knows how to do this, could you show me how to? Or just, make it, for me?

 

English isn't my "first language" so if you don't understand this, I can try explain it better.

 

EDIT: Is this even the right place to place this ?

I'm full of questions :O

Link to comment
https://linustechtips.com/topic/64519-htmlphpjavascript-popup-box-or-copy-button/
Share on other sites

Link to post
Share on other sites

You could easily make a popup with the information....

 

Check out the PHP $_SERVER[] vars:

http://php.net/manual/en/reserved.variables.server.php

 

I would then just make a pop up using javascript...

 

If you want to copy it to the clipboard I believe you have to use flash.... This is the only way I remember being able to do it but, I haven't done it for years.

Link to post
Share on other sites

Is this what you're looking for? http://davidwalsh.name/clipboard

 

EDIT: If you don't want flash, you could always have a note that tells the user to "command/ctrl + c to copy" the highlighted text, then you could just use something like this:

<input type="text" value="Whatever you want to be in the textbox" onmouseover="this.select()" readonly/>

Or, if you wanted the text to be automatically loaded, you could use onload instead of onmouseover.

Edited by JamesMontour

The Workstation – Motherboard: ASUS P9X79 WS | CPU: Intel i7-4930k @ 4GHz | GPU: EVGA GTX 780 Superclocked | RAM: 32GB G.Skill RipjawsX 1600MHz | Storage: 250GB Samsung EVO SSD, 3TB WD Green  | PSU: Corsair AX760i

The Server – Motherboard: ASUS M4A78LT-M | CPU: AMD Athlon II X2 240 @ 3.0GHz | RAM: 4GB 1333MHz | Case: Silverstone PS08

The iMac – CPU: Intel i7-2600 @ 3.5GHz | GPU: Radeon HD 6970M 2GB | RAM: 16GB 1600MHz | Storage: Hitachi 2TB 7200RPM

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×