Jump to content

Server Side Include


xcandiottix

Recommended Posts

I have a tough problem here. Currently, I have a page that runs a little ajax. It calls out to an XML file and returns a text string. I need to replace the test string with the location of a .php file. When the page loads, I need the .php file to be loaded in place of the text string.

 

function selection(selected){
var y=xmlDoc.getElementsByTagName("Name");
for (j=0;j<y.length;j++){
	if(selected == y[j].getAttribute("N")){
		//sets titles
		title1=y[j].getElementsByTagName("Cell")[0].getElementsByTagName("title")[0].childNodes[0].nodeValue;
		document.getElementById("tit1").innerHTML=title1;
		title2=y[j].getElementsByTagName("Cell")[1].getElementsByTagName("title")[0].childNodes[0].nodeValue;
		document.getElementById("tit2").innerHTML=title2;
		title3=y[j].getElementsByTagName("Cell")[2].getElementsByTagName("title")[0].childNodes[0].nodeValue;
		document.getElementById("tit3").innerHTML=title3;
		//sets applications
		application1=y[j].getElementsByTagName("Cell")[0].getElementsByTagName("Application")[0].childNodes[0].nodeValue;
		document.getElementById("app1").innerHTML=application1;
		application2=y[j].getElementsByTagName("Cell")[1].getElementsByTagName("Application")[0].childNodes[0].nodeValue;
		document.getElementById("app2").innerHTML=application2;
		application3=y[j].getElementsByTagName("Cell")[2].getElementsByTagName("Application")[0].childNodes[0].nodeValue;
		document.getElementById("app3").innerHTML=application3;
	}
}
//end
}

 

Above, I am checking the XML page to get the title and application text strings. They are printed out on the screen like so:

 

Title 1    Title 2    Title3

App 1    App 2    App 3

 

What I need to happen is:

 

Title 1                                                                Title 2

the actual app1.php file to be loaded here      etc..

 

How can I do this?  :confused:

Link to comment
https://forums.phpfreaks.com/topic/208341-server-side-include/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.