The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> uploading news everyday with my page 2
deep
post 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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post 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).
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
deep
post 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.

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post 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.

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
deep
post 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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post 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 biggrin.gif ).
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
nega
post 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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
nega
post Sep 23 2008, 08:44 AM
Post #8





Group: Members
Posts: 2
Joined: 23-September 08
Member No.: 6,725



QUOTE(deep @ Sep 12 2008, 04:03 PM) *

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 ?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
deep
post 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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post 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



QUOTE(nega @ Sep 23 2008, 06:30 AM) *
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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
deep
post 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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 28th March 2024 - 05:42 PM