/    Sign up×
Community /Pin to ProfileBookmark

Hi,

I am currently developing a website and previously I have converted a table in Excel into a html file and uploaded it.

However I would like to somehow create a html file that calls the data from the spreadsheet so that the person maintaining the spreadsheet doesnt have to send me it first he can just upload it and the website will update.

How do I do this, I have read through the forum but when you are new to it you think you understand then something confuses you.

Shaun

to post a comment
PHP

15 Comments(s)

Copy linkTweet thisAlerts:
@CharlesAug 15.2006 — Getting it up there is easy, just give this person the usernam and password. But how are you converting Excel to HTML?
Copy linkTweet thisAlerts:
@ShaunJUKauthorAug 15.2006 — I think you have got me wrong, I would like him to upload some sort of database file, wither xls or xml so that the website just calls the information from out of it, that way he cant mess up any of the design of the site.
Copy linkTweet thisAlerts:
@ShaunJUKauthorAug 15.2006 — I can save the xls file as an xml spreadsheet or csv file, which is best?
Copy linkTweet thisAlerts:
@CharlesAug 15.2006 — [W]hich is best?[/QUOTE]The one that your server side script uses to generate the HTML. It really doesn't matter which one.

You can write a FORM handler and give this user a password but it's easier to just ftp the file up to the server.
Copy linkTweet thisAlerts:
@ShaunJUKauthorAug 15.2006 — I dont have a server side script, thats what I am looking for
Copy linkTweet thisAlerts:
@KorAug 15.2006 — XML , a loading object and javascript (DOM)

Here's a very basic example;

the XML file (called myxml.xml in my example):
<i>
</i>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;dataroot&gt;
&lt;cellcontent&gt;one&lt;/cellcontent&gt;
&lt;cellcontent&gt;two&lt;/cellcontent&gt;
&lt;cellcontent&gt;three&lt;/cellcontent&gt;
&lt;/dataroot&gt;

the HTML file:
<i>
</i>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;meta http-equiv="Content-Style-Type" content="text/css"&gt;
&lt;meta http-equiv="Content-Script-Type" content="text/javascript"&gt;
&lt;script type="text/javascript"&gt;
function getXML(){
if(window.ActiveXObject){//IE
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.load("myxml.xml");
processXML(xmlDoc);
}
else{//Moz and DOM compliant
var xmlDoc = document.implementation.createDocument("", "doc", null);
xmlDoc.onload=function(){processXML(xmlDoc)}
xmlDoc.load("myxml.xml");
}
}
function processXML(xmlDoc){
var cel=document.getElementById('mytab').getElementsByTagName('td');//the table's cells collecytion
var dat=xmlDoc.getElementsByTagName('cellcontent');//the collection of some tags
for(var i=0;i&lt;dat.length;i++){
cel[i].firstChild.data=dat[i].firstChild.data
}
}
onload=getXML
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;table id="mytab" width="300" border="1" cellspacing="0" cellpadding="0"&gt;
&lt;tr&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;
Copy linkTweet thisAlerts:
@CharlesAug 15.2006 — Don't use Kor's example, you'll only have a page that fails for all of us who do not use JavaScript.

You're going to need to find out what server side scripting your host supports. From there you might just want to hire a programmer. But there are forums here for several of those scripting languages and perhaps we can lead you through it.
Copy linkTweet thisAlerts:
@KorAug 15.2006 — Don't use Kor's example, you'll only have a page that fails for all of us who do not use JavaScript.

You're going to need to find out what server side scripting your host supports. From there you might just want to hire a programmer. But there are forums here for several of those scripting languages and perhaps we can lead you through it.[/QUOTE]

Than you should enable javascript. [B]ShaunJUK[/B] is free to use whichever he suits to him. And you are free to disable, (of no use at all, of course) your javascript. And I am free to use javascript in my pages so that you are free not to see them. It is a free world.
Copy linkTweet thisAlerts:
@KorAug 15.2006 — Well, I first thought that ShaunJUK, for a reason or another, can not use a server solution. Now if your host alows you to use a server-side aplication, let us know which that migh be (php, asp...) and I will move this thread in the correspondent Forum (PHP, ASP...). I reckon that, if possible, a server solution is far better for the kind of job you need.

Even better would be if you could build a DB table, and an dedicated friendly designed Admin page where, with a user/password entrance, your client might modify the data online. In this case you do not need XML, it is enough just to use a combination DB/server-side language, for instance mySQL / php.

Now... Which server language does suit for you?
Copy linkTweet thisAlerts:
@danaddAug 15.2006 — I gotta chime in on the javascript argument - look at the big name websites that are using javascript today: myspace, gmail, yahoo and many others. If it were such a problem to use javascript, they wouldn't be using it. I think the rant against javascript is a little outdated. The script above the Kor supplied is perfect - short, easy to understand, and it works. Don't be afraid to use it.

However, in case you need help choosing a server side language, PHP is great for beginners. It's open source and you can often find a script online for free that can fit your needs. It's a good one to start with.
Copy linkTweet thisAlerts:
@ShaunJUKauthorAug 15.2006 — Well, I first thought that ShaunJUK, for a reason or another, can not use a server solution. Now if your host alows you to use a server-side aplication, let us know which that migh be (php, asp...) and I will move this thread in the correspondent Forum (PHP, ASP...). I reckon that, if possible, a server solution is far better for the kind of job you need.

Even better would be if you could build a DB table, and an dedicated friendly designed Admin page where, with a user/password entrance, your client might modify the data online. In this case you do not need XML, it is enough just to use a combination DB/server-side language, for instance mySQL / php.

Now... Which server language does suit for you?[/QUOTE]


Thats all possible, I used to use php a lot, I am just a little out of practice. a php/mysql solution would be great
Copy linkTweet thisAlerts:
@CharlesAug 15.2006 — With PHP you'll find the CSV solution a bit less heavy.
Copy linkTweet thisAlerts:
@KorAug 15.2006 — ok, I'll move the thread to the php Forum. php coders, please, give ShaunJUK an answer.
Copy linkTweet thisAlerts:
@ShaunJUKauthorAug 16.2006 — Yes please, anyone have a php/csv solution
Copy linkTweet thisAlerts:
@ShaunJUKauthorAug 16.2006 — Ok heres what I want, currently the spreadsheet is saved as a html file and uploaded onto the server, I would like a form the person could access so he can save the spreadsheet can be saved as a csv file and uploaded to the server into a database, then a php script recreates the table using the data in the database.
×

Success!

Help @ShaunJUK spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...