• Web Development Questions That Don't Need Their Own Thread v2
    3,079 replies, posted
Hey, by any change does windows 7 not have the "." and ".." directory structure, just because it's not showing in my FTP(filezilla) Server or do I need to config it to do so, just because I can't find anything about it on there wiki?
[php] function bot($ua){ $blocked_ua = array("Baiduspider","Googlebot","Disqus","Mediapartners","Presto","Yahoo","msnbot"); foreach($blocked_ua as $key){ $pos = strpos($ua, $key); if ($pos !== false) { return true; } } return false; } [/php] Would this be the best way to search for web crawlers?
[QUOTE=hacksore;31774917][php] function bot($ua){ $blocked_ua = array("Baiduspider","Googlebot","Disqus","Mediapartners","Presto","Yahoo","msnbot"); foreach($blocked_ua as $key){ $pos = strpos($ua, $key); if ($pos !== false) { return true; } } return false; } [/php] Would this be the best way to search for web crawlers?[/QUOTE] I'd say yes.
Care to elaborate TehWhale.
Asked this in WAYWO thread, thought this is more appropriate. [quote]What is the best way of showing product info on a page? Let's just say i have a sql database with my products in each row, and different information (cost, and other factors) in separate columns. How do i display all that info dynamically on separate pages? And how to best implement a sorting system? I Just want to be pointed at some relevant tutorials, can't seem to get anything working.[/quote] Something like this [img]http://img148.imageshack.us/img148/6259/autok.png[/img]
[code] # all cars Car.all # first 20 cars, no order Car.limit 20 # first 20 cars by date of post Car.order("created_at DESC").limit 20 [/code]
[QUOTE=pinkfreud;31781662][code] # all cars Car.all # first 20 cars, no order Car.limit 20 # first 20 cars by date of post Car.order("created_at DESC").limit 20 [/code][/QUOTE] You sure he's using Ruby? [editline]17th August 2011[/editline] Oh wait, 'the best way'. I see what you did there.
I don't get it... So i should do it in ruby on rails?
Anyone have any idea what font is used [url=http://www.ea.com/mirrors-edge]here[/url]? or a font that looks pretty similar
[url]https://twitter.com/#!/html5douche[/url] :v:
[QUOTE=Adzter;31783507]Anyone have any idea what font is used [url=http://www.ea.com/mirrors-edge]here[/url]? or a font that looks pretty similar[/QUOTE] [url]http://on-mirrors-edge.com/forums/viewtopic.php?id=1731[/url] google is your friend
[QUOTE=Alcapwne;31783884][url]http://on-mirrors-edge.com/forums/viewtopic.php?id=1731[/url] google is your friend[/QUOTE] Thanks
I'm having a really weird problem. Sometimes when loading a site that I'm making, the navigation links decide to stack themselves vertically, rather than horizontally. They look like the first image below, when they're meant to look like the second. This only happens now-and-again, and it goes back to normal as soon as I refresh the page. Any idea what could be causing this? [quote][img]http://i.imgur.com/EjQs5.png[/img] [img]http://i.imgur.com/Fqb10.png[/img][/quote] Oh and it only seems to happen on webkit browsers. [editline]17th August 2011[/editline] Fixed it, the container for the links was pixel perfect, I made it a bit bigger and it no longer happens, odd.
Hello, I'm new to HTML and CSS and the likes, and I'm having trouble with something. Basically, look at this page: [url]http://testspace.thecubeserver.com/theteam.php[/url] Now, I need the sidebar bit to extend right to the bottom, to stop the other elements falling under it and moving to the left. I have the sidebar's height set to 100% but for some reason it only seems to fill half of it despite the fact the content AND the sidebar is in an overall <div> called pagecontainer. I don't understand why the pagecontainer div doesn't expand to fit the content (pictures and such) and thus the bar only extends partway. I have heard various methods and the one that seems fine for me is the clear:both style for a div inserted somewhere, but I can't figure out where Oh and in case you're wondering why it's .php, it's just because I had a php element which I took out Thanks for any help!
[QUOTE=Trumple;31788460]Hello, I'm new to HTML and CSS and the likes, and I'm having trouble with something. Basically, look at this page: [url]http://testspace.thecubeserver.com/theteam.php[/url] Now, I need the sidebar bit to extend right to the bottom, to stop the other elements falling under it and moving to the left. I have the sidebar's height set to 100% but for some reason it only seems to fill half of it despite the fact the content AND the sidebar is in an overall <div> called pagecontainer. I don't understand why the pagecontainer div doesn't expand to fit the content (pictures and such) and thus the bar only extends partway. I have heard various methods and the one that seems fine for me is the clear:both style for a div inserted somewhere, but I can't figure out where Oh and in case you're wondering why it's .php, it's just because I had a php element which I took out Thanks for any help![/QUOTE] I'd suggest grouping the content on the right into one <div> and changing the display on both the sidebar and that div to inline-block or, at least, that's how I'd do it
[QUOTE=hacksore;31774917][php] function bot($ua){ $blocked_ua = array("Baiduspider","Googlebot","Disqus","Mediapartners","Presto","Yahoo","msnbot"); foreach($blocked_ua as $key){ $pos = strpos($ua, $key); if ($pos !== false) { return true; } } return false; } [/php] Would this be the best way to search for web crawlers?[/QUOTE] For some reason i thought of something like this: [php] function bot($ua){ return preg_match("(Baiduspider|Googlebot|Disqus|Mediapartners|Presto|Yahoo|msnbot)",$ua); } [/php] I have no idea if it will work though.
[QUOTE=Ac!dL3ak;31790101]I'd suggest grouping the content on the right into one <div> and changing the display on both the sidebar and that div to inline-block or, at least, that's how I'd do it[/QUOTE] I'm still a bit confused by that Sorry :v:
[QUOTE=Trumple;31793447]I'm still a bit confused by that Sorry :v:[/QUOTE] Put everything that would have "float:right" into one div that has the property "float:right". [code] <style> #right-wrap { float:right } </style> <div id="right-wrap"> <div class="right">...</div> <div style="clear: top;"></div> <div class="rightteam">...</div> </div> [/code]
[QUOTE=R1Z3;31793572]Put everything that would have "float:right" into one div that has the property "float:right". [code] <style> #right-wrap { float:right } </style> <div id="right-wrap"> <div class="right">...</div> <div style="clear: top;"></div> <div class="rightteam">...</div> </div> [/code][/QUOTE] Ah I see Thanks for the help guys
I'm having some trouble checking whether a PDO query returns any rows. Here's what I'm doing: [php] $userq = $dbh->prepare("SELECT username, password FROM users WHERE username = ?"); $userq->bindParam(1, $username); $userq->execute(); $result = $userq->fetch(PDO::FETCH_ASSOC); if($userq->rowCount = 0){ $_SESSION['error1'] = "User does not exist."; header("Location: li.php"); exit(); } -some more if statements- [/php] However, it seems to skip the above if statement, which suggests $userq->rowCount never = 0 What am I doing wrong? thanks
[QUOTE=Alcapwne;31801122]I'm having some trouble checking whether a PDO query returns any rows. Here's what I'm doing: [php] $userq = $dbh->prepare("SELECT username, password FROM users WHERE username = ?"); $userq->bindParam(1, $username); $userq->execute(); $result = $userq->fetch(PDO::FETCH_ASSOC); if($userq->rowCount = 0){ $_SESSION['error1'] = "User does not exist."; header("Location: li.php"); exit(); } -some more if statements- [/php] However, it seems to skip the above if statement, which suggests $userq->rowCount never = 0 What am I doing wrong? thanks[/QUOTE] Does this work? [php] $userq = $dbh->prepare("SELECT username, password FROM users WHERE username = ?"); $userq->bindParam(1, $username); $userq->execute(); $result = $userq->fetch(PDO::FETCH_ASSOC); if($userq->rowCount() == 0){ blah } [/php]
[QUOTE=SepticOsbert;31803121]Does this work? [php] $userq = $dbh->prepare("SELECT username, password FROM users WHERE username = ?"); $userq->bindParam(1, $username); $userq->execute(); $result = $userq->fetch(PDO::FETCH_ASSOC); if($userq->rowCount() == 0){ blah } [/php][/QUOTE] That should work, you needed the parentheses.
[QUOTE=SepticOsbert;31803121]Does this work? [php] $userq = $dbh->prepare("SELECT username, password FROM users WHERE username = ?"); $userq->bindParam(1, $username); $userq->execute(); $result = $userq->fetch(PDO::FETCH_ASSOC); if($userq->rowCount() == 0){ blah } [/php][/QUOTE] Ah yeah that works, I needed the brackets and the == rather than = [editline]18th August 2011[/editline] Me again! I've tried some non-standard PHP syntax which seems to have gone wrong somewhere: [php] <?php if($_SESSION['user'] != "yes"): ?> <form id="li" action="login.php" method="POST"> <h4>Username:</h4> <input id="username" name="username" type="text" class="tb"><br> <br><br> <h4>Password:</h4> <input id="password" name="password" type="password" class="tb"><br> <br><br> <input type="submit" class="button" name="li" id="li"> </form> <?php endif; ?> <?php if($_SESSION['user'] == "yes"): ?> <p>You are already logged in as <?php echo $_SESSION['username']; ?></p> <h4>Log out?</h4> <?php endif; ?> [/php] I've done something wrong, because $_SESSION['user'] does = "yes" but it's displaying the wrong information on the page given that. Any ideas? Thanks
So can anyone give me some pointers for making that product list i mentioned earlier? Do i use Ruby for that? I looked at some ruby information and it seems very straight forward.
[QUOTE=Alcapwne;31803386]Ah yeah that works, I needed the brackets and the == rather than = [editline]18th August 2011[/editline] Me again! I've tried some non-standard PHP syntax which seems to have gone wrong somewhere: [php] <?php if($_SESSION['user'] != "yes"): ?> <form id="li" action="login.php" method="POST"> <h4>Username:</h4> <input id="username" name="username" type="text" class="tb"><br> <br><br> <h4>Password:</h4> <input id="password" name="password" type="password" class="tb"><br> <br><br> <input type="submit" class="button" name="li" id="li"> </form> <?php endif; ?> <?php if($_SESSION['user'] == "yes"): ?> <p>You are already logged in as <?php echo $_SESSION['username']; ?></p> <h4>Log out?</h4> <?php endif; ?> [/php] I've done something wrong, because $_SESSION['user'] does = "yes" but it's displaying the wrong information on the page given that. Any ideas? Thanks[/QUOTE] A quick tip, if you're using values of "yes" and "no", you should just use true/false. Try using this approach, see if it fixes anything (it might), if not, try dumping the value of $_SESSION['user']. [editline]18th August 2011[/editline] [QUOTE=LiLBliNg;31804457]So can anyone give me some pointers for making that product list i mentioned earlier? Do i use Ruby for that? I looked at some ruby information and it seems very straight forward.[/QUOTE] Ruby is a really nice language, you'll find most people here would recommend learning it.
I don't think this deserves a thread, so hopefully a post will suffice in helping me. This is probably asked a lot, but I don't really want to go through all those pages. So I'm trying to get into HTML coding (the first coding language I've even attempted to learn), I've been following HTMLDog.com tutorials, and have currently completed up to the intermediate stage. I find my biggest problem so far is is not not understanding, but rather not remembering what everything is, or does sometimes. I figure posting here might allow for me to get some hints and tips, using HTMLDog.com was already a suggestion from here I found in another thread. Anyway, does anyone have any tips on how to memorize the language, I know repetition (i.e. practise) is more often than not the best way to learn something, but does anyone have anything else that might be able to aid me in learning - keeping in mind, at this point I'm not interested in spending any money on books or anything. Also I was wondering, do those of you who have an above-basic understanding on HTML still refer back to books and what-not to remember how to do some things? I should probably also mention a couple of years ago I attempted to get into website coding and design, however I was using Dreamweaver, which to my understanding is despised in the the web-coding community. This time I've been trying to learn legitimately with notepad++ as my main tool, which honestly is proving to be a little difficult so far, but I'm sure I'll get the hang of it. In terms of design I think I'm set, for now at least. I'm probably more skilled creatively than I am anything else.
To be honest only thing you need to remember about HTML is <div class="whatever"></div>. Everything else is CSS.
So, I've got a navbar that, when the window is small enough, looks like: [img]http://i56.tinypic.com/14o52mh.png[/img] But in actuality, if your browser is big enough, looks like: [img]http://i55.tinypic.com/2jcudg0.png[/img] I've been trying to come up with a few solutions for tabs that overflow from their parent, but can't think of anything too great. My favorite idea thus far has been to have two dynamic tabs that appear on the left and right side of the nav bar should there be any overflow on either side with '<' and '>' as their only text. But I have no idea how I'd do this, I use jQuery for a lot of stuff on my site if that helps any. Any ideas?
[QUOTE=Crhem van der B;31806861]To be honest only thing you need to remember about HTML is <div class="whatever"></div>. Everything else is CSS.[/QUOTE] If this is true, then I see no harm in learning the basics of it still, though I'll be sure not focus too much on then if it's not going to be greatly beneficial. Should I try learning some other alternative form of web-coding after, like PHP or something (in addition to CSS of course)?
[QUOTE=phabeZ;31807540]If this is true, then I see no harm in learning the basics of it still, though I'll be sure not focus too much on then if it's not going to be greatly beneficial. Should I try learning some other alternative form of web-coding after, like PHP or something (in addition to CSS of course)?[/QUOTE] Javascript. [editline]18th August 2011[/editline] [QUOTE=NorthernGate;31807288]So, I've got a navbar that, when the window is small enough, looks like: [img]http://i56.tinypic.com/14o52mh.png[/img] But in actuality, if your browser is big enough, looks like: [img]http://i55.tinypic.com/2jcudg0.png[/img] I've been trying to come up with a few solutions for tabs that overflow from their parent, but can't think of anything too great. My favorite idea thus far has been to have two dynamic tabs that appear on the left and right side of the nav bar should there be any overflow on either side with '<' and '>' as their only text. But I have no idea how I'd do this, I use jQuery for a lot of stuff on my site if that helps any. Any ideas?[/QUOTE] Maybe a "More" tab that appears, and shows a drop-down list of all the overflowed tabs.
Sorry, you need to Log In to post a reply to this thread.