473,804 Members | 2,747 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting a Javascript vairiable into a PHP vairiable automatically without clicking a link or button?

J
Hi All,
I have a quick question,
I am making a little script that shows users how easy it is to have there
clipboards read.

I would like to capture my users clipboard (plain text only) and then
AUTOMATICALLY send them to a page displaying there contents, I want to get
the +content+ put into a $content vairiable for easier manipulation in PHP.

As javascript is client side and PHP serverside, i need to submit the form
somehow, and this is what I have come up with (below)...
Any other ideas would be cool, and I then pick up the values from Javascipt
and then GET the content and put it into a vairiable in PHP, but this means
clicking a link or button.
Do you now of an automatic way of doing this? maybe a auto refresh?? I dont
know??? will it work?

Thanks all,
J
------------------------------ File ---------------------------
<html><head></head><body>
<?
if (content){
$string = $_GET['content'];
echo $string;
}
?>
<SCRIPT LANGUAGE='JavaS cript'>
<!-- //
var content = clipboardData.g etData("Text");
document.write( '<a href="jim.php?c ontent='+conten t+'">Click here</a>');
var content=content ;
// -->
</SCRIPT>
</body></html>
Jul 23 '05 #1
5 1543
J wrote:
Hi All,
I have a quick question,
I am making a little script that shows users how easy it is to have there
clipboards read.


Ha, ha ha, ha ha ha, ROFLMAO ... :-x

Can you *really* do this on Windows/IE? Reliably?

He he, haw haw, gosh, somebody stop me!

I'll absolutely guarantee that this will not work on my system!
It really is that easy.

Have a good one :-)
--
Zif
Jul 23 '05 #2
J
It does work, look into it before assuming because you don't know about it,
it doesn't exist.

Its not very reliable though, obviously they need some plain text in the
clipboard, and hopefully not any HTML or any other script, just something
like "hello, test" or something like that.

Anyway, back to my question, do you know of a way to automatically submit
the data on pageLoad?

Thanks
Jim

PS you might want to read
http://www.arstdesign.com/articles/c...rdexploit.html before commenting.

"Zifud" <Zi***@hotmail. com> wrote in message
news:gI******** ******@news.opt us.net.au...
J wrote:
Hi All,
I have a quick question,
I am making a little script that shows users how easy it is to have there
clipboards read.


Ha, ha ha, ha ha ha, ROFLMAO ... :-x

Can you *really* do this on Windows/IE? Reliably?

He he, haw haw, gosh, somebody stop me!

I'll absolutely guarantee that this will not work on my system!
It really is that easy.

Have a good one :-)
--
Zif

Jul 23 '05 #3
Ivo
"J" wrote
I would like to capture my users clipboard (plain text only) and then
AUTOMATICALLY send them to a page displaying there contents, I want
to get the +content+ put into a $content vairiable for easier manipulation
in PHP.


If the purpose of this excercise is only the demonstration of clipboard
functionality, there is no need for PHP or a second page:

var a=clipboardData .getData("Text" );
document.write( a.replace(/</g,'&lt;') );

will be plenty.
You strengthen your user's trust in you by NOT sending their clipboard
back to your server.
hth
--
Ivo


Jul 23 '05 #4
J wrote:
It does work, look into it before assuming because you don't know about it,
it doesn't exist.
Please don't top-post, read the group FAQ:

<URL:http://jibbering.com/faq/#FAQ2_3>

Its not very reliable though, obviously they need some plain text in the
clipboard, and hopefully not any HTML or any other script, just something
like "hello, test" or something like that.
I know it works on *one* particular platform with *one*
particular browser, please turn sarcasm detector to "on".

It does not work on any platform/browser combination that I use.

Anyway, back to my question, do you know of a way to automatically submit
the data on pageLoad?


The reference you quote points out the silliness of allowing a
script writer to arbitrarily access the clipboard. Point your
visitors there.

Further, you can't guarantee that there is *anything* in the
clipboard, much less something worth stealing - or even if there
is, that you can do anything useful with it.

In plain English: it is not a security hazard, it is a silliness
hazard.

Please reinstate sarcasm detector to your preferred setting...

--
Zif
Jul 23 '05 #5
J
Yeah I suppose your right.
Ta.

"Ivo" <no@thank.you > wrote in message
news:42******** *************** @news.wanadoo.n l...
"J" wrote
I would like to capture my users clipboard (plain text only) and then
AUTOMATICALLY send them to a page displaying there contents, I want
to get the +content+ put into a $content vairiable for easier
manipulation
in PHP.


If the purpose of this excercise is only the demonstration of clipboard
functionality, there is no need for PHP or a second page:

var a=clipboardData .getData("Text" );
document.write( a.replace(/</g,'&lt;') );

will be plenty.
You strengthen your user's trust in you by NOT sending their clipboard
back to your server.
hth
--
Ivo

Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2819
by: KenLee | last post by:
I worked on Windows application. I made a application to covert flat file to insert database. currently, I made a button to display progress bar after clicking the button. I just want to load automatically after clicking application.exe file without clicking the button on the form loaded. is there any way to load form and start automatically without clicking any button?
8
3681
by: chrisdude911 | last post by:
how do i add video into a javascript web page with my own custom buttons?
6
3948
by: hemant.singh | last post by:
Hi all, I am trying to get a way by which I'll know exactly when user goes out of my site by clicking on close button in browser, So that w/e user click close button in browser, I can send a signal to server. This seems to be achievable with body unload events, but it is little too much, as even if user navigate within my site, this event will be generated, this can be avoided by handling onclick of each link, so that I'll know exactly...
0
9711
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9591
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10343
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9166
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7631
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5529
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5667
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4306
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.