Jump to content

Ingolme

Moderator
  • Content Count

    14,050
  • Joined

  • Last visited

  • Days Won

    68

Everything posted by Ingolme

  1. I believe you can download software to run PHP on your computer. It doesn't run on its own though.
  2. The length property of an array object gives the amount of elements that the array contains:var G = ["Hello","testing","element"];document.write(G.length)//This will return 3var G = ["Hello","testing","element","something","something else"];document.write(G.length)//This will return 5To go through the elements of an array you need to do this:for (x=0;x<myArray.length;x++) {document.write(myArray[x])}
  3. Can you show the HTML that you're working with?
  4. Ingolme

    Width of div

    You can give it a fixed position, but it wil be fixed in comparison to the page, and it won't inherit values from its container. You'll have to give it its own width.I'm not sure exactly what you're trying to achieve, there may be other ways to work around it. Maybe you can post a diagram or something to show what you mean.
  5. CSS files don't contain HTML, you can apply the same style to all pages (colors, background images, borders), but it can't add elements into pages (tables, boxes, text).For that you can use the PHP require() function, or you can decide to use javascript and load navigation menu data from an XML file.
  6. The problem with your code is this:for(var items = listItems[0]; itmes < listItmes[5]; itmes++)The for command is an iterator: it only needs a number, not any other kind of data:.The program interprets this: The real solution does this:
  7. To solve your first problem you just need to change the CSS:.mid {background: url(skin/message/b_05.gif) top left no-repeat;padding-left: 28px;}About the second one. I really am not sure of a good method how to do it. It happens when you put <p> or <form> elements inside this kind of structure. One thing you can do it put a line break before and after the content:...<div class="content"><br /><!-- content goes here --></br /></div>...To give a fixed width or height to the box you can do this:<div class="all"><div class="topleft"><div class="topright"><div class="topmid"><!-- Nothing here --></div></div></div><div class="left"><div class="right"><div class="mid"><div class="content"><!-- Begin content --><!-- End content --></div></div></div></div><div class="bottomleft"><div class="bottomright"><div class="bottommid"><!-- Nothing here --></div></div></div></div>And use the following CSS: .all {width: 400px;height: 200px;}.content {overflow: auto;}
  8. Can you show the HTML code that you want the background applied to first?
  9. Ingolme

    session?

    Is session_start() written in accound.php twice?And another thing:It says "Welcome: 1" because you wrote $_SESSION['login']=1 in your other file.So in checklogin.php you do this:Where it says if($count == 1) you can put if($count==1) {$_SESSION['login']=$myusername;...
  10. Ingolme

    session?

    I've only used sessions for one of my projects before.But I think you're supposed to putsession_start();in your account.php file as well.
  11. That can be solved too... I just keep messing up.Change your HTML code so that it's like this (adding a new <div class="conten">: <div class="topleft"><div class="topright"><div class="topmid"><!-- Nothing here --></div></div></div><div class="left"><div class="right"><div class="mid"><div class="content"><!-- Begin content --><!-- End content --></div></div></div></div><div class="bottomleft"><div class="bottomright"><div class="bottommid"><!-- Nothing here --></div></div></div> Then make the CSS like this: .mid {background: url(skin/message/b_05.gif) center left no-repeat;padding-left: 28px;}.content {background-color: #FFFFFF;}
  12. Maybe the UL width will take effect if you declare the document width first:html,body {width: 100%;}I have no guarantee it will work.Strangely enough, your ul tag seems to have a margin on both the left and right. I don't know why.
  13. That error means that the file (getcitiy.php) wasn't found on the server. Seeing as it was spelled wrong it's not a surprise the error was returned. It's called a 404 error, one between a list of errors that the servers have programmed to handle certain requests.
  14. Well, the action attribute of the <form> tag was misspelled. You can make the form submit when you select an option by doing this:<form action="getcity.php" method="get" id="myForm"><select name="country" onchange="document.getElementById('myForm').submit()"><option value="">select:</option><?php$result = mysql_query("SELECT DISTINCT country FROM cities");while ($row = mysql_fetch_assoc($result)){echo "<option value=\"{$row['country']}\">{$row['country']}</option>";}?></select></form>
  15. Well, you might want to submit the form first:<form action="getcitiy.php" method="get"><select name="country"> <option value="">select:</option> <?php $result = mysql_query("SELECT DISTINCT country FROM cities"); while ($row = mysql_fetch_assoc($result)) { echo "<option value=\"{$row['country']}\">{$row['country']}</option>"; } ?></select><input type="submit" value="Select" /></form>
  16. 1) I am not sure if I'm right, but I think that this is because the UL element, being a block, has the same width as the body, and when you move it 25%, the entire document is stretched by 25% (body's width + 25%).To solve it you can try giving the UL element a width of 75% to compensate the 25% you added to the left of it:ul#logo{ position:relative;top: 150px;left: 25%;width: 75%;padding-left: 20px;list-style: none;text-transform: uppercase;font-size: .9em;letter-spacing: .1em;}ul#mainmenu{ position:relative;top: 170px;left: 25%;width: 75%;padding-left: 20px;list-style: none;}2)This CSS:a:link, a:visited {padding-bottom: 1px;color: #31363e;text-decoration: none;}is overriding this one:ul#mainmenu li.alt{ margin-left: 8px;padding: 4px;color: #858c97;}Because the actual element that contains the text is <a> and not <li>.You can try solving it by adding this:li.alt a{color: #858c97;}
  17. Oh, just change the part of code for .mid so that it's like this:.mid {background: url(skin/message/b_05.gif) center left no-repeat #FFFFFF;padding-left: 28px;}
  18. Ingolme

    Width of div

    If you want to "fix" the div's position and size relative to its container you can do this: <div style="position: relative; width: 70%;"><!-- container -->Some content<div style="position: absolute; bottom: 0px;"><!-- this div is set to always be on the bottom of its container, not of the full page -->Something else</div></div>
  19. OK, Sorry for the result before, I hadn't tested it myself before. This one works for me: .topleft {background: url(skin/message/b_01.gif) top left no-repeat;}.topright {background: url(skin/message/b_03.gif) top right no-repeat;padding: 0px 20px 0px 28px;/* The first and third should be 0px, the second is the widthof the top right corner image and the fourth is the widthof the top left corner image */}.topmid {background: url(skin/message/b_02.gif) top right repeat-x;height: 17px; /* This height must be the height of the background image used */}.left {background: url(skin/message/b_04.gif) top left repeat-y;}.right {background: url(skin/message/b_06.gif) top right repeat-y;margin-right: 2px;padding: 0px 18px 0px 0px;/* The first and third should be 0px, the second is the widthof the right border image and the fourth is the widthof the left border image */}.mid {background: url(skin/message/b_05.gif) center left no-repeat;padding-left: 28px;}.bottomleft {background: url(skin/message/b_07.gif) top left no-repeat;}.bottomright {background: url(skin/message/b_09.gif) top right no-repeat;padding: 0px 20px 0px 28px;/* The first and third should be 0px, the second is the widthof the bottom right corner image and the fourth is the widthof the bottom left corner image */}.bottommid {background: url(skin/message/b_08.gif) top right repeat-x;height: 17px; /* This height must be the height of the background image used */}
  20. Ingolme

    Help Please

    That's far more than HTML, it uses PHP and other server side laguages. It's really complicated. I recommend reading W3Schools' PHP or ASP tutorials.
  21. Ingolme

    Width of div

    But when the position is set to fixed, I think the div doesn't inherit anything from its container.
  22. I think this should work. I've applied the widths and heights of the given images. .topleft {background: url(skin/message/b_01.gif) top left no-repeat;}.topright {background: url(skin/message/b_03.gif) top right no-repeat;}.topmid {background: url(skin/message/b_02.gif) top right repeat-x;height: 17px; /* This height must be the height of the background image used */padding: 0px 20px 0px 28px;/* The first and third should be 0px, the second is the widthof the top right corner image and the fourth is the widthof the top left corner image */}.left {background: url(skin/message/b_04.gif) top left repeat-y;}.right {background: url(skin/message/b_06.gif) top left repeat-y;}.mid {background: url(skin/message/b_05.gif) center left no-repeat;padding: 0px 18px 0px 28px;/* The first and third should be 0px, the second is the widthof the right border image and the fourth is the widthof the left border image */}.bottomleft {background: url(skin/message/b_07.gif) top left no-repeat;}.bottomright {background: url(skin/message/b_09.gif) top right no-repeat;}.topmid {background: url(skin/message/b_02.gif) top right repeat-x;height: 17px; /* This height must be the height of the background image used */padding: 0px 20px 0px 28px;/* The first and third should be 0px, the second is the widthof the bottom right corner image and the fourth is the widthof the bottom left corner image */} Oh, I forgot to mention, the text and content goes here: <div class="topleft"><div class="topright"><div class="topmid"><!-- Nothing here --></div></div></div><div class="left"><div class="right"><div class="mid"><!-- Begin content --><div id="post_message_$post[postid]">$post[message]</div><!-- End content --></div></div></div><div class="bottomleft"><div class="bottomright"><div class="bottommid"><!-- Nothing here --></div></div></div>
  23. Ingolme

    Validation

    You're right, but I never studied Regular Expressions. I should do that. The RegExp part of the Javascript reference on W3Schools is actually pretty new, I had never seen it before and I check it often. I glanced at it a week or two but never started learning it because I haven't had much time.
  24. Ingolme

    Width of div

    But position:fixed, means that the position coordintes are relative to the window and not the parent. Why do you need a div with a fixed position if it's inside another one?Maybe you can give an example of what you want your page to be like.
  25. But it still won't solve the problem of putting a paragraph and an image next to eachother...
×
×
  • Create New...