Make update

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
biggipsy
Forum Newbie
Posts: 12
Joined: Tue Apr 08, 2008 6:07 am

Make update

Post by biggipsy »

I need make a update xml from php

my code is

<?php

$xml = simplexml_load_file('xmltest.xml');

$linha = $_GET['linha'];

$a = $xml->no[$linha];

// definiçao do nó a editar ou apagar neste ficheiro sera apagar




$titulo=$a->titulo[$linha]=$_POST['titulo'];
$textopequeno=$a->textopequeno[$linha]=$_POST['textopequeno'];
$textogrande=$a->textogrande[$linha]=$_POST['textogrande'];




echo $xml->asXML('xmltest.xml');


?>


This way will make update the first line , and i need to update my choice, if the $linha=1 i update de node 1 if the $linha=2 i update the node 2....How can make this?
How can make update xml from php using simplexml?
Post Reply