Jump to content

gsingh2011

Members
  • Content Count

    31
  • Joined

  • Last visited

Community Reputation

1 Neutral

About gsingh2011

  • Rank
    Newbie
  1. Let me clarify the issue. My document root is something like /var/www/. I have the following two files, /var/www/index.php and /var/www/foo/index.php. I have a CSS file /var/www/css/styles.css. In both index.php files, I want to include the CSS file. In the link tag, I can set href to href="<?= $_SERVER['DOCUMENT_ROOT'] ?>css/styles.css" for both files. The only issue is now if someone views the source, they see /var/www/css/styles.css. I'd prefer that in the first index.php they would see css/styles.css and in the foo/index.php they would see ../css/styles.css.
  2. I have a CSS file that all of my HTML files include. I don't like the idea of having the absolute document root path displayed in the HTML code when the file is included, so I don't want to use $_SERVER['DOCUMENT_ROOT'] as the basepath to the file. Is there a way for me to get the relative path to the document root?
  3. Thanks, I didn't know that. Now I added a logo that I want on the left side of the navbar, but everything is off center again. Here's my code, HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><link rel="stylesheet" href="style.css" /><title>Punjabi Class</title></head><body><div class="navbar"><span id="logo"> <img src="Logo.png"/&
  4. Thanks, it works! If I understand it correctly, the left edge of the navigation div is the center of the navbar div, while the right edge of the navigation ul is in the center of the navigation div, centering it. What I don't get is why the navigation div has to have float:left in it. It doesn't work without it, but what I explained doesn't include any need for floating, so I'm a little confused.
  5. I know this question gets asked a lot, but every time I use a different design for a website I run into the same problem, and the fix from the last design won't work... Centering is incredibly annoying in CSS. Here is my code, I wanted the list with the id #navigation to be centered. I put a comment labelling the CSS code that needs to be fixed. HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; ch
  6. The link to the page is www.michigangurudwara.com
  7. But why does it happen only part of the time? After some testing, it seems like hitting refresh causes the glitch 70% of the time, and and the glitch remains until I actually go to the address bar and hit enter. Still don't know how to fix it though.
  8. When I use google chrome I have a strange glitch with my nav bar which was made with CSS. Usually it displays fine, but occasionally it looks like this: http://dl.dropbox.com/u/25213133/Wrong%20subnav.PNGAfter refreshing the page it goes back to normal.Has anyone ever had a similar problem or know how to fix this one? The biggest problem is I can't debug it if I don't know how to make the glitch occur...
  9. This question isn't about writing ASP.NET but about accessing a page created by it. I've asked this question on many python forums and mailing lists but no one could answer my question so I think the problem might be a fundamental concept with ASP.NET. My program connects to a website where students can login to check their school grades. My program is written in python and is intended to login for the user and check for changes in their grades. I am able to login to the main page. However, when I switch over to the grades page, the website displays the session expired page. I checked the cook
  10. Thanks, it works. But I sent the data to a php script by using window.location.href=site.com/script.php?variable=string. Is there a better way to send data using javascript? Preferably using post so the data isn't in the URL.
  11. Well I tried this out,xmlDoc.getElementsByTagName("days")[0].childNodes[0].nodeValue = document.getElementsByName("days1")[0].value; alert(xmlDoc.getElementsByTagName("days")[0].childNodes[0].nodeValue); And it output the correct value, but it didn't write the change to the xml file. That's what I need to do, have a permanent change to the file.
  12. Hi, I just learned XML and I have to say its very cool and very useful. I was wondering if there built in javascript functions to edit the text between the tags. Just like you can use xmlDoc.getElementsByTagName("tag")[0].childNodes[0].nodeValue to get the value of the text node, is there a function to set it?
  13. Thanks, that fixed it. Although I didn't include the file_put_contents() because the server gave an undefined function error. I think its the PHP version running on the server, but its no big deal.
  14. I have the following code for a hit counter:<?php$hits = file_get_contents("hits.txt"); echo $hits;$hits = $hits + 1; echo $hits;$handle = fopen("hits.txt","w");fwrite($handle, $hits); fclose($handle); ?>It gives no errors, but the number of hits doesn't increase. It echoes the same number each time. What's the problem?
  15. Thanks, that worked perfectly. And I guess its not just older versions because I'm testing in IE 8 and IE9.What is standards-compliant mode? Where I can I learn more about the different doctypes?
×
×
  • Create New...