| |||||||
| Welcome to the SSC Forums! You are currently viewing our boards as a guest which gives you limited access. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and more. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
![]() |
| | Thread Tools |
| | #16 |
| Senior Member Join Date: Mar 2006 Location: Ontario, Canada (GTA)
Posts: 288
UserID: 569 | Thanks Silence! I meant: have the xml display its contents using javascript or whatever to say what is in the xml document. I could steal scripts, since I have absolutely no knowledge of Javascript. Then I wouldn't learn anything.
__________________ ~CROC~(c 'rock)n. -The master of ideas, and the occasional mod (Works with mr. dude) Mods: 3xA combat - CPS Turbine - Super Flash Flood - (working on CPH) |
| | |
| | #17 |
| Founder Join Date: Mar 2003 Location: Maryland
Posts: 5,985
UserID: 1 | Could you explain what you're trying to do? Then we might be able to offer some other solutions. I don't imagine that it would be impossible or even hard to make Javascript display the contents of a file, but I wouldn't recommend it because a lot of things and people disable Javascript. If you're trying to use XML documents as some sort of database, don't. Just use MySQL or PostgreSQL. I know a good amount about MySQL and can set you up if you want. You'll have to learn PHP too, but neither is hard.
__________________ email: ben at sscentral dot org / Forum rules Read this page before emailing me. Do not send me a PM or email with a water gun question if someone else could answer the question. Post at the forums. You will get a response from me along with others' views or ideas. Do not send me a PM or email about reading a certain post unless it's been a few days since you've posted. I try to read every post. |
| | |
| | #18 |
| Administrator Join Date: Apr 2006 Location: Virginia
Posts: 3,251
UserID: 576 | Hmm...so you want to view the source XML of a page? To do that, in Firefox you use [View > Page Source] or [Right Click > View Page Source]. Or perhaps I'm not sure what you're looking for...maybe Ben would know. Sorry.
__________________ Forum Rules |
| | |
| | #19 |
| Senior Member Join Date: Mar 2006 Location: Ontario, Canada (GTA)
Posts: 288
UserID: 569 | Ok, I decided not to do any xml scripting after all. I might go with some SQL, and will try to learn that and PHP at about the same time (what I meant was like here:(main section)
__________________ ~CROC~(c 'rock)n. -The master of ideas, and the occasional mod (Works with mr. dude) Mods: 3xA combat - CPS Turbine - Super Flash Flood - (working on CPH) |
| | |
| | #20 |
| Administrator Join Date: Feb 2004 Location: UK
Posts: 1,322
UserID: 77 | You can use XSL to style XML documents if you need to, but I think using XML would be overkill for your purposes. As has been suggested, a SQL database used in conjunction with PHP would probably work better for you. Also take a look at Notepad++. It helps you to write correct HTML (among many languages) by colouring tags - take a look. ![]()
__________________ ISS: Soaker Sagas Submit your saga and see it up with other titans of water warfare. |
| | |
| | #21 |
| Senior Member Join Date: Mar 2006 Location: Ontario, Canada (GTA)
Posts: 288
UserID: 569 | I believe DreamWeaver colours tags, but think that SQL/PHP is easiest. Would I be right in assuming that?
__________________ ~CROC~(c 'rock)n. -The master of ideas, and the occasional mod (Works with mr. dude) Mods: 3xA combat - CPS Turbine - Super Flash Flood - (working on CPH) |
| | |
| | #22 |
| Founder Join Date: Mar 2003 Location: Maryland
Posts: 5,985
UserID: 1 | Yeah, I'm looking at the code in that and I can not recommend it. Google will not be able to spider that website unless you submit a sitemap to them or have some other method. People with Javascript turned off won't see anything. There also are potential performance problems with that approach (it's best to put the burden on a fast server than a potentially slow client). I've learned PHP and SQL gradually over the years and I recommend you go that way. Both in combination certainly will be easier than programming Javascript to read an XML file. ![]()
__________________ email: ben at sscentral dot org / Forum rules Read this page before emailing me. Do not send me a PM or email with a water gun question if someone else could answer the question. Post at the forums. You will get a response from me along with others' views or ideas. Do not send me a PM or email about reading a certain post unless it's been a few days since you've posted. I try to read every post. |
| | |
| | #23 |
| Senior Member Join Date: Mar 2006 Location: Ontario, Canada (GTA)
Posts: 288
UserID: 569 | I am taking a computer programming course next year, so when I learn some programming styles or whatever, I could probably update the whole site to PHP later on, when I have an understanding of programming. How do you display PHP documents? I made a test, but how do you display the document?
__________________ ~CROC~(c 'rock)n. -The master of ideas, and the occasional mod (Works with mr. dude) Mods: 3xA combat - CPS Turbine - Super Flash Flood - (working on CPH) |
| | |
| | #24 |
| Administrator Join Date: Apr 2006 Location: Virginia
Posts: 3,251
UserID: 576 | Just open the PHP file in a web browser. CS is funny - there's a divide (PDF) between people who get it and people who don't. If your school has a shopping period, you could stay in the class for two weeks before deciding whether or not to continue. If you like it, congratulations! ![]() CS was neat for me and I'm glad I took it. And it definitely does make things like XML and PHP much easier to comprehend.
__________________ Forum Rules |
| | |
| | #25 |
| Senior Member Join Date: Mar 2006 Location: Ontario, Canada (GTA)
Posts: 288
UserID: 569 | I see... It just wasn't working when I previewed it in Dreamweaver. I guess it is all server side?
__________________ ~CROC~(c 'rock)n. -The master of ideas, and the occasional mod (Works with mr. dude) Mods: 3xA combat - CPS Turbine - Super Flash Flood - (working on CPH) |
| | |
| | #26 |
| Founder Join Date: Mar 2003 Location: Maryland
Posts: 5,985
UserID: 1 | Yes, PHP is a server side script. If you don't want to upload the script, you can run Apache and PHP on your computer and preview it in your browser, but if you have good hosting that can be more hassle to set up. ![]() Dreamweaver probably wouldn't be a good way to edit the code too because of all the overhead. I'd suggest something lighter like Notepad++ if you just want to edit PHP code.
__________________ email: ben at sscentral dot org / Forum rules Read this page before emailing me. Do not send me a PM or email with a water gun question if someone else could answer the question. Post at the forums. You will get a response from me along with others' views or ideas. Do not send me a PM or email about reading a certain post unless it's been a few days since you've posted. I try to read every post. |
| | |
| | #27 |
| Senior Member Join Date: Mar 2006 Location: Ontario, Canada (GTA)
Posts: 288
UserID: 569 | The <?php ?> tags are wierd... However, I am kind of beginning to get it now. I just need to learn more basic information about PHP, like how to make a table or other things
__________________ ~CROC~(c 'rock)n. -The master of ideas, and the occasional mod (Works with mr. dude) Mods: 3xA combat - CPS Turbine - Super Flash Flood - (working on CPH) |
| | |
| | #28 |
| Founder Join Date: Mar 2003 Location: Maryland
Posts: 5,985
UserID: 1 | You don't make tables with PHP. You use PHP to program stuff. All PHP does is write HTML code, so you don't need to learn a new way to do HTML. You need to learn how to use PHP. Below is a basic header-footer script like what we used in SSC versions 1 to 3. Code:
header.php and footer.php are the headers and footers of the page. You can use this to save writing a lot of code and make changes to the website site-wide a lot easier. The $location variable tells where the page is relative to the header and footer files. If the page is a directory up (i.e. in http://www.domain.com/here/page.php where the header and footers are in http://www.domain.com), then you have to have something like that. In the most basic page, header.php could be this: Code:
footer.php could be this: Code:
That's the most detailed PHP code we went into here for a while. Now we're running off a database, which makes things a lot simpler and allows for rapid changes to be made by many people.
__________________ email: ben at sscentral dot org / Forum rules Read this page before emailing me. Do not send me a PM or email with a water gun question if someone else could answer the question. Post at the forums. You will get a response from me along with others' views or ideas. Do not send me a PM or email about reading a certain post unless it's been a few days since you've posted. I try to read every post. |
| | |
| | #29 |
| Administrator Join Date: Apr 2006 Location: Virginia
Posts: 3,251
UserID: 576 | If you're interested in database tables, you'll want to find a good MySQL tutorial. But honestly, if you don't feel that PHP is too urgent you could wait until you've taken CS. Other than that, I would suggest following a PHP and MySQL tutorial (as in, seeing how you'd build a sample website). EDIT: I just saw Ben's post. I would suggest following his method to include universal headers, footers, and CSS. That'll make each bit of HTML a lot simpler. A database really just makes it easier to store hundreds of articles. You could also have individual database tables for reviews, galleries, etc., which once again reduces the amount of information that you need to enter for each. In each table, the column is some type of data field: say, the name of the article, the name of the author, the date, and the text. Each row is an article. Then you could have a couple types of php usages. With the SSC backend, a php file accesses each database entry (each row) and combines them with the current CSS, header, and footer to create actual HTML. It's rather efficient because the server just needs to return the HTML document when the user asks for it. Many systems, like forums, are more dynamic. Your browser asks for a php file each time, because things like the current post count of each user (displayed multiple times, too) could have changed each time you view the page. Thus the server has to carry out all the tasks in the php each time and return a new HTML document each time, but the file is updated more often. For a static website (with no forums, etc.), you can probably use the former method. And unless you're working with hundreds of articles, a database probably isn't necessary either. Copy and pasting templates is how most websites started, and as Ben said, that's how SSC was run. And when the time comes for advanced php apps, you'll have plenty of experience. ![]() EDIT again: Just to clarify, in Ben's second code snippet, $title should have been defined previously. I suppose it's an easy way to create a template. For example, your reviews template could be: Code:
(And your $text could have HTML markup in it.) With that template, you never need to touch the bottom part, which comes in very handy if you have fancy layouts or ten fields or something. All you do is edit the top. A database allows you to store each of those fields elsewhere and have a single PHP file that accesses the database.
__________________ Forum Rules Last edited by Silence : 04-12-2008 at 01:53 PM. |
| | |
| | #30 |
| Senior Member Join Date: Mar 2006 Location: Ontario, Canada (GTA)
Posts: 288
UserID: 569 | Alright, that makes a bit of sense now. I might as well get started on this new coding now. Off-topic: Ben, is it ok if I move the extrawater forum from its current location to forums.supersoaker.org?
__________________ ~CROC~(c 'rock)n. -The master of ideas, and the occasional mod (Works with mr. dude) Mods: 3xA combat - CPS Turbine - Super Flash Flood - (working on CPH) |
| | |