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 2 of 2

Thread: How to use #

  1. #1
    Regular Coder
    Join Date
    Sep 2010
    Posts
    331
    Thanks
    9
    Thanked 6 Times in 6 Posts

    How to use #

    Maybe I should be a little more specific. Ok so this is what I'm doing: I'm trying to embed any video entered into a form on my site.

    The form:
    Code:
    <form>
    <input type="text" name="decallink" value="Decal Link" />
    <input type="submit" value="Submit" />
    </form>
    The Video Embed Code
    Code:
    <div>
      <object
        type="video/avi"
        data="#"
        width="100%"
        height="100%">
        <param name="video" value="#">
      </object>
    </div>

    So say I entered http://www.youtube.com/watch?v=cSNVQzLMIIs as a link in the form. How would I get '#' in the video embed code (data and param) to change into http://www.youtube.com/watch?v=cSNVQzLMIIs?

  • #2
    Regular Coder djh101's Avatar
    Join Date
    May 2009
    Location
    California
    Posts
    628
    Thanks
    51
    Thanked 67 Times in 67 Posts
    PHP Code:
     <object
        type="video/avi"
        data="<?php echo $_POST['formInputName']; ?>"
        width="100%"
        height="100%">
    $_POST[''] is a PHP command that grabs the data from your submitted form and turns it into a variable. Although server side scripting is usually used to retrieve form data, you could also use a client side language (e.g. Javascript) if you are just inserting the data into your HTML and not using it anywhere on the server side (e.g. submitting it to a database).
    "Yeah science!"


  •  

    Posting Permissions

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