Jump to content

[SOLVED] How do I delete certain amount of characters when I upload from a form?


pneudralics

Recommended Posts

The form below uploads youtube video link ex:

To the database. I want the ease of just copying the link but want to get rid of "http://www.youtube.com/watch?v=" when I upload the link to my database. How would I filter that out.

 

<?php
//This is the page for the video section
include ('header.php');

//Retrieve video info
$videoselect = "SELECT * FROM video";

if ($videoresult = mysql_query ($videoselect)) {
while ($row = mysql_fetch_array ($videoresult)) {
$url = $row['url'];
$description = $row['description'];
?>
<table width="800" align="center">
<tr>
    <td align="center">
<object width="425" height="344">
<param name="movie" value="<?php echo "$url"; ?>&hl=en&fs=1"></param>
<param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>
<embed src="<?php echo "$url"; ?>&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed>
</object>
<br />
<?php
echo "$description";
?>	
    </td>
    </tr>
</table>
<?php	
}//End while loop
}//end if while
?>


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.