Click here to Skip to main content
15,912,082 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
AnswerRe: Biswanath Pal:Problem On API Application Pin
alex.barylski10-Jul-08 10:47
alex.barylski10-Jul-08 10:47 
QuestionHow can I store an image to the database's field ? Pin
Mohammad Dayyan5-Jul-08 12:38
Mohammad Dayyan5-Jul-08 12:38 
AnswerRe: How can I store an image to the database's field ? Pin
Hari Om Prakash Sharma6-Jul-08 23:26
Hari Om Prakash Sharma6-Jul-08 23:26 
GeneralRe: How can I store an image to the database's field ? Pin
Mohammad Dayyan8-Jul-08 23:21
Mohammad Dayyan8-Jul-08 23:21 
GeneralRe: How can I store an image to the database's field ? Pin
Hari Om Prakash Sharma9-Jul-08 1:44
Hari Om Prakash Sharma9-Jul-08 1:44 
AnswerRe: How can I store an image to the database's field ? Pin
Marc Firth15-Jul-08 2:40
Marc Firth15-Jul-08 2:40 
GeneralRe: How can I store an image to the database's field ? Pin
Mohammad Dayyan3-Aug-08 10:21
Mohammad Dayyan3-Aug-08 10:21 
QuestionFunction return XML object.... unable to parse it to javascript Pin
Y_Kaushik25-Jun-08 19:42
Y_Kaushik25-Jun-08 19:42 
Hello guru's
I am writing an API for my project in this case one of function return XML message ( actually its a small xml node ) i store that xml to an variable and if i alert if its show correct XML data, and if i pass it to function its give error <xml_variable> is not defined ........ I am very new in XML can any one told me where i am doing wrong. My complete code is given below.

<?
Required class file and javascript files.
?>
<html>
<head>
<title></title>
<link href="templates/<?php echo $TEMPLATE ?>/css/stylesheet.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="templates/<?php echo $TEMPLATE ?>/javascript/jstb_validations.js"></script>
<script type="text/javascript" src="templates/<?php echo $TEMPLATE ?>/javascript/AjaxRequest.js"></script>
<script type="text/javascript" src="templates/<?php echo $TEMPLATE ?>/javascript/xparse.js"></script>
<script language="javascript" type="text/javascript">
</script>
<!------- Validation for client side java script function ---------->
<script type="text/javascript">

function parseXML()
{
var device_type_name = document.getElementById('device_type_name').value;
var reporting_interval = document.getElementById('reporting_interval').value;
var module = document.getElementById('module').value;
var version = document.getElementById('version').value;
var s_key = document.getElementById('s_key').value;
var uid = document.getElementById('uid').value;
var lang = document.getElementById('lang').value;
var strUrl = 'api/index.php?device_type_name='+device_type_name+'&reporting_interval='+reporting_interval+'&module='+module+'&version='+version+'&s_key='+s_key+'&uid='+uid+'&lang='+lang;
// var strUrl = 'api/index.php?device_type_name=trewq&reporting_interval=10&module=ADD_DEVICE_TYPE&version=0.3&s_key=XYZ&uid=1&lang=english';
AjaxRequest.get(
{
'url':strUrl
,'onSuccess':function(req)
{
//alert(req.responseText);
var str_xml = req.responseText;
alert(str_xml);
// Note above alert show correct XML .
}
}
);
text="<note>";
text=text+"<to>Tove</to>";
text=text+"<from>Jani</from>";
text=text+"<heading>Reminder</heading>";
text=text+"<body>Don't forget me this weekend!</body>";
text=text+"</note>";
try //Internet Explorer
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
// xmlDoc.loadXML(text);
xmlDoc.loadXML(str_xml);
}
catch(e)
{
try // Firefox, Mozilla, Opera, etc.
{
parser=new DOMParser();
// xmlDoc=parser.parseFromString(text,"text/xml");
xmlDoc=parser.parseFromString(str_xml,"text/xml");
}
catch(e)
{
alert(e.message);
return;
}
}
/*
var to=xmlDoc.getElementsByTagName("to")[0].childNodes[0].nodeValue;
var from=xmlDoc.getElementsByTagName("from")[0].childNodes[0].nodeValue;
var message=xmlDoc.getElementsByTagName("body")[0].childNodes[0].nodeValue;
alert(to);
alert(from);
alert(message);
*/
var to=xmlDoc.getElementsByTagName("result")[0].childNodes[0].nodeValue;
alert(to);
}



