Log in

View Full Version : XML writing failing



webssolutions
10-25-2010, 01:45 PM
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.

<!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>

traq
10-25-2010, 02:10 PM
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.

webssolutions
10-25-2010, 03:09 PM
Adrian is there a way that you can guide me about how to add the variables that you said?
Regards
Mariela

bluewalrus
10-25-2010, 04:52 PM
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?