Jump to content

cssfreakie

Staff Alumni
  • Posts

    1,674
  • Joined

  • Last visited

Posts posted by cssfreakie

  1. (I assume it is fairly hard to hack?)

    i have no idea what you mean with that. You mean hacking as in sneaky people that alter it and screw up the result? No that is as easy as changing hidden fields or getting a beer out of the fridge.

     

    if you mean to hack your code to add this attribute, that is easy too, just change your code a little.

     

    Keep in mind, you know what you expect,.. (right?) all you want the end-user to do is add a comment I guess and not change the title. So when you query the database don't use the value of the hidden/disabled fields. easy not??

     

    It all boils down to logic. What do you expect from your user? SO what fields do you allow or accept the values from? Style your form the way you want. There is no best (or better) way apart from some design and accessibility standards. Just have some guts and go for it. and ask your end-user for feed back or allow them to easily provide it to you. Listen to the customer...

  2. Well, what do you think is the best way?

     

    well that's like asking what is better coffee or thee? It depends on what you want and how you want it to look. There is no best way as far I can see. Just do something that makes sense to you and your end-users.

     

    Try that disabled attribute out and see if you like it.

     

    As far as using (isset) check the manual, for the explanation given. In a nutshell you check if a variable is set. You do that because if you don't check that and you echo out a variable that is not set you get an error.

     

    $setvariable = 'blablabla';
    
    echo $notsetvariable;  // will produce an error
    echo $setvariable;
    

  3. Just for reference, how "hidden" is "hidden"?

     

    I thought it can be seen if you do "Page View" in the HTML?

     

    Not sure what you are exactly trying to do here, but "hidden" is indeed view-able in the source. (and can be altered so can not be trusted as is)

    If you want to display a title but you don't want anyone to alter it. Just display it the way you want.

    Btw instead of using hidden you might want to use the following:

     

    <form action="" method="post">
                    <input type="text" name="monkeys" value="gorilla" disabled="disabled"/>
                    <input type="text" name="color" value="brown" />
                </form>
    

     

    so give this a try (disabled="disabled")

  4. <input class="button" type="button" value="Hide Menu"  onclick="setTable('sidemenu');return true">

     

    you can't do that, your using single quotes around the string you echo. If you use them inside that string, you need to escape the single quotes.  Like so:

    echo 'lalalala this is a string isn\'t it?';

     

    So your code should be:

    onclick="setTable(\'sidemenu\');return true">

     

  5. I am trying to set my gradient in FireFox, but I can't get it quite right! From the body area, it's supposed to go from red to white, then it's supposed to go from white to the blue where the little logos start, and end before the bottom nav area, although on Safari I couldn't get the nav bar outside of the blue, so if you look in Safari you can see what I'm trying to achieve. After the logos, it's supposed to go straight to white. Can anyone help me get my CSS right? Here is what I have:

     

     

    body {
       background: #ffffff;
       background: -moz-linear-gradient(top, white 16.45%, #546a93 10%, #de4d20 20%, white 80%, #566991 85%, white 85%);
       background: -webkit-gradient(linear, 0 218, 0 100%, from(white), color-stop(0%, #546a93), color-stop(4%, #de4d20), color-stop(30%, white), color-stop(70%, white), color-stop(90%, #566991), color-stop(90%, white), to(white));
    }

     

     

    The site can be viewed at: http://lhdairconditioning.com.au/

     

     

    Any help would be greatly appreciated!

     

    try:

    background: -moz-linear-gradient(center top , white 16.45%, #fff 10%, #DE4D20 20%, white 80%, #566991 85%, white 85%) repeat scroll 0 0 transparent
    

     

    just a small thing, don't use 3 different colors in your gradient it's 2011  :P

  6. Hey Guys,

     

    Please look at the attached image. I have a div call left and right panel. When I hide the right panel using JS which I've created, I want to center the left panel in the wrapper like shown. I've tried a few different options using pargin auto and % scaling but not which much look.

    It would indeed be useful if you would actually post code, instead of asking us to write the code for you.

    If you know how to set the css withjavascript all you have to do is to remove the float on the element and add margin:0 auto; ones you make the other dissapear.

  7. I've got 5.1 and it's just this page that isn't working. Any other website is working perfectly fine.

     

    (I'll apply the fix you've said, but obviously if it's working for you already I wonder what is wrong on my end :s)

    I have only 1 idea left: maybe the order of you pseudo classes are incorrect but that seldom causes problems in modern browsers.

    might want to have a look here.

    (5.11.3 The dynamic pseudo-classes: :hover, :active, and :focus)

    http://www.w3.org/TR/CSS2/selector.html#pseudo-class-selectors

    especially the part that says:

    Note that the A:hover must be placed after the A:link and A:visited rules, since otherwise the cascading rules will hide the 'color' property of the A:hover rule. Similarly, because A:active is placed after A:hover, the active color (lime) will apply when the user both activates and hovers over the A element.

     

    -edit: I highly doubt the last part though because It is more aimed at links

  8. to prevent a "Yes it does"," no it doesn't" - discussion

     

    I tried this in safari 5.03 and it worked.

     

    But I added as you would expect atleast a body and  html tag and a doctype.

    If you want more help , maybe place a link to an online version, so we can have a look. (maybe some other scripts are screwing things up)

  9. although the list I ones provided (not from 1998 but with the same history  ;) ) was not claimed or aimed to be extensive (in fact i stated the opposite) nor were the points all aimed at just rendering problems. They also include some advice  aimed at (bad) stuff I saw (see) here pretty often. Like the use of tables for the sole purpose of making a template. Although that might not be the problem someone has, if I see it or any other bad practices, I tell them. And since those stick out, it saves time mentioning that stuff over and over again. And like  most others I rather tell more ones I spot something (odd) than just solve the problem.  (same is for the php forum, to prevent sql injections or other nasty stuff)

     

    And so, I like the idea to give a small guide how to post a question as you proposed... (although quite some points are already stated in the forum guidelines) besides a short checklist of better practices on the subject.

     

    Now I know there is and always will be a debate on what is best. conditional comments vs css hacks vs conditional IE classes? full resets.css or more minimalistic ones. But ones you played around with it and practised enough, you will indeed notice that a full reset.css might be overkill, so you make your own or use one that suits your needs. But to start of as a newbie a full reset  forces to set styles to pretty much everything so it makes you learn the whole thing (for my point of view).

     

    So in a nutshell yes a good Idea to have 2 things,

    - a guideline for posting for as far as it is not already mentioned in the general guidelines.

    - A checklist of 'some' better practices since 300 a.d.  :examine:  (meant for newbies and anyone that blames IE for there own incompetence and lack of reading)

     

     

     

  10. Does that mean that the -webkit / -moz are not conditional although they do the same thing? 

     

    Well in a way they are.

    ...it's slightly shocking to think that IE would be allowed to be weak in areas that it's competition are not?!?

    it's not shocking at all, each browser has it's own things and if you want you can make your own. The good thing is if you would develop for firefox (properly) the only thing you have to tweak is for ie 6 7 and sometimes 8 so in that sense, it doesn't matter that it is only supported by IE.

     

    P.s. if your topics are solved mark them, saves others time reading through. ;)

  11. well if you don't want to allow iframes. make sure the input of your users is as expected.

     

    I assume you have a some sort of a form where one can insert a link (and apparently also an iframe).

    What i would do is make an input field, and validate if the value is as expected. In this case is it a valid URL if not tell them.

    for instance as follows:

     

    <?php
    $string = $_POST['url']; // value comes from form
    
    if(filter_var($string, FILTER_VALIDATE_URL)){
        echo 'correct'; // use it
    }else{
        echo 'incorrect';
    }
    
    ?>
    

     

    As for outputting the url you could use htmlspecialchars() to prevent that the current iframes are being loaded or other sneaky things happen. (mostly to deal with stuff that was not ones validated )

    \
    <?php
    echo htmlspecialchars($url);
    
    ?>
    

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.