uploading news everyday with my page 2 |
uploading news everyday with my page 2 |
deep |
Sep 11 2008, 05:15 AM
Post
#1
|
Advanced Member Group: Members Posts: 112 Joined: 19-August 08 Member No.: 6,455 |
Hi, guys
you helped me in the 1 st one. But i got a small problem. i want to create it in xml. means the content of news should be in a xml file. can anybody tellme how to create that file and import it into my page. Thanks, Deep This post has been edited by deep: Sep 11 2008, 05:59 AM |
Frederiek |
Sep 11 2008, 06:59 AM
Post
#2
|
Programming Fanatic Group: Members Posts: 5,146 Joined: 23-August 06 From: Europe Member No.: 9 |
One way to do that is by calling the XML file with PHP or a XMLHttpRequest.
Do you know how to write an XML file? Go see Where can I learn about XML (XSL). |
deep |
Sep 11 2008, 07:47 AM
Post
#3
|
Advanced Member Group: Members Posts: 112 Joined: 19-August 08 Member No.: 6,455 |
Frederiek,
Iam using .html pages is it possible to use php to import xml. And i think in xml we can write in tags format like <news> Content </news>. I have small doubt. if we remove the <news> tag will the content imports into the page. |
Frederiek |
Sep 12 2008, 02:24 AM
Post
#4
|
Programming Fanatic Group: Members Posts: 5,146 Joined: 23-August 06 From: Europe Member No.: 9 |
I'm only just learning PHP in my spare time myself, that's why I gave you a Google search link. You can use PHP's include() function to import files, but I think you rather need to retrieve the data (meaning read the tag's values) from the XML file and output that.
I found a thread in a DynamicDrive forum about Read and write XML with PHP, where the "read" part would be of interest here. I haven't tried it, though. Someone else with more experience in PHP might be able to help you with that. I think your XML should contain some more tags than just <news>. <news> could be the wrapper, inside which you could add a date, a headline and a description. The link also shows an exemple of an (employee) XML file. |
deep |
Sep 12 2008, 05:33 AM
Post
#5
|
Advanced Member Group: Members Posts: 112 Joined: 19-August 08 Member No.: 6,455 |
I got an idea. i tried dreamweaver to do this. Here is the code to get that.
CODE <script src="SpryAssets/xpath.js" type="text/javascript"></script> <script src="SpryAssets/SpryData.js" type="text/javascript"></script> <script type="text/javascript"> <!-- var ds1 = new Spry.Data.XMLDataSet("Untitled-2.xml", "news"); //--> </script> </head> <body> <div spry:region="ds1"> <table> <tr> <th>News</th> </tr> <tr spry:repeat="ds1"> <td>{news}</td> </tr> </table> Anyway Thanks for your help. |
Frederiek |
Sep 12 2008, 06:59 AM
Post
#6
|
Programming Fanatic Group: Members Posts: 5,146 Joined: 23-August 06 From: Europe Member No.: 9 |
XMLHttpRequest it is then. Jees, quite a lot of code for such a rather simple thing... (I mean the scripts, not your HTML ).
|
nega |
Sep 23 2008, 08:30 AM
Post
#7
|
Group: Members Posts: 2 Joined: 23-September 08 Member No.: 6,725 |
tell me how to update the daily news in my webpage? how we can include text editer in webpage ? so that my clients can change or edit text. like updating event or posting news or new info in my webpage. i want to start a simple community site.
|
nega |
Sep 23 2008, 08:44 AM
Post
#8
|
Group: Members Posts: 2 Joined: 23-September 08 Member No.: 6,725 |
I got an idea. i tried dreamweaver to do this. Here is the code to get that. CODE <script src="SpryAssets/xpath.js" type="text/javascript"></script> <script src="SpryAssets/SpryData.js" type="text/javascript"></script> <script type="text/javascript"> <!-- var ds1 = new Spry.Data.XMLDataSet("Untitled-2.xml", "news"); //--> </script> </head> <body> <div spry:region="ds1"> <table> <tr> <th>News</th> </tr> <tr spry:repeat="ds1"> <td>{news}</td> </tr> </table> Anyway Thanks for your help. Tell me how to use the code you posted ? can you tell me about creating forum and how to make it working in server host ? |
deep |
Sep 23 2008, 09:34 AM
Post
#9
|
Advanced Member Group: Members Posts: 112 Joined: 19-August 08 Member No.: 6,455 |
Tell me how to use the code you posted ? can you tell me about creating forum and how to make it working in server host ?
nega. you need to have the following files in your site folder. SpryAssets/xpath.js SpryAssets/SpryData.js then copy and paste the code in your page. news is the tag in the xml. remove the <th>news</th> it's just a title. And Can't understand and you tell me about creating forum and how to make it working in server host ? Deep, This post has been edited by deep: Sep 23 2008, 09:35 AM |
Darin McGrew |
Sep 23 2008, 12:21 PM
Post
#10
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
tell me how to update the daily news in my webpage? how we can include text editer in webpage ? so that my clients can change or edit text. like updating event or posting news or new info in my webpage. i want to start a simple community site. Perhaps one of these CGI news-posting programs or these PHP news-posting programs will meet your needs. |
deep |
Sep 24 2008, 12:06 AM
Post
#11
|
Advanced Member Group: Members Posts: 112 Joined: 19-August 08 Member No.: 6,455 |
Yeah, they will be helpful for u nega.
Cheers, Deep |
Lo-Fi Version | Time is now: 28th March 2024 - 05:42 PM |