Jump to content


Staff Alumni
  • Posts

  • Joined

  • Last visited

Everything posted by cssfreakie

  1. Look at the logic posted here: http://jsfiddle.net/kizu/4RPFa/4570/
  2. I'm glad you provided the link, all the code posted above is not relevant. on line 29730 of your stylesheet you declare the following: .download-tooltip { background-color: #fff; border: 1px solid #ddd; border-radius: 6px; color: inherit; cursor: inherit; display: block; margin-left: auto; margin-right: auto; margin-top: 10px; padding: 12px 16px; text-align: center; text-decoration: inherit; width: 500px; /* this is not dynamic 90% width can be nice */ } Note the comment made. I noticed when inspecting your site that most styles are overwriten; not once but around 20 times. This is an indication your stylesheet is redundant. Your stylesheet has more than 30K lines. Im not sure if this project is aiming to be a high traffic website but if so, try to lower the css to around 3k lines.
  3. Since you're already using jquery have a look at backstretch Dont forget to update your version of jquery!
  4. Have a look at jquery-UI's accordion no need to reinvent this when you are about to pull your hair out. Than you also dont need the images which we dont have so it harder for us to test.
  5. This is not something for CSS, I'm afraid. The pdf you provided clearly shows the text starts in a new collumn when it doesnt fit. You could make a structure in html and css where you have positions like #text1 #text2 #text3 and #imageplaceholder (some CMS like Joomla call those positions modules). Than Find out how much words fit in each position and use php to split the text up in 3 collumns. You can read how to do that here: http://stackoverflow.com/questions/79960/how-to-truncate-a-string-in-php-to-the-word-closest-to-a-certain-number-of-chara Did you read the Pinned topic btw?
  6. In addition to Kicken's respons, you might want to have a look at a closely related approach as seen in Twitter's Bootstrap with classes like (.col-xs- .col-sm- .col-md- .col-lg-). This is another approach assuming you are able to add classes in the html (which works in combination with media queries). Almost the same, but with additional approach. You can see both approaches here. Notice though they use LESS, which might confuse at first. LESS is not needed in anyway though. Normal mediaqueries look like this: /* Portrait tablet to landscape and desktop */ @media (min-width: 768px) and (max-width: 979px) { /* place normal css here */ } /* Landscape phone to portrait tablet */ @media (max-width: 767px) { /* place normal css here */ .example {font-weight: normal;} } /* Landscape phones and down */ @media (max-width: 480px) { /* place normal css here */ }
  7. Hi there, It's rather hard to tell how to fix this because it could also depent on your version of Chrome. Google is said to have fixed font-rendering in version 37 (summer 2014). See bug-report. You might want to check out this blog. The bottom solution can give good results (webkit-text-stroke)
  8. Good to hear! Off-topic: make sure you do not accept user input that easily into your sql-queries. It's a vulnerability now WHERE Countries.CID = '{$_POST['country']}'
  9. i made a spelling error in the else{} part else{ $link = '<a href="login.php">Logout</a>'; $welcome = 'guest'; } should be else{ $link = '<a href="login.php">Login/a>'; $welcome = 'guest'; } The logic stays the same though ...
  10. I recommend you still spend a tiny bit more time on the script given. Since the idea you came up with is a bit odd (assuming you looked at the script given). if you look at what you came up with: <?php if(!empty($_SESSION['LoggedIn']) && !empty($_SESSION['Username'])) { $link1 = '<a href="login.php">Member</a>'; $link = '<a href="logout.php">Logout</a>'; ?> You assign 2 variables here, while the whole trick of the us of an if statement is that we can switch between cases. (condition true, or else) Now look at what is given to you: <?php // ## CHECK USER LOGGED IN STATUS ## // This piece of code just checks if the user got logged in. if(isset ($_SESSION['Username']) && isset($_SESSION['LoggedIn']) && $_SESSION['LoggedIn']=== 1){ $link = '<a href="logout.php">Logout</a>'; $welcome = $_SESSION['Username']; // anything you want to hide from normal user you can place or set inside here. }else{ $link = '<a href="login.php">Logout</a>'; $welcome = 'guest'; } ?> This if statement assigns a different value to only 1 $link variable. For the case the user is logged in and incase the user is not logged in. So that is exactly what you need. Switch cases depending on the logged in status. So, there is no need to change that menu (<ul>). you just echo $link inside there and the logic above will determine whether it should say login or logout. Sorry but I have a hard time understanding why you moved on with that old script. I don't see the logic in that.
  11. well, the problem is that most modern browsers disabled status bar message altering by default (there is a good reason for that). So that part will fail. But you can make an effect that if someone click the tr it will work as a link, but without that status bar message. you could add a title attribute instead. as for setting dimensions to a table row yes you can did you try it?
  12. have a look at the tutorial here at php freaks named "simple database handling" or buy a decent book.
  13. p.s. this line: md5(mysql_real_escape_string($_POST['password'])) makes no sense. the following is sufficient since md5 already transforms it into a fixed length hash without any dangerous characters (as far as I know): md5($_POST['password'])
  14. try the following , and read the comments made in the code. (btw I find those meta redirects pretty unfriendly) Hope the following makes sense <?php // ## CHECK IF SOMEONE PRESSED SUBMIT AND GAVE CREDENTIALS // if not there is no need to run this code if(isset($_POST['submit']) //first check if someone pressed submit otherwise it's a waste && !empty($_POST['username']) && !empty($_POST['password'])){ // open // set variables $username = mysql_real_escape_string($_POST['username']); $password = md5(mysql_real_escape_string($_POST['password'])); $checklogin = mysql_query("SELECT * FROM users WHERE Username = '".$username."' AND Password = '".$password."'"); $message = ''; // query database if(mysql_num_rows($checklogin) == 1) { $row = mysql_fetch_array($checklogin); $email = $row['EmailAddress']; $_SESSION['Username'] = $username; $_SESSION['EmailAddress'] = $email; $_SESSION['LoggedIn'] = 1; $message .= "<h1>Success</h1>"; // instead of echoing out we give it to a variable to use it later $message .= "<p>We are now redirecting you to the member area.</p>"; $message .= "<meta http-equiv='refresh' content='=2;member.php' />"; } else { $message .= "<h1>Error</h1>"; $message .= "<p>Sorry, your account could not be found. Please <a href=\"login.php\">click here to try again</a>.</p>"; } }// close // ## CHECK USER LOGGED IN STATUS ## // This piece of code just checks if the user got logged in. if(isset ($_SESSION['Username']) && isset($_SESSION['LoggedIn']) && $_SESSION['LoggedIn']=== 1){ $link = '<a href="logout.php">Logout</a>'; $welcome = $_SESSION['Username']; // anything you want to hide from normal user you can place or set inside here. }else{ $link = '<a href="login.php">Logout</a>'; $welcome = 'guest'; } ?> <body> <h1>welcome <?php echo $welcome;?></h1> <div class="message"><?php echo $message; ?></div> <!---- ## here follows the menu ## -------> <ul id="menu"> <li id="active"><a href="index.html">Home</a></li> <li><a href="About.html">About</a></li> <li><a href="Contact.php">Contact</a></li> <li class="end"><?php echo $link; ?></li> </ul> <!--- you probably have some form here --> </body>
  15. I would post that outside your other if statement because i assume it depends on a submit button. But any place fits as long as you see why and what is happening. in addition to what the person above me posted, i would add an additional check to see if the value of $_SESSION['LogedIn'] is as expected. Just to prevent than someone gains access despite the value (because that if statement only checks if the variable is set not it's value). What if a different script sets the value to 0 to lock the user down. That would have no effect. <?php if(isset ($_SESSION['Username']) && isset($_SESSION['LoggedIn']) && $_SESSION['LoggedIn']=== 1){ $link = '<a href="logout.php">Logout</a>'; }else{ $link = '<a href="login.php">Logout</a>'; } ?> P.s. before you launch anything make sure you read some security tutorials. Cisco will like that
  16. or just do: <?php $time1 = strtotime('2010-12-13 15:26:56'); $time2 = strtotime('2011-12-13 15:26:56'); echo $result = ($time2 - $time1)/3600; //60seconds * 60min ?>
  17. well the trick of any forum is that you show some effort so we can help with the code you produced. To give a head start. the flavours you have are either login.php or logout.php Now I assume that that tutorial showed you a way to find out wether someone is logged in or not right? Because that would be the main prupose of such a system. So you probably have some condition already. All you need to do is add this condition to an if clause. for instance <?php if(condition){ // is the user logged in? $link = '<a href="logout.php">Logout</a>'; }else{ // if not logged in $link = '<a href="login.php">Login</a>'; } ?> ...... <li class="end"><?php echo $link; ?></li> Note, the above "condition" is the part where you come in. How does your script check if someone is logged in?
  18. on this exact same page there is a pretty big topic about pretty much this. have a look there: http://www.phpfreaks.com/forums/index.php?topic=343461.0
  19. I marked it solved, because this is just works. a reply would be nice....
  20. it would be even easier (apart from the background which you have to set yourself) just add: <input class="button" type="submit" name="submit" value="submit values" tabindex="3"/> than in css you could do something like: .button{ display:inline-block; width:50px; height:50px; background: url(http://i55.tinypic.com/dzw1zn.png) no-repeat; cursor:pointer; /* remove default text */ line-height: 0; font-size: 0; border:0; } By using javascript for something as vital as submitting a form, your limiting your audience. P.s. You might want to - instead of asking how- just try stuff, and post it if it doesn't work that way you learn by trying
  21. The suggestion dropdown you see at for instance google.com, is done with ajax. an example can be found here: http://jqueryui.com/demos/autocomplete/
  22. This topic has been moved to PHP Coding Help. Because this is a php question http://www.phpfreaks.com/forums/index.php?topic=344167.0
  23. although this works with newer browsers, IE8 and down wont understand the tab index on an image. manual says: The following elements support the tabindex attribute: A, AREA, BUTTON, INPUT, OBJECT, SELECT, and TEXTAREA. Instead you could use an anchor element around the image. <a href="" tabindex="3"><img alt="" src="images/quote_button.png" OnMouseOver="this.style.cursor='pointer';" onclick="document.forms[0].submit()" /></a> Or even better just use a submit button or an anchor element (they can have background images...) and result is less redundant. p.s. I added an alt= tag for your image, you forgot it i assume..
  24. Hi shaunie, The easiest way with the setup you have is to use an image on the container div (#content) and remove the background color and border of #sidebar. so your css could look like this. #content { background: url("http://i51.tinypic.com/11qpojq.png") repeat-y; /* this is an image of 170px with your same colors */ clear: both; float: left; height: 100%; } #content #sidebar { /* removed the color and background */ float: left; min-height: 400px; padding: 10px; width: 160px; } I quickly made an image that does the same as that background color and border, but allows you to increase the height of your page to whatever value you like. you can find/use/download it here: http://i51.tinypic.com/11qpojq.png good luck! cssfreakie
  • 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.