PDA

View Full Version : Save grid-editor server side...



genius551v
23 Oct 2006, 2:56 PM
hi,

can someone give a example o tell me where find a example to "save.php" in server side.
and "handleSuccess" and "handleFailure" in client side plz.... :-(



function onSaveClick(e){
var xml = dataModel.getDocument();
var cb = {success: handleSuccess, failure: handleFailure}
YAHOO.util.Connect.asyncRequest('POST', 'save.php', cb, xml);
};


...tnks

genius551v
24 Oct 2006, 6:34 AM
Help..... :cry:

genius551v
24 Oct 2006, 8:23 AM
ok, my save.php



<?php

$con=mysql_connect("localhost","","");
if(!$con){
return ('failure');
}
else{
mysql_select_db("grilla",$con);
$sql="insert into profesores(codigo,nombre,facultad) values('2','cristianM','sistemas')";
$resul=mysql_query($sql,$con);
mysql_close($con);
}
?>


lo hace muy bien, obvio solamente inserta un dato quemado en el codigo en la bd pero es solo para probar q se ejecuta.

ahor: como diablos cojo el xml??? como lo abro??? como lo recorro??? como devuelvo succes or fail???

IMPLORANDO AYUDA PORFAVOR!!!


heeeeelllllpppppp me PLZ!

jack.slocum
24 Oct 2006, 10:10 AM
This isn't simple code to put up an example. What you are looking for is an example of parsing an xml document in PHP and inserting/updating the resulting data into your database. There are probably many examples of this out on the web. I would recommend doing a search on google.

genius551v
24 Oct 2006, 3:46 PM
Jack GRACIAS por retarme constantemente a superarme por mi mismo....

Jack THANKYOU to challenge me constantly to surpass me by my self?.

look this guys:

http://www.theragingche.com/blog/archive/648/

Tnks again

:-)