Results 1 to 4 of 4

Thread: XML writing failing

  1. #1
    Join Date
    Oct 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy XML writing failing

    Hello im using a php file to write and read a xml, but when i fill the information into the file.php this dont write anything into the file.xml. Please some help.
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Add a Video</title>
    <style>
    body{ 
    	font:13px Arial, Helvetica, sans-serif;
    	color:#000;
    	text-align:center;
    }
    body, h1, h2, h3, h4, h5, p, table, table th, form, a img, ul {
    	border: none;
    	margin: 0px;
    	padding: 0px;
    }
    #page{ margin:0 auto; padding:0px; width:980px; text-align:left; background:#fff; }
    form{ margin:0 auto; padding:0px;  text-align:left; }
    form td{ padding:0px 10px 10px 0px; vertical-align:top; }
    form .inputtext{ border:solid 1px #c0c0c0; width:300px;  padding:3px; }
    form textarea{ border:solid 1px #c0c0c0; width:600px; height:150px; padding:3px; }
    form #submit{ background:#292A2C; color:#fff; border:0px; padding:5px; cursor:pointer; }
    form h2{ padding:20px 0px 20px 0px; color:#344EB6; }
    form input, form textarea{ font:13px Arial, Helvetica, sans-serif; }
    .green{ color: #46800d; padding-bottom:20px; font-weight:bold; }
    </style>
    <script src="script.js" type="text/javascript"></script>
    </head>
    <body>
    <div id="page">
    <form action="<?=$_SERVER['PHP_SELF'];?>" method="post" name="form" id="form" onsubmit="return addvideo();">
    <h2>Add a video</h2>
    <p><?=$message?></p>
    <table cellpadding="0" cellspacing="0">
    <tr><td>Team:</td><td><input type="text" id="team" name="team" value="" class="inputtext" /></td></tr>
    <tr><td>Video ID:</td><td><input type="text" id="videoid" name="videoid" value="" class="inputtext" /></td></tr>
    <tr><td>Title</td><td><input type="text" id="title" name="title" value="" class="inputtext" /></td></tr>
    <tr><td>The Idea</td><td><textarea name="theidea" id="theidea"></textarea></td></tr>
    <tr><td>Credits</td><td><textarea name="credits" id="credits"></textarea></td></tr>
    <tr><td></td><td><input type="submit" name="submit" id="submit" value="Submit" /></td></tr>
    </table>
    </form>
    </div>
    </body>
    </html>
    Last edited by jscheuer1; 10-25-2010 at 03:22 PM. Reason: add code tags

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    there's nothing in that code that deals with xml at all. Your only PHP code is <?=$message?> (which ought to be <?php echo $message; ?>), but you don't even include the php that sets a value to that variable.

  3. #3
    Join Date
    Oct 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Adrian is there a way that you can guide me about how to add the variables that you said?
    Regards
    Mariela

  4. #4
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    From what you have posted it is unclear what you want. There is no XML file reference in there and the $message variable is not being set to anything. What Traq posted for you was how to display the contents of the variable but I don't see that being set anywhere. Is there more code or is this all of the code? When you said you are writting to and reading an XML file, is that what you want to do here or do you do that somewhere else?
    Corrections to my coding/thoughts welcome.

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
  •