Jump to content

Ingolme

Moderator
  • Posts

    14,897
  • Joined

  • Last visited

  • Days Won

    176

Everything posted by Ingolme

  1. All you need to do is change the selector to target the form instead of the table. Instead of #myunique_signup_form table just use #myunique_signup_form
  2. It's not repeating because the container stops there. You gave the container a fixed width but allowed the full page to be wider than that. The solution is to make sure that there are no elements that are wider than the container's width.
  3. Ingolme

    PHP browser close

    You only need one session, you store everything in the session variable. Both login information and other data can be stored in the $_SESSION array.As soon as you close your browser, everything that was in the $_SESSION array disappears.
  4. You should be able to tell if there is a popup blocker by testing for your newly created window. var x = window.open( ... );if(!x) { alert("Popup window was blocked.");}
  5. You can put it anywhere, as long as you put the right path in the href attribute of the <link> element.
  6. Have you checked the browser's error console?
  7. The example given by smiles should work well with variables. I don't think that Don E's method works in all browsers.
  8. Ingolme

    Hyperlink text

    Maybe the style is being overridden by something else. It would be convenient to find out where, but if you don't want to, you can just add an !important value to the property: a.lab { color: white !important; }
  9. No, a <div> element can never be inside an <a> element under any circumstance. Neither can a variety of elements, such as <p> or <h1>.It is valid to put a <span> inside the <a>. You can style the <span> elements as blocks if you want to.
  10. Ingolme

    Hyperlink text

    You use a . and not a : to select class names. The element that has the top-label class is the <span>, not the <a> so you have to target a span with that class. I don't know why there's an "li" in your selector, I don't see any <li> tags in your code. All those <span> elements look reduntant as well. Since the <a> element has a class called "lab" you can target it like that. a.lab { color: white; }
  11. If you want to redirect the user somewhere, use a header() function. But I'm not exactly sure what your goal is.
  12. Hmm... You would need to join the tables. I think something like this might work: SELECT posts.field1, posts.field2 FROM posts, comment WHERE comment.parent = post.id ORDER BY comment.date
  13. I can't see any difficulty in checking for a cookie: if(isset($_COOKIE['something'])) { $cookievalue = $_COOKIE['something'];} else { $cookievalue = 'value'; setcookie( 'something', $cookievalue, ... ... );} // The variable $cookievalue can now be used anywhere in the page
  14. += is a shorthand operator, it represents adding a value to a variable and assigning the result to itself.$tax += 4 is equivalent to $tax = $tax + 4 You'll have to look at the documentation for printf() for an explanation of the parameters. The format is explained properly in the sprintf() reference page.
  15. Ingolme

    Tables

    You're going to need to build a system to manage the data using a server-side language. The most popular language is PHP but there are others. You can read about PHP at the W3Schools PHP tutorial.
  16. PHP has a sort() method with which you don't need to use a loop. You have to determine by which criteria you want to sort the array. If the array's data was obtained from a database, it would be better to sort it using the SQL query.
  17. Internet Explorer 7 and 8 support HTML 5 tags if you use a bit of Javascript to create an element, and use CSS to give them a default block style. The problem I mentioned is here and it's exactly what the validator is referring to. You have two <div> elements inside an <a> element. <div id="logo" class="shadow twistLL paper"><a href="http://www.lovespreading.co.uk"> <div id="logo-pinl" class="pin"></div> <div id="logo-pinr" class="pin"></div>
  18. Ingolme

    PHP browser close

    You create sessions for data you want to store temporarily while a user is browsing the website.Cookies are for longer term data storage. Data that you want to keep for more than one day. PHP's session engine does use cookies internally, but it can work without it.
  19. Ingolme

    PHP browser close

    On a website that doesn't use cookies, a user is logged out as soon as they close the browser. They don't need to click on any links. Sessions can be used for more purposes than login forms. Sessions are used to remember any information that needs to be used across different pages.
  20. Ingolme

    PHP browser close

    They may have that information stored in a session. Sessions get destroyed as soon as the browser is closed.
  21. It sounds like you might have error displaying off.Put this at the beginning of the page: ini_set('display_errors', 1);error_reporting(E_ALL);
  22. First of all, you should be checking whether the query worked or not and find out why using mysql_error(). $query = "insert into test(username,password)values('$userName','$password')";$res = mysql_query($query);if(!$res) { echo mysql_error();} else { header('location:success_register.php');} On a side note, MD5 is considered insufficient protection for passwords today.
  23. Ingolme

    PHP browser close

    No. Even if Javascript is enabled, detecting the browser closing is not very reliable. You must design your system to work in a way that doesn't require this detection. A lot of systems have a time-out.
  24. You shouldn't need to have + '\n' +, you can add the \n right into the string. alert("Line 1.\nLine 2."); The only reason you need single-quotes instead of double-quotes is because double-quotes are being used as delimiters for the attribute's value.Hopefully the code parser will color the following codes right so you can get an idea: var str1 = "Quotation marks "inside" quotation marks";var str2 = 'Double-quotes "inside" single-quotes';var str3 = "Single-quotes 'inside' double-quotes";var str4 = "Double-quotes \"escaped\" inside double-quotes";
×
×
  • Create New...