SitePoint Sponsor

User Tag List

Results 1 to 20 of 20

Threaded View

  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2012
    Location
    Brisbane Australia
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Free beer for martians

    Hi
    I'm trying to teach myself web design, and I've been reading up on DHTML from an ebook that I found on the internet.
    The book is called "DHTML Utopia Modern Web Design Using JavaScript and DOM", one of this sites books. Coming from Mars I have no idea, so
    how do I create a temporary xml video playlist where members of my site can choose and select any video file, by copying and pasting,
    from the titles on a PHP page that lists all the videos that are stored in the mysql database. I adapted the add a friend for FREE BEER code to the
    following code so members could add their own videos.

    HTML Code:
    <!DOCTYPE html>
    <html>
    <head>    
          <script type="text/javascript">
              var fieldCount = 1;
          function addVideo() {
            fieldCount++;
            var newVideo = document.createElement('input');
            newVideo.type = 'text';
            newVideo.name = 'video' + fieldCount;
            newVideo.id = 'video' + fieldCount;
            document.getElementById('fs').appendChild(newVideo);
          }
        </script>
        <style type="text/css">
          input {
            display: block;
            margin-bottom: 2px;
          }
          button {
            float: right;
          }
          fieldset {
            border: 2px solid blue; 
          }
          #h1 {
    	      color: #00F;
    }	  
        #p {
    	font-size: 20px;
    }
        </style>
    </head>
    <body>
        <style1><span id="h1">Add Videos</span></style1>
    <br>
    <br>
        <form>
          <p>
            <label for="video" id="p">Video name</label>
          <input type="text" name="video" id="video">
          <fieldset id="fs">
            <legend id="p">Other videos you wish to add</legend></p>
            <button onclick="addVideo(); return false;">
              Add another video
            </button>
            <input type="text" name="video1" id="video1" max="250"> //Have I got the "max=250" in the right place and do I need to specify it somehow in the fieldCount in the header section
          </fieldset>
          <input type="submit" value="Save details">
        </form>
     </body>
    </html>
    I need the Save details button to create the temporary xml playlist file, this file needs to be saved in a diectory called wrmvlplayer
    only for as long as the user remains on wrmvlplayer page, it needs to look something like this.

    Code XML:
    <videolist>
      <video>
        <file>videos/video1.mp4</file>
        <image></image>
        <title> MP4video </title>
        <description>A video.mp4</description>
      </video>
      <video>
        <file>videos/video2.mp4</file>
        <image></image>
        <title>MP4video</title>
        <description>A video.mp4</description>
      </video>
      <video>
        <file>videos/video3.mp4</file>
        <image></image>
        <title>MP4video</title>
        <description>A video.mp4</description>
      </video> //etc,etc,etc.
    </videolist>

    I also need this file to be named wrmvlplayer.xml, otherwise I don't think it will work.
    If anyone can help or at least point me in the right direction, it would be greatly appreciated, and thanx for taking the time to read this.
    Last edited by Mittineague; Mar 19, 2012 at 12:34. Reason: reformatting bbcode tags


Bookmarks

Posting Permissions

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