HTML - Reading A Csv File?
Hey all,
My second question from the 'could be done another, easier way, but I want to do it like this' pile (I am really trying to avoid PHP..) At the moment I have created a basic website (just for funsies, and a little bit of learning) using CSS and such - nothing too complicated. I had a bit of a look around and found a basic script that would allow me to username / password protect the site, though I noticed that the username / password was stored in the HTML itself, so it sort of makes it useless. This got me thinking about more secure ways to do it, and I thought that if I could store the username / password combinations in a CSV file, and then check through that list on submit, that would be ok? So, firstly, is it possible to do it like this? Secondly, how would I go about doing it? I am probably in way over my head, but I will never know if I never try! Thanks in advance. ~J Similar TutorialsHow can I use HTML to read text from a text file and put it into a cell in a table? I want to have one main site that can have different content loaded into it. would I be better off using frames? Sorry if this is confusing. I'm trying to make a small page that reads a CSV file (exported from excel) that gives me a list of my DVDs with an img that is a link to the file to start the movie. It actually works fine (needs some formatting tweaking), but as it is below, it lists the movies vertically (up & down). Anyone know how I can make it list them horizontally? For whatever reason I prefer it that way. Any help would be appreciated. I'm testing using IE btw. movies-test.html ===== <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title> Graphical list </title> </head> <body bgcolor=#C0C0C0> <object ID=data classid="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83"> <param nAme="DataURL" value="movies-test.csv"> <param nAme="UseHeader" value="true"> </object> <table CELLSPACING=25 datasrc='#data'> <tr> <td><center> <a href= <span datafld='location'> </span><img width=290 height=400 src=<span datafld='picture'></span> </a><br> <span datafld='name'> </span> <span datafld='time'></span> </center></td> </tr> </table> </body> </html> movies-test.csv ===== name,time,picture,location 8mm,123,C:/DVDs/images/8mm_cs.jpg,D:/8mm/video_ts/video_ts.ifo 12 Monkeys,131,C:/DVDs/images/12_monkeys_cs.jpg,E:/12_monkeys/video_ts/video_ts.ifo Thirteen Ghosts,91,C:/DVDs/images/13_ghosts_CS.jpg,E:/thirteen_ghosts/video_ts/video_ts.ifo 13th Warrior,102,C:/DVDs/images/13th_warrior_cs.jpg,D:/13th_warrior/video_ts/video_ts.ifo 16 Blocks,105,C:/DVDs/images/16_blocks_cs.jpg,H:/16_blocks/video_ts/video_ts.ifo I am getting better at handling the validation errors, what I would like to know now is what's the easiest way to locate the line specified in the error, for example if it says line 122 column 12? How do you guys get to line 122, do you count line by line like me or is there an easier way? Also I am assuming that the white spaces between all lines are not counted in the validation? Alteast, I think it's a HTML website i'm reading from: http://nw4.novaworld.net/bhd_3_list.lob?page=2 I'm quite lost here, I tried several things, done some searching here and there, and just cant figure it out. I'm not sure if what I want is possible with HTML, if it isnt, please move this post to the appropriate section, thanks. What I want to do is make somesort of a 'Serverstatus block', with some help from the website I posted above. I sometimes host a server in that game, and then it shows up on that website with Game Name, Gametype and Players. Now I want to format that info into a nice statusblock... Though it's not just me hosting a server, there's more people hosting for the same name. I only want that statusblock to get the info only if there's a server with Game Name that contains 'P4F', else it should say 'Server Offline'. I want the info formatted like: Server Name: (namehere) Gametype: (gametypehere) Players: (playershere) I just cant figure this out... I do have some basic HTML knowledge, I know how to format text like that, but I dont know how to read from that website... Could anyone give me an example, tip or website that holds the easiest way to do this ? Thanks in advance, VipleX Hey guys. Mandarin was able to help me BIG time on this yesterday and get me going but I've hit a bump in the road. I have the scripting written out to the best of my knowledge. I've checked it 3 times with my amateur eyes and can't find anything that I'm missing. Will you please take a look at the scripting here and see what I'm missing?? The form shows up great on the Source side but when I hit submit it goes to a BLANK destination page. I had it working yesterday where the results showed up just fine on the destination page in a much simpler format! Thanks for taking a look. Source page HTML Code: <!DOCTYPE html> <html> <head> <title>Source page</title> <script> window.onload = function() { document.getElementById("input").onsubmit = function() { localStorage.setItem("tfirstname", this.elements["tfirstname"].value); localStorage.setItem("tlastname", this.elements["tlastname"].value); localStorage.setItem("email", this.elements["email"].value); localStorage.setItem("tphone", this.elements["tphone"].value); localStorage.setItem("ffirstname", this.elements["ffirstname"].value); localStorage.setItem("flastname", this.elements["flastname"].value); localStorage.setItem("fphone", this.elements["fphone"].value); localStorage.setItem("rent", this.elements["rent"].value); localStorage.setItem("employer", this.elements["employer"].value); localStorage.setItem("ephone", this.elements["ephone"].value); localStorage.setItem("gross1", this.elements["gross1"].value); localStorage.setItem("length", this.elements["length"].value); localStorage.setItem("gross2", this.elements["gross2"].value); localStorage.setItem("lfirstname", this.elements["lfirstname"].value); localStorage.setItem("llastname", this.elements["llastname"].value); localStorage.setItem("lphone", this.elements["lphone"].value); localStorage.setItem("clength", this.elements["clength"].value); localStorage.setItem("evicted", this.elements["evicted"].value); localStorage.setItem("checking", this.elements["checking"].value); localStorage.setItem("savings", this.elements["savings"].value); localStorage.setItem("bank", this.elements["bank"].value); localStorage.setItem("bankruptcy", this.elements["bankruptcy"].value); } } </script> </head> <body> <form id="input" action="http://www.truquill.com/contact-us.html" method="post"> <B>General Information</B> <br /><br /> First name: <input name="tfirstname" title="First name" /><br /> Last name: <input name="tlastname" title="Last name"/><br /> Email:   <input name="email" title="Email address" /><br /> Phone: <input id="tphone" name="tphone" title="Primary phone number" type="text" size="3" value="" > <input id="tphone" name="tphone" title="Primary phone number" type="text" size="3" value="" > <input id="lastDigits" name="lastDigits" title="Primary phone number" type="text" size="4" value="" ><br /> <br /><br /> <B> Future Residence </B> <br /><br /> First name: <input name="ffirstname" title="Future residence first name" /><br /> Last name: <input name="flastname" title="Future residence last name"/><br /> Phone:  <input id="fphone" name="fphone" title="Future residence phone number" type="text" size="3" value="" > <input id="fphone" name="fphone" title="Future residence phone number" type="text" size="3" value="" > <input id="lastDigits" name="lastDigits" title="Future residence phone number" type="text" size="4" value="" ><br /><br /> Rent amount: $ <input name="rent" size=4 title="Future residence rent amount" /><br /> <br /><br /> <B> Employment History </B> <br /><br /> Employer: <input name="employer" title="Name of Employer" /><br /> Phone: <input id="ephone" name="ephone" title="Employer phone number" type="text" size="3" value="" > <input id="tphone" name="ephone" title="Employer phone number" type="text" size="3" value="" > <input id="lastDigits" name="lastDigits" title="Employer phone number" type="text" size="4" value="" ><br /><br /> Gross monthly wage: $<input name="gross1" size=4 title="Monthly wages from employer before tax" /><br /><br /> Length at current employer:<br /><br /> <input type="checkbox" name="length" value="<1" /> Less than 1 year<br /> <input type="checkbox" name="length" value="1-2" /> 1-2 years<br /> <input type="checkbox" name="length" value="2+" /> More than 2 years<br /> <br /> Additional household income: $ <input name="gross2" size=4 title="Gross household income in addition to wages from listed employer" /><br /> <B> Rental History </B> <br /><br /> Current Landlord Information <br /><br /> First name: <input name="lfirstname" title="Landlord first name" /><br /> Last name: <input name="llastname" title="Landlord last name"/><br /> Phone:  <input id="lphone" name="lphone" title="Landlord phone number" type="text" size="3" value="" > <input id="tphone" name="tphone" title="Landlord phone number" type="text" size="3" value="" > <input id="lastDigits" name="lastDigits" title="Landlord phone number" type="text" size="4" value="" ><br /><br /> Length at current residence:<br /><br /> <input type="checkbox" name="clength" value="<1" /> Less than 1 year<br /> <input type="checkbox" name="clength" value="1-2" /> 1-2 years<br /> <input type="checkbox" name="clength" value="2+" /> More than 2 years<br /> <br /> Have you ever been evicted?<br /><br /> <input type="checkbox" name="evicted" value="<1" /> Yes<br /> <input type="checkbox" name="evicted" value="1-2" /> No<br /> <br /> <br /> <B> Account Balances </B> <br /><br /> Household checking: <input name="checking" title="Household checking account balance" /><br /> Household savings: <input name="savings" title="Household savings account balance" /><br /> Primary bank:       <input name="bank" title="Primary banking institution" /><br /> <br />Have you ever declared bankruptcy?<br /><br /> <input type="checkbox" name="bankruptcy" value="yes" /> Yes<br /> <input type="checkbox" name="bankruptcy" value="no" /> No<br /> <br /><br /> <input type="submit" value="View my options!" title=Submit><br /><br /><br /> </form> </body> </html> Destination page HTML Code: <!DOCTYPE html> <html> <head> <title>Destination page</title> <script> window.onload = function() { document.getElementById("message").innerHTML = "Welcome back, " + localStorage.getItem("tfirstname") + " " + localStorage.getItem("tlastname") +" " + localStorage.getItem("email") + " " + localStorage.getItem("tphone") +" " + localStorage.getItem("ffirstname") + " " + localStorage.getItem("flastname") +" " + localStorage.getItem("fphone") + " " + localStorage.getItem("rent") +" " + localStorage.getItem("employer") + " " + localStorage.getItem("ephone") + " + localStorage.getItem("gross1") + " " + localStorage.getItem("length") +" " + localStorage.getItem("gross2") + " " + localStorage.getItem("lfirstname") +" " + localStorage.getItem("llastname") + " " + localStorage.getItem("lphone") +" " + localStorage.getItem("clength") + " " + localStorage.getItem("evicted") +" " + localStorage.getItem("checking") + " " + localStorage.getItem("savings") +" " + localStorage.getItem("bank") + " " + localStorage.getItem("bankruptcy"); } </script> </head> <body> <p id="message"></p> </body> </html> Hi all, I can not seem to figure out why a form on my fathers website is having trouble being read by Internet Explorer. The text directing what should be written (ie. Name, Telephone, Email Address, etc...) is being cut in half. I have no idea why it is doing this I have tried playing around with the cell padding to no avail. I appreciate you help Thanks, Josh Korn The following common code is not working in Firefox (3.0.11). It works in Safari (4.02) and IE7. When I say not working, I mean that when I click the submit button, the address does not change to the form processing url: Code: <!-- The data encoding type, enctype, MUST be specified as below --> <form enctype="multipart/form-data" action="uploader.php" method="POST"> <!-- MAX_FILE_SIZE must precede the file input field --> <input type="hidden" name="MAX_FILE_SIZE" value="30000" /> <!-- Name of input element determines name in $_FILES array --> Send this file: <input name="mp3file" type="file" /> <input type="submit" name="submit" value="Send File" /> </form> The file uploader.php does nothing, it is blank, I'm merely trying to establish communication. Once again, the code functions in IE and Safari so I dont think this is PHP related. I have a project written in ASP.NET under Visual Studio 2005 with C#. I am also using Infragistics objects for .NET Advantage 2007. In my page to attach resources to a record I have written a browser and am displaying previously chosen resources here. But when I click the upload button the page opens a new window (which is not a dialog window, but a normal one) which is exactly the same as my dialog window. How can this possibly happen? Can anyone help me? Hi ,I am new in html.Hope you can guide me step-by-step on this. I want to import my .txt file into the html form and the html form can add new item then to be add in to that particular .txt file too as well. can this be done? For example: (fruits.txt) 1.apple 2.banana 3.orange Can this fruit.txt be impoted to fruit.html page and show it at fruit.html page, at the same time, the fruit html page allow to add in new fruit, and once user add in new fruit, the fruit.txt file will be updated as well. Thanks for your guidiance and help. :-) Hi, Anybody have any idea how to convert a xml file to excel file.Actually i m working on visual studio and using C programming language.I have a xml file in the same directory where my programm is running.When i pressed a icon it will take the xml file automatically and convert to a excel file and show the outpt to the user.How can i achive this goal ??? Any help would be great. Thanks, Basanta I have a website where I want to make a drop down menu that will bring you to different pages. It is a very basic, sort of old-fashioned website that relies entirely on html. What I'm trying to do is make a drop-down menu that will be used as navigation for a section of a website and I want to have it in each internally linked page in that section, but I'm going to be adding more pages to it over time so I want to be able to put the drop-down menu code in a separate text file and then substitute it into the pages that I make that the options in the menu link to and then just edit the code in the text file when I add another page so that I don't have to go back and edit the code every single individual page whenever I add a new one among them. Basically all I'm asking is how I can put html code in a text file and then substitute that code into an html page by referring to the file. Thanks in advance for any help. hi everybody, I am working in a html. I defined a functiion in a html file.(first.html) I want to call that function in another html file.(second.html) How can i call that function in second.html file? give some sample code Thanks in advance.... Hi guys I want to add some php files into my frontpage html files, please let me know how to do this. I tried many things but fail. Please guide me. Thank you GCS Hi, I'm trying to include one HTML file in another. I tried iframe and was displeased with the results, I want the size of the frame to change dynamically and not just scroll. Fair warning, my knowledge of JavaScript is non-existent >_> . Basically, I have a document written in HTML (please don't suggest a wholesale re-write, that's simply not practical) and the idea is to have one file where it makes sense to include it several times. One thing to mention, this document is not meant to be shown on a web-server, but in a browser while you're reading it off your hard-drive. Here's what I have so far. main.shtml Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>test</title> </head> <body> <center> <h1> This is only a test! </h1> </center> <p> Still testing!!!!! </p> <!-- #include file="included.html" --> <p> Even more testing!!!!! </p> </body> </html> included.html Code: <!--<html> <head> <title> asdfasdfasdfasd </title> </head> <body>--> <p> <h4> foobar </h4> <br> <br> <br> <br> <h4> boofar </h4> </p> <!--</body> </html>--> Not sure what I'm doing wrong, help appreciated! Hi All I need some help with the following html coding: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- MagicComment: MVTimeout --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Untangle Login</title> <script type="text/javascript">if (top.location!=location) top.location.href=document.location.href;</script> <style type="text/css"> /* <![CDATA[ */ @import url(/images/base.css); /* ]]> */ </style> </head> <body> <div id="main" style="width: 500px; margin: 50px auto 0 auto;"> <div class="main-top-left"></div><div class="main-top-right"></div><div class="main-mid-left"><div class="main-mid-right"><div class="main-mid"> <!-- Content Start --> <center> <img alt="" src="/images/BrandingLogo.gif" /><br /> <b></b><br/> Untangle Login <div style="margin: 0 auto; width: 250px; padding: 40px 0 5px;"> <form method="post" action= "/auth/login?url=/setup/welcome.do&realm=Administrator" > <table><tbody> <tr><td style="text-align:right">Server:</td><td><em> localhost</em></td></tr> <tr><td style="text-align:right">Username:</td><td><input id="username" type="text" name="username" value="admin"/></td></tr> <tr><td style="text-align:right">Password:</td><td><input id="password" type="password" name="password" /></td></tr> </tbody></table> <br /> <div style="text-align: center;"><button value="login" type="submit">Login</button></div> </form> <script type="text/javascript">document.getElementById('password').focus();</script> </div> </center> <!-- Content End --> </div></div></div><div class="main-bot-left"></div><div class="main-bot-right"></div> <!-- Box End --> </div> </body> </html> What I need to know is how can I change the title. I cant seem to find the file contaning the html coding that i posted above. the way i found this coding was 'right clicked the web page and clicked on view source' The code that I marked in red seems to be the "file"(welcome.do) that contains this code, but i cant seem to find the file. Please, any help will be appreciated Best regards I'm having some trouble that I've never encountered before... I'm trying to get a ".jpg" file that's being loaded from a FTP server to load up on a ".php" file. It all works when I do it locally, but when I try to open it up on the server itself, all the images (".gif"'s) open up perfectly yet the ".jpg" doesn't. Any suggestions? Thanks! hi everyone! how can i upload a pdf file via html? i guess "a href" is not the right way. please help me. thank you Now I'm very very new to this, so pleaseee dont flame. Now my friend got a .flv file, by using the firefox addon to extract video files from like youtube or sumthing. Now I want to make it so that when people visit my website, they will be able to see our videos. Now is all we need the .flv file? bcuz I think we might need something thats called a .swf file, and I dont know how to get it, and where to put it. please help Hi, I want visitors to be able to download files (.mp3) from my web site . I've looked through some of the posts on this and some seem to say just use something like: <a href="http://yourdownloadfile.mp3">Download This</a> others mention php. What is the best to use? Do I need php? Thanks I cant open my php file...ive downloaded wampserver to support the file but it still doesnt open...wat could b the problem here??? |