Jump to content

cssfreakie

Staff Alumni
  • Posts

    1,674
  • Joined

  • Last visited

About cssfreakie

Profile Information

  • Gender
    Male
  • Location
    North Pole, left to the second polar bear that says howdy

cssfreakie's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  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. Dont forget your Doctype
  7. 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 */ }
  8. 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)
  9. 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']}'
  10. 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 ...
  11. 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.
  12. 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?
  13. have a look at the tutorial here at php freaks named "simple database handling" or buy a decent book.
  14. 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'])
  15. 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>
×
×
  • 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.