Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by Ingolme

  1. You can make the text align to the vertical middle of a container but only if the container has a static height. It's like this:<div style="height: 200px; line-height: 200px;">Some text Some text Some text Some text </div>
  2. Maybe you want to use the photo as a background image:div.class {background-image: url(image URL);background-position: 200px 50px;background-repeat: no-repeat;}****************<div class="class">Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text</div>Another thing you can do is this:<div style="position: relative"><img src="image URL" alt="Alternate text" style="position: absolute; top: 200px; left: 50px; z-index: -1;" />Some text Some text So
  3. Well, you can try .htaccess and .htpasswd files to pretect folders.with PHP you can't protect images, but you can protect the page itself something like this: <?phpif($_POST['user'] == "username" && $_POST['password'] == "password") {?><!-- Show some HTML of the site --><?php} else {?><form action="?a=1" method="post"><div>Log in to view this page:<br />Username: <input type="text" name="user" /><br />Password: <input type="password" name="password" /><br /><input type="Submit" /></div></form><?php}?>
  4. If favicon.ico is placed in the top level of a server that allows it, the favicon will show on all pages of the server.
  5. The real way for search engine optimization is:- Make your pages navigatable by googlebots (No flash links or links dynamically created by javascript, a valid HTML page)- Have reciprocate links (you link to a page, they link back) to as many places as you can.- The longer your site has been around the more search engines will like it.
  6. You're allowed to write PHP within HTML. For example:<?php $link = "http://www.google.com"; $linkname = "Google";?><a href="<?php echo $link;?>"><?php echo $linkname; ?></a>
  7. You can try this: function days_in_month($month,$year) {/* $year is necessary just in case it's a leap year */$d = mktime(0,0,0,1,$month,$year);//This function creates a PHP date object$days = date("t",$d);// 't' returns the days of a given monthreturn $days;}$days = days_in_month(4,2000);
  8. Just apply the same style to the link when it's activated as when it's not. If all that matters is the style.
  9. when you place an image within a text, usually the image bottom is aligned with the text bottom. This can be changed with the CSS vertical-align.
  10. Centering a div is like this: <div style="text-align: center"> <!-- Parent container --> <div style="margin: 0 auto;"> Some content. </div></div> This shouldn't fail.
  11. You can try (the container must be given "position: relative" and a defined height):position: absolute; bottom: 0px;Vetical align wouldn't work anyways, that just tells the browser how to display inline elements compared to the text.
  12. Oh, sure. Just change this:if (mysql_num_rows($result) > 0) {header("Location: user_page.php");} else {header("Location: non_user_page.php");}
  13. You can try this:a = new Date()var d = Number(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),0));d = d/1000;// d would be the Unix timestamp for this moment.
  14. I'd do it this way: <?php$con = mysql_connect("hostname/server IP","username","password");if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("database_name", $con);$firstname = $_REQUEST['firstname'];$surname = $_REQUEST['surname'];$result = mysql_query("SELECT * FROM users WHERE firstname = '$firstname' AND surname = '$surname'");if (mysql_num_rows($result) > 0) {echo 'user_page.php';} else {echo "non_user_page.php";}?> By the way, substitute firstname and surname for the database field names if these are incorrect in "firstname = '$firstname' AND surname
  15. You can use \n to add line breaks, for example:fwrite($file,$myVar1."\n".$myVar2."\n".$myVar3);
  16. This isn't very well designed, you even have tables embedded within tables. If this were done with CSS and <div> tags the "Main navigation" and "News and updates" boxes would be aligned to the top automatically.
  17. I don't think you need quotes for background URLs either. Take a look at this W3Schools example: http://w3schools.com/css/pr_background-image.asp
  18. Ingolme

    Validate Form

    First of all, we need to reference these fields:<form action="something.php" method="post" id="form" /><input type="text" id="phone" /><input type="text" id="fax" /><input type="text" id="email" />Then we can have a function that activates when you click a button:<input type="button" value="Submit" onclick="formValidate()" /></form>Put this within the <head> tags of the document:<script type="text/javascript">if(document.getElementById("phone").value.length == 0 && document.getElementById("fax").value.length == 0 && document.getEl
  19. Windows Media Player doesn't record sound. You can record up to a minute in Windows' sound recorder (Start menu > Accessories > Entertainment > Sound recorder).You might want a more professional tool for recording. I use goldwave's digital audio editor trial version: http://www.goldwave.com
  20. Well, you'd need to record it in a database each time they end their session. And each time you record it, add the time to the value that's already in the database.
  21. Does anybody realise the problem is this?:= "about:I wrote = "about: blank" in the original code. All those who have been revising my code and know something should have been aware of this.
  22. Javascript is a client-side programming language. It modifies the page using the client's browser.
  23. AJAX is based on Javascript. If javascript is turned off you can't do anything. Anyways, you won't need AJAX for something like this, just normal javascript.Here's a script I made up, you can change the styles of the divs if you like. And add your own images: <html><head><script type="text/javascript">function imageSwap(id) { tempSrc = new Image(); tempSrc.src = document.getElementById(id).src document.getElementById(id).src = document.getElementById('main').src; document.getElementById('main').src = tempSrc.src; if(tempSrc.width > document.getElementById('main').parentNo
  24. Because innerHTML will also return HTML tags. And imagine you search for "table", and it says it found it but you can't see the word "table" anywhere at all (supposing you're a visitor that doesn't know anything about HTML).
  25. Ingolme

    Image Size

    What you can do is this:Within the <head> tags: <script type="text/javascript">function imageResize(id) { if(document.getElementById(id).width > 64 || document.getElementById(id).height > 64) { if(document.getElementById(id).width > document.getElementById(id).height) { document.getElementById(id).style.width = "64px"; document.getElementById(id).style.height = (document.getElementById(id).height/document.getElementById(id).width * 64) + "px"; } } return null;}</script> For each image: <img src="file1.jpg" alt="..." id="something" onload="imageResize('some
  • Create New...