function ChkFrm_data()
{
frm=document.add_new_dev_type;
if(frm.device_type_name.value=="")
{
CustomAlert('<?php echo NECESSARY_FIELD_REQUIRED?>');
frm.txt_device_type_name.focus();
return false;
}
if(frm.reporting_interval.value=="")
{
CustomAlert('<?php echo NECESSARY_FIELD_REQUIRED?>');
frm.txt_reporting_interval.focus();
return false;
}
}
function CheckInteger(input_object)
{
if(!isNumeric(input_object.value))
{
CustomAlert('<?php echo NUMERIC_FIELD_REQUIRED?>');
input_object.value = "";
//next two lines are there for compatibility with FireFox
myField = input_object;
setTimeout("this.myField.focus();",0);
//input_object.focus();
return false;
}
}
function CustomAlert(message, message_header, message_type)
{
alert(message);
}
</script>
<!------- /Validation for client side java script function ---------->
</head>
<body class="body_inner">
<form action="add_new_dev_type.php" name="add_new_dev_type" method="POST" onSubmit="return ChkFrm_data();">
<table id="form_container">
<tr id="form_header">
<td colspan="2"><?php echo HEADING?></td>
</tr>
<tr id="form_message">
<?if(!empty($message)){?>
<td colspan="2"><?php echo $message;?></td>
<?}?>
</tr>
<tr id="field_row">
<td><?php echo DEVICE_TYPE_NAME?></td>
<td><input type='text' name='device_type_name' id='device_type_name' value='<?php echo $device_type_name ?>' /></td>
</tr>
<tr id="field_row">
<td><?php echo REPORTING_INTERVAL?></td>
<td><input type='text' id="reporting_interval" name='reporting_interval' value='<?php echo $reporting_interval ?>' onChange="return CheckInteger(document.getElementById('txt_reporting_interval'))" /></td>
</tr>
<tr>
<td colspan="2">
<input type="hidden" name="module" id="module" value="ADD_DEVICE_TYPE">
<input type="hidden" name="version" id="version" value="0.3">
<input type="hidden" name="s_key" id="s_key" value="<?php echo $CURRENT_HASH?>">
<input type="hidden" name="uid" id="uid" value="<?php echo $USER_ID?>">
<input type="hidden" name="lang" id="lang" value="english">
<input type="button" onClick="parseXML()" name='Save' value='Save' />
</td>
</tr>
</table>
</form>
</body>
</html>


Note : if i pass XML "text" which is also write at this page this program work properly ... i am using this program from w3school

Please help me i am really bothered ... Thanks in advanced

Regard's
Kaushik
AnswerRe: Function return XML object.... unable to parse it to javascript Pin
Mohammad Dayyan3-Aug-08 10:46
Mohammad Dayyan3-Aug-08 10:46 
QuestionCan someone help me spot check this form code? Pin
bschm7825-Jun-08 19:27
bschm7825-Jun-08 19:27 
AnswerRe: Can someone help me spot check this form code? Pin
help as an alias25-Jun-08 20:14
help as an alias25-Jun-08 20:14 
GeneralRe: Can someone help me spot check this form code? Pin
bschm7826-Jun-08 3:11
bschm7826-Jun-08 3:11 
GeneralRe: Can someone help me spot check this form code? Pin
alex.barylski1-Jul-08 10:26
alex.barylski1-Jul-08 10:26 
GeneralRe: Can someone help me spot check this form code? Pin
bschm783-Jul-08 6:21
bschm783-Jul-08 6:21 
Questionp0wned Pin
Christian Graus16-Jun-08 15:02
protectorChristian Graus16-Jun-08 15:02 
AnswerRe: p0wned Pin
Scott Dorman16-Jun-08 17:21
professionalScott Dorman16-Jun-08 17:21 
JokeRe: p0wned Pin
Leslie Sanford16-Jun-08 20:42
Leslie Sanford16-Jun-08 20:42 
QuestionFirst post !!! Pin
Christian Graus16-Jun-08 15:01
protectorChristian Graus16-Jun-08 15:01 
AnswerRe: First post !!! Pin
Scott Dorman16-Jun-08 17:20
professionalScott Dorman16-Jun-08 17:20 
AnswerRe: First post !!! Pin
Harvey Saayman17-Jun-08 1:19
Harvey Saayman17-Jun-08 1:19 
GeneralRe: First post !!! Pin
Paul Coldrey7-Oct-08 15:16
professionalPaul Coldrey7-Oct-08 15:16 
QuestionSQL Injection Prevention - How Good Are These Measures? Pin
nalorin11-Jun-08 7:55
nalorin11-Jun-08 7:55 
AnswerRe: SQL Injection Prevention - How Good Are These Measures? Pin
Bradml11-Jun-08 21:36
Bradml11-Jun-08 21:36 
GeneralRe: SQL Injection Prevention - How Good Are These Measures? Pin
Mohammad Dayyan11-Jun-08 22:57
Mohammad Dayyan11-Jun-08 22:57 
GeneralRe: SQL Injection Prevention - How Good Are These Measures? Pin
Chris Maunder12-Jun-08 0:20
cofounderChris Maunder12-Jun-08 0:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.