Jump to content

DarkElf

Members
  • Posts

    103
  • Joined

  • Last visited

Everything posted by DarkElf

  1. I assume what you mean is that you want the user to be taken to a new page when they click the submit button. you do this by putting the url in the action attribute of the 'form' tag.It seems a bit strange that it goes in the form tag and not the input tag if you are thinking about it as a hyperlink. What actually happens is that the value of the field of the form are posted to the action page when the submit button is clicked, the user is taken there as well.For more complicated forms the action page might be in php or asp which does something functional with the values the user has input as well as displaying a new page.
  2. DarkElf

    Try to learn PHP

    You need a server package installed on your pc, apache is best and is free from a lot of sources. Then you need to install php, I would just go for the most recent version (i.e. 5). You don't need MySQL unless you are actually going to use the MySQL database for your page (php/MySQL powered websites are a common combination, but that's somewhat more advanced than you will be doing when just starting out to learn php)Installing apache and php is pretty complicated though, you would be better off signing up to a host and testing your php out on their server so you can avoid installing it on your pc yourself. There is a sticky on the php forum about free hosts that support php.
  3. Yes more and more users are now using high speed connections and large css files won't matter to them, but it is always best to cater for everyone where possible. You never know who is going to visit your website from what connections, and the better your site loads no matter where they connect from the better the impression.It is also important to consider the effect this may be having on your bandwidth, if you keep your file sizes to a minimum then you can cut down you bandwidth usage and in some cases save yourself money if you are renting space on someone elses server.Check your css for any duplications and try to minimise it, look out for things like applying formatting using id to several elements when you could do it to them all at once using class, or applying it using class when you could apply it the the whole body etc.
  4. DarkElf

    Fixed Header

    Following from my above comment, the advantage to this approach is that the output page is nice clean html that contains no visible scripting. The document the user receives subsitutes the php with the content of header.htm, the php itself is removed from the end file. This makes your site more secure as users can't see your scripts, and means it will all validate as clean html/xhtml.
  5. DarkElf

    Fixed Header

    I would use php, assuming your server supports it (the vast majority do).then you can just use the php include or require function, e.g. insert the following into your page where the header should go. <?phpinclude 'header.htm'?> note that you'll need to save your page as .php instead of .htm/.html. Also note that as your domain will point to an index.htm file this means you'll also need to make an index.htm page with a meta to forward users to the php page. You just make an empty html page with the following in the head: <meta http-equiv="Refresh"content="1;url=http://www.yourpage.com/index.php">
  6. DarkElf

    cant see css file

    I'm not very experienced with xml but the problem looks to me like thus:If you are referencing an external css file you do so in the head section of the html document, you are referencing it via the xml document which is included in the body section of the html. I may be wrong as I've not done much with xml before though.You could try referencing the css in the head of the html document, and then applying it to the xml element by giving it a relevant class or id. Try it and see if it works.
  7. DarkElf

    Firefox problem

    the td which contains the problem elements does already have set width units (in px). I'll give divs a try and see what happens.
  8. Your question confuses me a bit? CSS won't replace tables in your page, it can be used to effect their formatting but not to completely replace them, you will still need to use either tables or divs (or frames) to define the basic layout of your page.The main advantage to CSS is that it is designed specifically to control the formatting of your website. HTML was never originally intended for storing detailed information on the formatting of elements and thus even though there are many tags/attributes you can use to format your elements directly in the html it is always better and you have far more options if you do it through CSS.The other key advantage is that many HTML formatting attributes are being deprecated, although this isn't likely to be a problem for users using pc's it may mean that users using new browser types (for instance on mobile phones) have problems viewing your site. If you only use valid XHTML and CSS as per the w3c web standards then you should avoid such problems.
  9. DarkElf

    Firefox problem

    To view the website I'm currently having trouble with visit Sounds of Salvation.In IE the website works fine and there are no problems. However when you view the site in firefox the menu does not display properly, the background colour to the hyperlinks hangs over the edge of the table cell. It's a fairly simple menu, just a table cell with hyperlinks in it that change color on mouse hover. The code for menu (including the table that divides it from the page content) is as follows: <table class="page-table" cellpadding="10"> <tr> <td class="border" width="100px" valign="top"> <a class="menu" href="link1.htm">link1</a><br /> <a class="menu" href="link2.htm">link2</a><br /> <a class="menu" href="link3.htm">link3</a><br />[I]etc.[/I] </td> <td valign="top">[I]Page content[/I] </tr></table> The relevant css is: body {background-color: #FDF3F0;margin: 0%;padding: 0%;}.page-table {margin: 8px;border: 0px solid black;width: 98%;}.border {border: 1px solid black; background-color: #F08A38;margin: 0px;padding: 0px;}a.menu {font-family: arial; font-size: 12pt;color: black;text-decoration: none;background-color: #F08A38;padding: 2px 8px;width: 100%;float: left;}a.menu:hover {background-color: #FAAA50;} I've tried fiddling with margins and padding etc but to no avail. Any suggestions?
  10. DarkElf

    Security issue

    Actually that's all rubbish. I was thinking of something I saw someone doing on hacker website a long time ago, but the way the php handles the form data means that it shouldn't be a problem. The page in question actually printed the input data on a subsequent page for the user to check and confirm, this meant that scirpts could be injected. The basic email form I am using doesn't actually do this though, so even if the user tried putting php tags in it they would never be parsed.For anyone interested in script injection and protecting themselves from it I did find this really interesting article on how people can inject script into the headers of emails generated this way to use your website as a base for anomymously launching spam. It suggests several effective solutions as well as explaining the problems in detail.http://securephp.damonkohler.com/index.php/Email_Injection
  11. DarkElf

    Security issue

    I'm using a form on my website so users can send me emails. That part of it is fairly straight forward, the form details are passed to another php page that sends the email and forwards them on to a confirmation page assuming all works correctly. It's fairly textbook stuff.The problem with this is that it leaves me open to script injection. If the user puts php code in the form this gets executed by the server when it runs the scripts to send the email - obviously If the user has malicious intentions and knows what they are doing with php they can cause some pretty nasty problems.Is there any way of securing the form against script injection like this? I know that there are javascripts I could use to validate the form to remove php tags from it before it is sent, but the user (hacker) could get around this by simply disabling javascript on their browser. Any thoughts?
  12. DarkElf

    Using CSS on email

    Try hosting the css sheet somewhere on the web and then when you link to it use the entire url (http://www........)The problem you are encountering is that the email is stored on the clients computer when they view it, so it searches for the css sheet in that directory but can't find it (as it doesn't exist).Alternatively you could define the css in the head section of the page instead of using an external style sheet.
  13. DarkElf

    Font families

    Awesome, that was just what I was after. Thanks.
  14. What I actually want to do is stop the user from shrinking their window beyond a certain point. The website goes a little funny if they shrink the window below about 500px across because i've used % to define some measurements on the site. Obviously most people wouldn't want to view a website in a browser window so small anyway, but figured it would be nice to avoid them spotting the flaw.
  15. DarkElf

    Font families

    I already tried that, the problem was that because the banner needs to span the entire page it resizes to fit the browser window. This had some undesirable effects on the quality of the textual part of the image.The other thread I linked to earlier refers.
  16. Is it possible to set the dimensions of the window the browser displays a page in? I would preferably like to set an minumum window size that the user can shrink the browser window to.
  17. DarkElf

    New window

    If all you want is to display text then try using the javascript alert function. See http://www.w3schools.com/js/js_popup.aspIf you want to actually open another page with the information on it then just set the hyperlink to open in a new window using the target attribute: <a href="url" target="_blank">hyperlink-name</a>
  18. DarkElf

    Font families

    I'm writing a webpage for my band which uses a font-family called flexure in its logo. I want to encorporate the font in the page but this only works for users who already have the font on their computer, which isn't many as it is not a common font. For users who don't already have the font the browser just defaults (normally to arial).Is it possible to put the font file on the server and then reference it? or is there some other way around this problem?I know I could use images for the elements in question, however I've encountered other problems with this approach, see http://w3schools.invisionzone.com/index.php?showtopic=1899
  19. Only one element on your page can have any specific ID, therefore you should only use id to define an elements formatting if that is the only element on the page you want that specific formatting to apply to. Note that the page will still work in all major browsers even if several elements have the same id, and the formatting will be applied to all of them, however this is not valid html.As many elements can have the same class as you want, therefore if you want to apply the same formatting to lots of elements then you should use class - for instance several seperate paragraphs which all need to have the same formatting but which are formatted differently from the general paragraph tag.
  20. Mmmmm, hazel nuts.....Glad to have been a help
  21. To see the page I'm having trouble with visit Sounds of Salvationthe css for the page is: /* This is the style sheet for www.soundsofsalvation.co.uk *//* Note that I've used comments to divide the page into sections, these correspond to similarly marked sections on the html page. *//* Body */body {background-color: #FDF3F0;margin: 0%;padding: 0%;}/* Banner */.banner {background-color: #FF6F21;padding: 0;width: 100%;border-bottom: 1px solid black;}.banner-text {position:absolute;right:0px;top:0px;z-index:1;}/* Page */.page-table {margin: 8px;border: 0px solid black;width: 98%;}/* Menu */a.menu {font-family: arial;color: black;text-decoration: none;background-color: #F08A38;padding: 2px 8px;width: 100%;float: left;}a.menu:hover {background-color: #FAAA50;}.border {border: 1px solid black; background-color: #F08A38;margin: 0px;padding: 0px;}/* Content */h1 {margin-left: 15px;font-family: arial;font-weight: normal;font-size: x-large;}p {font-family: arial;font-size: small;padding: 0px 8px;}p.main {margin-left: 15px;}p.bold-highlight {font-weight: bold;background-color: #FAAA50;}p.bold {font-weight: bold;}.content-table {margin: 8px;border: 0px solid black;width: 100%;}.background {background-color: #F08A38;}/* Footer */.footer {font-family: arial;font-size: x-small;text-align: center;background-color: #FF6F21;padding: 8px; border-top: 1px solid black; border-bottom: 1px solid black;} Basically the problem is with the banner across the top.I've used width:100% on the banner image to make sure it spans the whole of the browser window, no matter what the resolution. Originally the text on the right was part of the image, unfortunately this had some bizzare effects on the way the text looked for certain resolutions/window sizes.To get round that I've now used a different image for the text which displays in front of the banner image using z-index, this image does not resize so there are never any problems with the text looking odd.The problem now is that when the browser window shrinks to less than approximately 600px wide the height of the text image becomes greater than the height of the banner image, with disasterous effects (try it and see for yourself).I had forseen this and intended on getting around it by using the min-width attribute on the banner image so that it stops resizing when it gets sufficiently small enough for there to be a problem. What I had not considered was that IE does not support the min-width attribute.Does anyone have any suggestions?
  22. Do you actually want your image to stretch or shrink in proportion with the screen resolution, or do you just want it stretch or shrink in proportion to the browser window? (for a example a banner that would span the entire window exactly no matter the resolution)I don't want to even think about the former, however if the later is your preference then I have a far simpler solution which avoids any use of JS etc.The html image tag has a width and height attribute (this can and in most cases should be manipulated through CSS instead of actually in the html). This allows you to define the width and height of the image to be something other than the default, if you only define one the browser maintains the correct proportions. As well as defining this in pixels or cm you can also define it as a % of the browser window, therefore an element with width="100%" will always span the entire screen.The only problem with this is that if people resize their browser window the image automatically resizes with it.
  23. DarkElf

    Margins

    I've spotted the problem now, I was being fool.I'd previously defined a seperate margin for some elements later on in the code, this of course has priority as its more specific than defining the attribute in the body tag.Suppose it serves me right for staying up so late!
  24. DarkElf

    Margins

    Nope still doesn't work
  25. DarkElf

    Margins

    This is frustrating me in a very annoying fashion because it should be blindingly simple.I'm trying to create a page which displays without the default margins set by browsers. This not exactly a ground breaking task, its done all over the place and should take one line of code on the css as follows: body {margin: 0px; padding: 0px} I've tried setting negative values, I've tried using different units (e.g. %), I've tried setting each margin/padding seperately, but every time I look at the thing in IE it still uses the default 8px left and right margins (but strangely the top and bottom margins work properly). Can anyone tell me why?
×
×
  • Create New...