Hi Guys brand new here, my 1st Question went totally off-topic & though I learned a few things about my code the Original Question was still not Answered (YET - PHP'er please check it out + Comments will HELP You HELP Me in other area's of focus)...So thought I would give it another go with something more simple this time around
OK, so the website is NFOPic.com - as you can see from the page (if you upload a txt file and convert to png) there is the code below the PNG that shows & if you click the 'Direct Link Click here' text it 'selects' everything in the 'INPUT' area. What I need to know is-:
- How to add a small link at the far right underneath or preferred inline next to the INPUT Area with 'Select & Copy' which when clicked copies the link inside to the clipboard. This of course must work in all major browsers [FireFox, Safari, Chrome, Chromium Based (Torch, EpicPrivacy, Comodo Dragon & so on] & Opera ETC ...(Older IE not important AT ALL, newer 7/8+ IE not very important, but would be great if it worked.)
ORIGINAL CODE:
<div id="direct_link">
<label for="link">Direct link to this image</label><br />
<input id="link" readonly onfocus="$(this).select()" />
Style.css
/* start add 10.07.2014 DrTech76 */
#direct_link
{
display:none;
margin: 1.5em 0;
}
#direct_link label
{
display:block;
clear:both;
}
#direct_link #link
{
width:60%;
}
/* end add 10.07.2014 DrTech76 */
MINI QUESTIONS (x2 if you have time): A) How would I make the INPUT field just long enough to hold the link? (with a bit to spare on the right as image numbers get by 2-4 chars max with a bit to spare then still, I know TextArea's but INPUT fields so full of code I need help with Please!) B) Also, I don't see where the 'link' to the 'Direct Image Link' via a /get_image.php?=img_75886996=dl - type PHP link is displayed from this, the only text relating to the section of new HTML code where the link is displayed is the Input field & the style.css with no mention of any sort of code I can see that would make a 'link' or THAT EXACT link appear - I know how the get_image.php is getting the link as I read it, what I can't get is without any code or PHP insode the INPUT field does it know to display this? Pls Help me Explain if you have time
is so damn long atm. The outsourced coder's English wasn't great,so TEXTAREA became INPUT (as I had a CodePen.io link bookmarked for the 'Select & Copy' code, but did not work on this set-up (the bookmark is lost to my dead old XP notebook now anyhow)..So anyway, that was the original idea for this, though INPUT is OK if the same feature can be added (Please?)
The original coder was a Student from India who needed to do some coding for his School Project, and as a Community-Sourced Creativity Project Collective (Non-Profit ORG) we were happy to help him out with project & to add his 1st 'Work' to his New Portfolio (with a Reference for CV/Resume)...Anyhow he turned out to be good, but did not understand ENGLISH very well. Another thing he misunderstood is in the code of my original (1st) Question here. where he adds [dl] to hide the 'source' of the images, but IMG-Host's do it all the time & doesn't seem to bother them any! an Index.html file can be added & maybe something in .htcaccess - but again the plan was for me to (as I can basically read & understand most PHP, mySQL I'm still working on (& isset, mysql_fetch_assoc, implode, explode, mysql_query & alot of the strings I can make out what they are asking for, but all the '.' etc puzzle me).. sorry, was for me to add Forum Links, Direct Links, Link to page ie. the =dl link) in TEXTAREA(s) so when ready on a VPS Server these could be un-commented to allow hotlinking, and just use the 'Direct Link to Image' (on page) option... Anyhow, all can be fixed, hopefully alot of it by the fine folks here.
THANK YOU ALL for taking the time in reading this rather long (as I look back), but details I think help define between the original goal and what I have to work with now was important, for this, past and future questions regarding this small PHP Script. Though I appreciate I am still a NEWBIE & need 2 find some questions I can answer & have a further read through re: Question Posting etiquette. I apologies to those who'd rather skip to the details, and am sure I'll get better with practice.
A MUCH APPRECIATED THANKS to ALL THOSE WHO HAVE READ & CAN & WILL HELP ME ON THIS (rather these - mini-Q's within) QUESTION & HOPE I CAN BE OF SERVICE IN ANOTHER AREA FURTHER DOWN THE TRACK IN RETURN TO ALL!
Kindly, ~jayism