XML Value edit
Moderator: General Moderators
-
geniuscapri
- Forum Newbie
- Posts: 7
- Joined: Tue Mar 25, 2008 5:31 am
XML Value edit
Hello Friends,
any one know how we can edit xml value with php???
any one know how we can edit xml value with php???
Re: XML Value edit
You should read about XPath and PHP' s SimpleXML to edit XML using PHP. For a first step read this itutorial
-
geniuscapri
- Forum Newbie
- Posts: 7
- Joined: Tue Mar 25, 2008 5:31 am
Re: XML Value edit
again here.
i have 3 input fields UserName: CountryName: Age:
i want to insert this out put data in XML. it should be multiple data.
and after adding i also want to edit them or delete.
any one can help me about it???
This is a experiment
i have 3 input fields UserName: CountryName: Age:
i want to insert this out put data in XML. it should be multiple data.
and after adding i also want to edit them or delete.
any one can help me about it???
This is a experiment
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: XML Value edit
I'm not seeing much effort come from your direction. Have you tried anything yet? Anything you got stuck on? If we think you're trying and you demonstrate that you're at least trying then maybe we'll offer more help. What did you think of the article Rovas linked to?geniuscapri wrote:again here.![]()
i have 3 input fields UserName: CountryName: Age:
i want to insert this out put data in XML. it should be multiple data.
and after adding i also want to edit them or delete.
any one can help me about it???
This is a experiment
-
geniuscapri
- Forum Newbie
- Posts: 7
- Joined: Tue Mar 25, 2008 5:31 am
Re: XML Value edit
no i have not tried any thing yet.
i am here just for looking any example script.
i am here just for looking any example script.
-
geniuscapri
- Forum Newbie
- Posts: 7
- Joined: Tue Mar 25, 2008 5:31 am
Re: XML Value edit
no any reply 
Re: XML Value edit
You got the wrong idea nobody will offer you a script to do what you need. Read the rules: You put the code we help you fix it if it can be fixed.
-
geniuscapri
- Forum Newbie
- Posts: 7
- Joined: Tue Mar 25, 2008 5:31 am
Re: XML Value edit
This is My XML Code!
and This is my PHP Code
every thing is working. now want to edit any some values who's between <user_info> </ user_info> tags.
now start my problem
i am going to send user_info as ref to another page for edit my xml data.
i am doing this with.
But $userinfo_tag2 is not going to my next page.
now Rovas can you help me???
Code: Select all
<users_acounts>
<user_info>
<username>asdfasd</username>
<password>fasd</password>
<firstname>fasdf</firstname>
<lastname></lastname>
<email></email>
<mail_stop></mail_stop>
<phone></phone>
<permission>
<readonly>no</readonly>
<img_manager>no</img_manager>
<doc_share>no</doc_share>
<CPX>no</CPX>
</permission>
</user_info>
<user_info>
<username>fhjfgjhfg</username>
<password>jhfgjhfg</password>
<firstname>jhfgjhfghj</firstname>
<lastname></lastname>
<email></email>
<mail_stop></mail_stop>
<phone></phone>
<permission>
<readonly>no</readonly>
<img_manager>no</img_manager>
<doc_share>no</doc_share>
<CPX>no</CPX>
</permission>
</user_info>
</users_acounts>
Code: Select all
<?php
$file = 'testFile.xml';
if (file_exists($file)) {
// load file
$xml = simplexml_load_file($file) or die ("Unable to load XML file!");
$userinfo_tag=$xml->user_info;
foreach($userinfo_tag as $userinfo_tag2)
{
$xml = simplexml_load_file($file) or die ("Unable to load XML file!");
$username_tag=$userinfo_tag2->username;
foreach($username_tag as $un_value)
{
echo $un_value;
} ?>now start my problem
i am going to send user_info as ref to another page for edit my xml data.
i am doing this with.
Code: Select all
<a href="user_edit.php?userinfo=<?php echo $userinfo_tag2;?>">Edit</a>now Rovas can you help me???
-
geniuscapri
- Forum Newbie
- Posts: 7
- Joined: Tue Mar 25, 2008 5:31 am
Re: XML Value edit
again no reply 
-
geniuscapri
- Forum Newbie
- Posts: 7
- Joined: Tue Mar 25, 2008 5:31 am
Re: XML Value edit
no any reply 