Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HTML and XML - Quick Question
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Holysword
l33t
l33t


Joined: 19 Nov 2006
Posts: 946
Location: Greece

PostPosted: Wed Nov 28, 2007 6:39 pm    Post subject: HTML and XML - Quick Question Reply with quote

I know that it seems a stupid question... but I couldn't find it anywhere. Yeah, google hate me :(

I have a XML file. I loaded it into my HTML page, byt the normal way, src="xmlfile" and bla bla bla. At <table> I delacred datasrc as the element I want to show up... good, now I have my XML data available to <span> at the table. But I want to put this XML data not inside table, but inside the <input>, as its value. So I can display the xml data inside a "form".
My HTML code:

Code:
<html>
   <head>
      <title>Cadastro de Usuario</title>
   </head>
   <body>
   <xml id="XMLUser" src="user.xml"></xml>
      <p style="color: green; font-weight: bold">Favor, preencher os dados abaixo:</p>
      <form method="post">
      <table datasrc="#XMLUser">
            <tr style="color: green; font-weight: bold">
               <td>Nome:</td><td colspan="3">
               <input name="nome" maxlength="255" size="48" type="text" value="?????????????"></td>
            </tr>
            <tr style="color: green; font-weight: bold">
               <td>E-mail:</td><td colspan="3">
               <input name="email" maxlength="64" size="48" type="text" value="???????????"></td>
            </tr>
            <tr style="color: green; font-weight: bold">
               <td>Login:</td><td>
               <input name="login" maxlength="32" size="24" type="text" value="?????????????"></td>
            </tr>
            <tr style="color: green; font-weight: bold">
               <td>Senha:</td>
               <td><input name="senha" maxlength="32" size="16" type="password"></td>
               <td>Senha (confirmacao):</td>
               <td><input name="senha_conf" maxlength="32" size="16" type="password"></td>
      </table>
      <br>
      <center><input align=center name="submit" type="submit" value="<?=$nome_botao?>">
   </body>
</html>



The ?????????? fields are where the xml data should go. How do I insert the data in there?
_________________
"Nolite arbitrari quia venerim mittere pacem in terram non veni pacem mittere sed gladium" (Yeshua Ha Mashiach)
Back to top
View user's profile Send private message
Holysword
l33t
l33t


Joined: 19 Nov 2006
Posts: 946
Location: Greece

PostPosted: Wed Nov 28, 2007 6:51 pm    Post subject: Reply with quote

Ah, there is another question... If I do not have the XML as a "file", but as a "instance" ( hell, I'm not familiarized to XML , PHP and those yet... )

If I use something like this:

Code:
<?php
function showuser(SimpleXMLElement $xml_user){
   include("showUser.html");
}
?>


showUser.html is the above HTML code... there is a way to use $xml_user variable at xml tag?? Something like:
<xml id="XMLUser" src="$xml_usr">

Or HTML can only read information from a formal file?
_________________
"Nolite arbitrari quia venerim mittere pacem in terram non veni pacem mittere sed gladium" (Yeshua Ha Mashiach)
Back to top
View user's profile Send private message
Holysword
l33t
l33t


Joined: 19 Nov 2006
Posts: 946
Location: Greece

PostPosted: Thu Nov 29, 2007 12:41 am    Post subject: Reply with quote

Really, no one? O.O
_________________
"Nolite arbitrari quia venerim mittere pacem in terram non veni pacem mittere sed gladium" (Yeshua Ha Mashiach)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum