Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 24

Thread: I have a new code... now what?

  1. #11
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Quote Originally Posted by Mike
    add an empty title attribute
    Does a lack of title attribute result in a tooltip?
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  2. #12
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Twey
    Does a lack of title attribute result in a tooltip?
    In IE, yes. It will display the content of an alt attribute if there is one, but no title attribute. However, if a title attribute is present (even if empty), it will use that in preference.

    Mike

  3. #13
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Guess who, oh great gods of php (lol)


    I have said before that the code I got in the beginning, and now added the submit= line, works great. the two pass. take the viewer to the different pages, just like I wanted...

    BUT... now I found another problem. I have made a THIRD page, call it an error page, how can I tweak this code to default to this third page when ANYTHING other than the 2 u/n and p/w specified is input?

    does that make sense?

    ...
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  4. #14
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Take this:
    Code:
    if(($_POST['user'] == "john") && ($_POST['pass'] == "travolta")) header("Location: johntravolta.php");
    else if(($_POST['user'] == "john") && ($_POST['pass'] == "cusak")) header("Location: johncusak.php");
    and add this:
    Code:
    else header("Location: wrong.php");
    so you get this:
    Code:
    if(($_POST['user'] == "john") && ($_POST['pass'] == "travolta")) header("Location: johntravolta.php");
    else if(($_POST['user'] == "john") && ($_POST['pass'] == "cusak")) header("Location: johncusak.php");
    else header("Location: wrong.php");
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #15
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Weird, I tried that and it didn't work, I was going to be so proud of myself for doing it on my own finally, but NOOOOOOO... lmao


    I must have left out a { or something, lol.

    But I added the string and it works..

    Thanks once again!
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  6. #16
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Twey
    Code:
    else header("Location: wrong.php");
    It should be noted that the value of the Location header must be an absolute URI. There's no notion of a base URI when dealing with redirection. Some browsers might assume the request URI, but they don't have to; they're being extremely kind.

    Mike

  7. #17
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Oh right.
    It works for every browser I've ever tried it in. I'll bear that in mind.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  8. #18
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Twey
    Oh right.
    It works for every browser I've ever tried it in. I'll bear that in mind.
    Whatever your opinion is when it comes to standards and HTML, conformance should never be sacrificed when it comes to something as core as the underlying transport protocol. Displaying something incorrectly is one thing. Failing to do anything due to a badly-formed request is something else.

    The PHP documentation provides an example for creating absolute URLs in its information regarding the header function.

    As an aside, it's interesting to note that it's not just user agents that may misbehave when a relative URI is used. Someone mentions in the comments that IIS may attempt to follow such a redirect, rather than getting the user agent to do so.

    Mike

  9. #19
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I always try to follow the standards. Hence my bearing it in mind. I was saying that it having worked in every browser I had tried it with was the reason why I'd never noticed this before.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  10. #20
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    HEY, yet another question...

    How hard would it be to take this code and have it come in a pop up box instead of being a page in itself?

    Meaning, right now I have my players clicking a link that takes them to the page where this code is and THEN entering the username and password infor and clicking submit. What would be awesome is if I could have them click the link and a password box appears and when they enter the correct u/n p/w combo they are taken to the next page?

    It would cut out a step and save me some bandwidth. It would also be more asthetically pleasing.

    Eventually I would also like to design this password box to fit my site, i.e. colors fonts titles, etc.

    I am on page 6 of the tutorial too! and learning TONS!

    Thanks for the help!
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •