Jump to content
xisto Community

Emerald Green

Members
  • Content Count

    7
  • Joined

  • Last visited

Posts posted by Emerald Green


  1. There is probably no right or wrong answer, but now im curious to put a index.htm and an index.html on my server and see which one is called wen you visit the main url

    It would depend on your web server's configuration. Apache, for instance, has a configuration directive:
    DirectoryIndex index.html index.htm index.php

    With this configuration, Apache will first look for a file called index.html. If it can't find one, it will try to find index.htm. If it still can't find one, it tries index.php. But if they were in a different order, Apache would search for them in that order instead. I'd think most servers these days would have index.html before index.htm, but you never know.

    As for .html vs .htm, who cares? I personally prefer .html, but I'm quite surprised at the number of people who consider .htm "not professional" and "lazy". It does exactly the same thing, so what's the problem? Most JPEG files are saved as .jpg, rather than .jpeg - is that unprofessional and lazy?

  2. Personally, I like PHP Designer. I never warmed to HTML-kit. But I wouldn't use either alone. For my web design and coding, I usually use a combination of PHP Designer and AceHTML Freeware. PHP Designer for coding PHP-heavy pages, and AceHTML for pages with little or no PHP and for syntax-checking PHP-generated pages. AceHTML has a lot of really nice, creative features for working with HTML, and I find the two programs complement each other well.If you haven't used either PHP Designer or HTML-kit much yet, I'd say go ahead and install them both. Try them out, play with them, see what works for you. Because what works for me or for Houdini or for anyone else might be totally wrong for you.


  3. Like everyone else has said, there's no such thing as a "best" programming language. Every language has its own strengths and weaknesses.I've used BASIC (first Atari BASIC - that was how I started programming - then Visual Basic), VBscript for ASP, and PHP. I've also dabbled in Java and C/C++.Obviously, Java and C/C++ are more powerful languages. But, going on the ratio of ease-of-learning to power, I'd have to say my favourite is definitely PHP. I learnt it in a snap. I was particularly impressed with how easy it was to connect to a database through PHP. I spent hours trying to manage it with ASP (it probably would have been a lot easier if I'd had MS Access, but I didn't - I was left struggling with ODBC). But when I tried to do the same thing in PHP, it just worked! That sure gave it the wow factor for me. Of course, building your GUI in HTML makes things a lot easier. And PHP can do a lot. It does everything I want it to. What more can you ask?But I'm not going to be running around proclaiming PHP as the One True Language to which thou all shalt switch. It's a scripting language. And although it's made some slight movements towards becoming a "real" programming language, it will never do the sort of stuff that C/C++ can. That's why I'm learning C++ now.


  4. Okay, I've been having a look at your code and playing about with it, and I've got it working now. But there are several things that need fixing. I'll try to make it all as clear as possible.

     

    First of all:

    I've put the main part of the lists in a CSS file here:

     

    menu.css

    I'm not even sure if that is right.  I looked at the source code on the demo page they had, and it had all that 'head, meta, title' stuff.  But I didn't think that was supposed to be in CSS.  But none-the-less it was there and it was working, so I didn't change it.[/quote]You're quite right, HTML doesn't go in CSS files. That code is actually the code for the page itself, not part of a CSS file. Since you have your own pages that you want to use the menu on, you don't need the html/head/body part. Just copy the part from the first "<ul>" to the last "</ul>" and paste it into your own page, wherever you want the menu to go.See where it says "<ul id="nav"><ul>"? That second <ul> is totally unnecessary, and it's messing up the rest of the page. Delete it.You aren't finished with menu.css yet, though! Find the line that says, "<script type="text/javascript" src="drop_down.js"></script>" and copy that to main.php. It should go in the head section, not the body of the file.Now have another look at main.php. See your two <link> tags? They should be in the head section, not the body section. (They will probably still work in the body, because browsers are good at figuring out poorly written HTML - nevertheless, it's against the rules of HTML and could cause problems with your page.) The second one has a problem. Notice the REL=stylesheet? It's got a quotation mark at the start of "stylesheet", but not at the end. Add one at the end as well.We've moved all the important code from "menu.css", so we aren't using that any more. You can delete it now. Change the HREF in the second LINK from "menu.css" to "menustyle.css", so that it links to our real stylesheet. And don't forget to put in "http://" at the start of "ftv.astahost.com/menustyle.css" - otherwise, the server will look for menustyle.css in a folder called ftv.astahost.com, instead of looking for it at your website.And now your menu should work! In case that wasn't very clear, here is the revised code of your "main.php" file:[code]<html><head><TITLE> Fantasized TeleVision</TITLE><LINK REL=stylesheet HREF="http://forums.xisto.com/no_longer_exists/; TYPE="text/css"><LINK REL="stylesheet" HREF="menustyle.css" TYPE="text/css"><script type="text/javascript" src="drop_down.js"></script></head><body><ul id="nav">	<li><a href="#">Profile</a></li>	  <ul>		<li><a href="ftv.astahost.com/profile/person.php>Personal</a></li>		<li><a href="ftv.astahost.com/profile/studio.php>Studio</a></li>	  </ul>	</li>	<li><a href="#">Buy</a> 	  <ul> 		<li><a href="ftv.astahost.com/buy/studio.php">Studio</a></li> 		<li><a href="ftv.astahost.com/buy/sets.php">Sets</a></li> 		<li><a href="ftv.astahost.com/buy/ads.php">Advertisements</a></li> 	  </ul> 	</li> 	<li><a href="#">Hire</a> 	  <ul> 		<li><a href="ftv.astahost.com/hire/crew.php">Crew</a></li> 		<li><a href="ftv.astahost.com/hire/writers.php">Writers</a></li> 	  </ul> 	</li> </ul><div id="banner"></div><center><font color=red size=12>Fantasized TeleVision</font> </center><h3><align="left"><font color=red><b>Site Under Construction</b></font></align></h3><center><b><a href="http://ftv.astahost.com/forum/" target=_"new">Visit the FTV Forum</a></b></center><p align="right"><b>Edge City</b></align><br>   <?php   $today = date("F j, Y, g:i");   echo $today   ?></body></html>


  5. 5) Think about the file extensions on your server. Ue .inc for PHP included files, for instance.

    Do you mean that this is something you should do, or shouldn't do? Using .inc for PHP included files can be a security risk, because the server won't send .inc files to the PHP parser unless you specifically set it to do so. If you don't set it to parse .inc files, and a hacker happens to call up one of your include files, the file will be sent to the hacker as plain text, showing them your code. At the best, they could steal your code. At worst, they could discover a weakness in your code (or even something like your database login) and use it to hack your site. If you want to differentiate included files, it's probably best to name them something like filename.inc.php or filename_inc.php.

  6. I have seen it where html files have had php variables like index.html?id=test , was this done using htaccess to parse it as php, or is it some kind of client side scripting like javascript? I cant see why you would need to do this with an html? Can you explain?

    They were probably PHP files (or a similar technology, like ASP or JSP) using a .html extension for whatever reason. I know that a certain book on PHP recommends naming your PHP files with .html extensions to mask your use of PHP, thereby making your site just a little tougher for hackers. But I have to agree with vujsa and mastercomputers - it's better to name files as what they are.

    If they were static HTML files, they must have had some sort of client-side script using the variable(s). Plain HTML can't do anything with variables - it's a markup language, not a programming or even scripting language. As far as I know (but my knowledge here is small - correct me if I'm wrong), Javascript doesn't have a native function for extracting variables from a URL. You could write a script to do it manually, though, if you really wanted to.

    Incidentally, forcing an extension to parse as PHP doesn't necessarily have to be done in .htaccess. If you have access to your server configuration file, you can add the option there, which will change the setting for your whole website, not just the folder you put .htaccess in. Changing the server configuration globally isn't always desirable or feasible (as, for instance, when you are using a free web host!) but it's more efficient than using .htaccess.
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.