Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

PHP and clipboard
Does anybody know a way of placing text into the clipboard using PHP?

I have wrote a script in PHP which a program runs on it's selection.
Unforuantly, what ever you send back to the program from the PHP script it
replaces what you originally selected with the output.

So what I am looking at doing is being able to send it directly to windows
clipboard from PHP.


Regards

Stefan



Report this thread to moderator Post Follow-up to this message
Old Post
Phantom_guitarist
12-23-04 08:58 PM


Re: PHP and clipboard
> Does anybody know a way of placing text into the clipboard using PHP?

I dont think this is possible in PHP without any exstra extensions. You may
try to create a .NET application or Java application that does the
"copy-to-clipboard" job, and then intigrate that program in to PHP with
dotnet_load or "new Java()". (I would never do this.. :P)

Normaly they say : "Use the correct language for the correct purpose" So i
guess that PHP is not correct in this case... Im sorry.

Good Luck!

Regards,
Glenn O Larsen



Report this thread to moderator Post Follow-up to this message
Old Post
Glenn O Larsen
12-23-04 08:58 PM


Re: PHP and clipboard
*** Phantom_guitarist wrote/escribió (Thu, 23 Dec 2004 15:02:17 -0000):
> Does anybody know a way of placing text into the clipboard using PHP?

What clipboard do you mean? Clipboard is a feature of GUIs so the concept
doesn't make much sense when we're talking about a web server that
typically runs as service or daemon. If you're writing a shell script then
you should find a program that does the job and call it via exec(). The
exact command depends on your window manager.


--
-- Álvaro G. Vicario - Burgos, Spain
-- Thank you for not e-mailing me your questions
--

Report this thread to moderator Post Follow-up to this message
Old Post
Alvaro G Vicario
12-23-04 08:58 PM


Re: PHP and clipboard
Thanks.
Managed to find a program to copy to the clipboard but I am now having
problems passing arguments to the program using exec().

I persume I just add them to the end of the command (seperate with a space).

eg.

exec("command.exe 'hello'");

or

exec("command.exe '".$text."'");

regards

Stefan


"Alvaro G Vicario" <alvaro_QUITAR_REMOVE@telecomputeronline.com> wrote in
message news:eh32f7tumgwf$.5yjq5g2v3msl$.dlg@40tude.net...
> *** Phantom_guitarist wrote/escribió (Thu, 23 Dec 2004 15:02:17 -0000): 
>
> What clipboard do you mean? Clipboard is a feature of GUIs so the concept
> doesn't make much sense when we're talking about a web server that
> typically runs as service or daemon. If you're writing a shell script then
> you should find a program that does the job and call it via exec(). The
> exact command depends on your window manager.
>
>
> --
> -- Álvaro G. Vicario - Burgos, Spain
> -- Thank you for not e-mailing me your questions
> --



Report this thread to moderator Post Follow-up to this message
Old Post
Phantom_guitarist
12-23-04 08:58 PM


Re: PHP and clipboard
*** Phantom_guitarist wrote/escribió (Thu, 23 Dec 2004 16:13:00 -0000):
> I persume I just add them to the end of the command (seperate with a space).[/colo
r]

That's it.

> exec("command.exe 'hello'");

If you don't type the command's full path, make sure the system knows how
to find it (i.e., its folder is in the PATH variable).



--
-- Álvaro G. Vicario - Burgos, Spain
-- Thank you for not e-mailing me your questions
--

Report this thread to moderator Post Follow-up to this message
Old Post
Alvaro G Vicario
12-28-04 01:59 PM


Re: PHP and clipboard
> Does anybody know a way of placing text into the clipboard using PHP?

I dont think this is possible in PHP without any exstra extensions. You may
try to create a .NET application or Java application that does the
"copy-to-clipboard" job, and then intigrate that program in to PHP with
dotnet_load or "new Java()". (I would never do this.. :P)

Normaly they say : "Use the correct language for the correct purpose" So i
guess that PHP is not correct in this case... Im sorry.

Good Luck!

Regards,
Glenn O Larsen



Report this thread to moderator Post Follow-up to this message
Old Post
Glenn O Larsen
12-28-04 08:56 PM


Re: PHP and clipboard
Thanks.
Managed to find a program to copy to the clipboard but I am now having
problems passing arguments to the program using exec().

I persume I just add them to the end of the command (seperate with a space).

eg.

exec("command.exe 'hello'");

or

exec("command.exe '".$text."'");

regards

Stefan


"Alvaro G Vicario" <alvaro_QUITAR_REMOVE@telecomputeronline.com> wrote in
message news:eh32f7tumgwf$.5yjq5g2v3msl$.dlg@40tude.net...
> *** Phantom_guitarist wrote/escribió (Thu, 23 Dec 2004 15:02:17 -0000): 
>
> What clipboard do you mean? Clipboard is a feature of GUIs so the concept
> doesn't make much sense when we're talking about a web server that
> typically runs as service or daemon. If you're writing a shell script then
> you should find a program that does the job and call it via exec(). The
> exact command depends on your window manager.
>
>
> --
> -- Álvaro G. Vicario - Burgos, Spain
> -- Thank you for not e-mailing me your questions
> --



Report this thread to moderator Post Follow-up to this message
Old Post
Phantom_guitarist
12-28-04 08:56 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Language archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:57 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.