Jump to content

Recommended Posts

I am working on allowing my users to paste a code snippet from You Tube on my site and store it as their "viedopic".  I already have the "videopic" coded.  What I need help with is changing the code they input before I store it to fit my parameters.  For example, here is a snippet of code from a You Tube video:

 

<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/CoiFGva_JoY&rel=0&color1=0x5d1719&color2=0xcd311b&border=0"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/CoiFGva_JoY&rel=0&color1=0x5d1719&color2=0xcd311b&border=0" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>

 

I'd like to change to make the following changes on the fly (before I add it to the db):

 

1) Change width to 400

2) Change height to 400

3) Replace everything from the "&" to the quotes with this:

 

&autoplay=1&rel=0&color1="black"&color2="black"

 

Link to comment
https://forums.phpfreaks.com/topic/87505-change-form-data-before-i-store-it/
Share on other sites

what you should do is just have the user post the url instead of the the hole <object> that why you are in control of everything that happens in the object parameter, then all you need to do is call the url

 

$url = $row['url'];

<object value='$url'></object>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.