
Zhris
Enthusiast
Jun 15, 2010, 9:27 PM
Post #2 of 2
(3244 views)
|
Re: [Tsalagi] Play you tube vids
[In reply to]
|
Can't Post
|
|
A very rough script which performs your specified task:
#! /usr/bin/perl use strict; use CGI ':standard'; $CGI::POST_MAX = 1000000; print "content-type: text/html\n\n"; ##### my $mysubmit = param('mysubmit'); my $mytextarea = param('mytextarea'); ##### if ($mysubmit) { if ($mytextarea =~ m/^<object.+<\/object>/) { #Commented line below will autoplay video #$mytextarea =~ s/(<embed src=\"[^\"]+)/$1&autoplay=1/; print qq($mytextarea); } else { print qq(<p>Invalid embed code</p>); } } ##### print qq(<form action="script.pl" method="post"><textarea name="mytextarea">$mytextarea</textarea><input type="submit" name="mysubmit" value="Play Video" /></form>); Chris
(This post was edited by Zhris on Jun 15, 2010, 9:49 PM)
|