Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    Regular Coder
    Join Date
    Dec 2006
    Posts
    306
    Thanks
    24
    Thanked 0 Times in 0 Posts

    resize a video's size and display it

    Hello;
    I am trying to resize a video's size to be smaller after users submit a video from a form.
    and the problem i have are:
    1) i use the preg_replace function to do that, but it doesn't change anything.
    2) there is not video in the Test.php after i load the page.

    Could anyone help, please.

    the works i have done as following:

    the following video is going to submit, and i want to resize the size to be smaller.
    <object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/VsS130ngqMU"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/VsS130ngqMU" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>

    Code:
    <html>
    <body>
    
    
    <?php
            if($_POST['object']){
           $object=addslashes($_POST['object']);
            $object=htmlspecialchars($object);
    
            $pattern="/width=\"([0-9]+)\" height=\"([0-9]+)\"/";
            $replacement="width=\"100\" height=\"100\"";
    
            $pattern=htmlspecialchars($pattern);
            $replacement=htmlspecialchars($replacement);
    
            $object= preg_replace($pattern, $replacement, $object);
    
            echo $object;
            $object=htmlspecialchars_decode($object);
             echo $object;
        }
        else{
    ?>
    <form action="Test.php" method="post">    
    <INPUT type="text" name="object" value="" maxlength="500"> 
    <input type="submit" value="Submit">
    </form>
    
    <?php
    }
    ?>
       
    </body>
    </html>
    Last edited by kamkam; 03-01-2008 at 11:37 PM.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •