Jump to content

How can I take user input and append it to a url?


cyberhost

Recommended Posts

Hello,

 

Firstly I am only just learning php so please bear with me.

 

What I want to be able to do is for a user to be able to enter a youtube url eg:

http://www.youtube.com/watch?v=8xz7ShMCWls

 

I want the scrip to take the video ID (after watch?v=) and append it into a html embed code for our forums that do not have the feature to auto embed a youtube vid.

 

<p> <img height="350" width="425" class="fw_media_youtube fw-parse" alt="YouTube-AFTER WATCH?V=CODE" src="http://thumbs.webs.com/Platform/mediaPreview.jsp?type=YouTube&id=AFTER WATCH?V=CODE"/></p>

 

Where you see AFTER WATCH?V=CODE is where I want it to place the video id and then return this completed code for the user to copy and paste:

 

<p> <img height="350" width="425" class="fw_media_youtube fw-parse" alt="YouTube-8xz7ShMCWls" src="http://thumbs.webs.com/Platform/mediaPreview.jsp?type=YouTube&id=8xz7ShMCWls"/></p>

 

How would I be able to get this done. I do not expect to be spoon fed but just a litlle help please.

 

Thank you so much if you do help.

Sorry for double post however that script does not include user input. I mean the basis of the script is great and would work. But my problem is I do not know how to take it from the user inputting the url to it dynamically creating the embed code. That script has the video urls already placed in it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.