Previous Article
No Captcha ReCaptcha 2.0 with ASP Classic
ASP Classic play YouTube videos on your page
Go Back To List
Form Processing
Coding Article #: 83 - Published On: July 07, 2017 @ 14:51:45 PM - Last Updated on: July 07, 2017
This article has been Favorited 0 times
Join today, and add this to your favorites.
Coding Source - Share on MySpace Coding Source - Share With Facebook Coding Source - Share on Twitter Coding Source - Share on Reddit Coding Source - Share on Digg It Coding Source - Share on Stumble Upon It Coding Source - Share on Delicious
Share With Friends (Updated 6-8-2010)

Supported Files
No Files for this Article.
No Screenshot Available

Allow your visitors to play YouTube videos on your site.
This brings your visitors closer to your site, in a way that is not typical of most websites.

Part 1:
Create a New webpage and name it: Youtube.asp
Create a Form, with a text field and a Submit button.
Set the Method of the form to [POST], and the action, set to the same page we are on.

<form method="post" action="Youtube.asp">
<input type="text" name="YouTube" />
<input type="submit" name="Submit" value="Play YouTube Video" />

Part 2:
Using an IF STATEMENT, allows us to have the content on the same page, and only show it when the visitor
Supplied a YouTube video ID. Example: C-FGs18RCwk
And the Submit Button has been fired, with the Value of: Play YouTube Video

<%if request.Form("Submit")="Play YouTube Video" then
UTube = trim(request.Form("YouTube"))
UTube = replace(UTube, "'","'")

Part 3:
This is the YouTube Object Properties.
This is where the Video will be displayed at.
You can change the values of the width and height to the following.

width="560" height="315"
width="640" height="360"
width="853" height="480"
width="1280" height="720"
Going Higher than this, can make some visitors page to huge for their monitor.

<object width="425" height="344">
<param name="movie" value="<%=UTube%>&hl=en_US&fs=1&"></param>
<param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>
<embed src="<%=UTube%>&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed>
<%end if%>

Post to Facebook about: ASP Classic play YouTube videos on your page