Jump to content

Anders Moen

Members
  • Posts

    866
  • Joined

  • Last visited

Everything posted by Anders Moen

  1. You can use this; XHTML:<div id="some_name">All your content :)</div>CSS:#some_name {width: 600px;margin: 0 auto;} But to make this work in all browser, you have to use the doctype if you don't have it
  2. Yep, it's now Valid XHTML, and that's good :)The chances for the site to look good in all browsers are much bigger when it's valid.And as someone mentioned earlier, you should get some more colors on it, and to be honest, I have no idea of what colors you should use. I ###### at finding colors for my site :)But all together, it looks great And good you also have text on it, because it's easier for us to see how it'll look.
  3. Anders Moen

    BBCodes

    And then I don't need anything more? It automatically makes < to < ??:)Now the <span style='font-size: 15pt;'>text</span> doesn't work when I add text
  4. Anders Moen

    BBCodes

    And how do I insert it?This is how some of the rest looks:$tekst = str_replace("[*code]", "<div style='background-color: #f2f0e7;'>", $tekst);$tekst = str_replace("[/code*]", "</div>", $tekst); // without the stars of course I didn't excactly get what you meant then. So can you use the whole thing?
  5. Anders Moen

    Login script

    Yep, that's correct Matpatnik.If anyone need a loginscript and registration code (PHP) from me, just add me to MSN (anders_sm(at)hotmail.com). Then I'll send it to you :)They're database driven just so you know
  6. Anders Moen

    fixed side bar

    I don't think that was what he meant. I think he meant he wants the link to your page, so he can see it himself.
  7. Okay. Still the same answer from me.Change this one: XHTML:<?xml version="1.0"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><title>University of Chester</title><link rel="stylesheet" type="text/css" href="style.css" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta name="generator" content="NoteTab Light 4.95" /><meta name="author" content="William Maginn" /><meta name="description" content="" /><meta name="keywords" content="" /></head><body><div id="content"><div id="header"><h2>United states of America</h2><!-- <br><img src="images/ron_burg.jpg" alt="Will Maginn" width="140" height="140"/> --></div><div id="menu"><div id="menuText"><ul><li><a class="link1" href="index.html">link</a></li><li><a class="link2" href="index.html">link</a></li><li><a class="link3" href="index.html">link</a></li><li><a href="index.html">Link4</a></li><li><a href="index.html">Link5</a></li><li><a href="index.html">Link6</a></li><li><a href="index.html">Link7</a></li><li><a href="index.html">Link8</a></li><li><a href="index.html">Link9</a></li><li><a href="index.html">Link10</a></li></ul></div></div><div id="main">Good morning,My name is Mr Griffin. </div><div id="footer">MagSoft© 2007</div></div></body></html>CSS:#menu a {float:left; width: 30%;height:468px;list-style-image: url(images/icon.jpg);background: white url(images/menu.JPG) no-repeat left;<!-- I want this background image to change when hovering over a link -->padding: 20% 0% 0% 8%;}#menu a:hover {float:left; width: 30%;height:468px;list-style-image: url(images/icon.jpg);background: white url(images/menu_new_image.JPG) no-repeat left;<!-- I've changed the above picture now;) -->padding: 20% 0% 0% 8%;} Maybe something got wrong, here though. Hope it'll work
  8. Anders Moen

    Login script

    Haha okay. But I can help you if you want to.Either PM or add me to MSN; anders_sm(at)hotmail.com
  9. AH, I have no idea, but this is the same thing I'm looking for. I can't seem to find it, or else I could have helped you.
  10. It wouldn't be stupid, but I don't think it would be a big hit.Most people listen to music, so they had to turn that off if they were gonna learn here then.So I think it would be a bad hit. Plus; a lot of people wouldn't even have understood what they said. Lot's of unknown words you know :)And one more thing, do you think the directors of W3Schools have time to read in everything? That'll take a loooooooooooong time. Maybe they would, but I doubt.In other words; I don't think this is gonna happen
  11. Anders Moen

    Login script

    That's not a register code, that one's a login code.But I have a registration code too register.php:<html><head><title>Register</title></head><body><?php if($_POST['submit']) { $mysql_host = "localhost";$mysql_user = "username";$mysql_pass = "password";$mysql_db = "database_name";$mysql_tabell = "table_the_registered_should_be_laid"; // I'd recommend the same as the login code uses because then they can logg in immidietely$mysql_link = mysql_connect ($mysql_host, $mysql_user, $mysql_pass) or die ("ERROR!"); mysql_select_db ($mysql_db) or die ("ERROR!"); $name = htmlspecialchars(strip_tags($_POST['name']));$email = htmlspecialchars(strip_tags($_POST['email']));$username = htmlspecialchars(strip_tags($_POST['username']));$password = htmlspecialchars(strip_tags($_POST['password'])); $mysql_query = "INSERT INTO $mysql_tabell (name, email, username, password) VALUES ('$name', '$email', '$username', '$password')";if(mysql_query($mysql_query)) { echo("<strong>You wrote:</strong><br />Name: $name<br />Email: $email<br />Username: $username <br />Password: *hidden*"); } else { echo("An error occured. Check your script, mate."); } } else { echo(" <form action=\"\" method=\"post\"> <p>Name:<br /><input type=\"text\" size=\"40\" name=\"name\" /></p><p>Email<br /><input type=\"text\" size=\"40\" name=\"email\" /></p> <p>Username<br /><input type=\"text\" size=\"40\" name=\"username\" /></p><p>Password:<br /><input type=\"password\" size=\"40\" name=\"password\" /></p> <p><input type=\"submit\" value=\" Register me now!!! \" name=\"submit\" /></p> </form> "); }?></body></html>
  12. Ehh...I thought this site (general), was to discuss W3Schools, just like it says. It's going way off topic moderators! Haha...Or else you need to change the text on the frontpage/W3Schools at the forum.
  13. I'm not sure what you mean but if you take a <div> with no background or something, and put a link <div class="test"><a href="" class="fullsize"><!-- no writing here if you're not gonna have that --></a></div> And then you use CSS: #test {width: 500px; height: 500px;}a.fullsize {display: block; width: 100%; height: 100%; background-image: url(1.jpg); background-repeat: no-repeat;}a.fullsize:hover {display: block; width: 100%; height: 100%; background-image: url(2.jpg); background-repeat: no-repeat;}
  14. Anders Moen

    Login script

    Okay, here's my updated post with the login script <?phpsession_start(); // use this code on top of all pages.?><html><head><title>Login</title></head><body><?php$db=mysql_connect("lcoalhost", "username", "password");mysql_select_db("database_name", $db); $username = htmlentities($_POST['username']); $password = htmlentities($_POST['password']); $username = mysql_real_escape_string($username); $password = mysql_real_escape_string($password); $query = mysql_query("SELECT username, password FROM medlemmer WHERE username = '$username' AND password = '$password'"); if(mysql_num_rows($query) == 1 OR $_SESSION['online'] == true ) { $_SESSION['online'] = true; echo "Welcome $username! "; } else { echo "<form action=\"\" method=\"post\"><p>Brukernavn</p><input type=\"text\" name=\"username\" /><br /><p>Passord:</p><input type=\"password\" name=\"password\" /><br /><br /><input type=\"submit\" value=\"Logg inn\" /></form> "; }mysql_close($db);?></body></html> If something's not right, tell me
  15. Anders Moen

    BBCodes

    Doesn't anyone know? :)I can't seem to figure it out myself...
  16. Are there anyone who can tell me what the **** is wrong with my script? I've asked on several forums, and no one can seem to figure it out :S <?php if($_POST['submit']) { $mysql_host = "localhost";$mysql_user = "username";$mysql_pass = "password";$mysql_db = "db_name";$mysql_tabell = "table_name"; $mysql_link = mysql_connect ($mysql_host, $mysql_user, $mysql_pass) or die ("ERROR!"); mysql_select_db ($mysql_db) or die ("ERROR!"); $tittel = htmlspecialchars(strip_tags($_POST['tittel']));$forste = htmlspecialchars(strip_tags($_POST['forste']));$innhold = htmlspecialchars(strip_tags($_POST['innhold']));$navn = htmlspecialchars(strip_tags($_POST['navn']));$epost = htmlspecialchars(strip_tags($_POST['epost']));$ip = $_SERVER['REMOTE_ADDR'];$dato = date("d, m, Y");$mysql_query = "INSERT INTO $mysql_tabell (tittel, forste, innhold, navn, epost, ip, dato) VALUES ('$tittel', '$forste', '$innhold', '$navn', '$epost' '$ip', '$dato')";mysql_query($mysql_query) or die(mysql_error());} else { echo("<form action='' method='post'> <p>Tittel<br /><input type='text' size='80' name='tittel' /></p><p>Første avsnitt<br /><textarea rows='7' cols='60' name='forste'></textarea></p> <p>Resten<br /><textarea rows='7' cols='60' name='innhold'></textarea></p><p>Navn<br /><input type='text' size='80' name='navn' /></p><p>Epost<br /><input type='text' size='80' name='epost' /></p><p><input type='submit' value='Legg til' name='submit' /></p> </form><br /><br />"); }?> Here's the error message I get when I click submit:"Column count doesn't match value count at row 1"
  17. Anders Moen

    Button clicks

    Okay, you could have told us in the post before you know :)I guess you'll gonna have to find something else than the count() then. Search for ip counter at google.com or something. Maybe you'll get something then
  18. Anders Moen

    Button clicks

    Hmm, I guess there are. You can use <form action='' method='post'>. Then you will be on the same site all the time. If that's what you mean.
  19. Anders Moen

    BBCodes

    Okay, it doesn't matter if it's an easy code because it works just perfect :)But there's one more trouble I have now. If someone types for example <html> my site wouldn't be valid anymore, so I want it to so <html> = <html>. Or else they can ###### up my site. I tried to use the same code as you gave me (preg_replace = "<", "<", $tekst) or something, I don't remember the code. But when I have that, they can't choose font-size and stuff, because <span style="font-size: 15pt;">text</span> gets replaced with <span style="font-size: 15pt;">text</span> so the code shows instead...
  20. Anders Moen

    Button clicks

    Aha. Maybe you mean the count() variable in PHP. Read about it at php.net.
  21. Anders Moen

    Login script

    I have a login script in PHP and MySQL. I don't have it here right now, but I'll post it when I find it on my server.
  22. Either use this: <a name="#top"></a>THIS IS THE TOP :DLOTS OF TEXT AND CONTENT GOES HERE<br>LOTS OF TEXT AND CONTENT GOES HERE<br><a href="top">Top</a> Or use this: <a href="java script:scroll(0,0)">Top</a>< I've seen people write <a href="java script:scroll(0,0)">Top</a> and that's wrong, because it's written in one word.
  23. Hm, if you want it to fill the site 100% all the time, you can use <div style="width: 100%;">text</div>.And I've also noticed the Doctype should be there too, because that's made a scrollbar to the right on some of my sites before I even knew what it was. I'd recommend XHTML Transitional
  24. That tutorial was really bad. It's really confusing, the codes doesn't hang together if you know what I mean
  25. Anyone got a code so I can upload images to my database?The table will get an ID which will have auto_increment, so I want the picture to be renamed to the same as the ID it'll come up under. I also want it to be resized to for example width: 300px and height: 200px.For example:First time I insert, the image should be renamed to 1.jpg or 1.gif or whatever else, after what filetype it is.The second time I insert, that second image should be renamed to 2.jpg/gif/bmp or whateverAnd then it just continues. So anyone got the code for this?
×
×
  • Create New...