Everything posted by artisites
-
easiest way to cache php + mysql
I've set up a simple blog, using a php + mysql library that i downloaded. It's a simple setup, i include the connector in each page the database stuff reads in. I'm now thinking if it gets any decent traffic, because it's connecting each time high traffic will cripple the db and cpu. What is the easiest way for me to set up a cache so the files are served more or less static, except for a timed updte or if i force an update? I don;t want to use a cms / blog distro just for the caching facility. I wish to learn myself as I go. Would this be on the apache side, db, or php side? Ideally I'd like to be able to publish out a bunch of html / php files rather than call the db each time.
-
db username and password in php
ok cool, but assuming the rest of the file is secure is it possible for someone to get at those details in the php file? should i home them outwith the public html folder?
-
db username and password in php
I currently have a simple php script to read in blog posts from a mysql database. At the top there is var $host = "localhost"; var $user = ""; var $pass = ""; var $db = ""; then later in the script there are lots of bits like this function getCategories(){ $sql = "SELECT id, name, DATE_FORMAT(date, '".$this->date_format."') as newdate FROM ".$this->table_pre."categories AS categories ORDER BY id"; $items = mysql_query($sql) or die("Database Error: ".mysql_error()); while ($obj = mysql_fetch_object($items)) { $array[$obj->id]['id'] = $obj->id; $array[$obj->id]['name'] = $obj->name; $array[$obj->id]['newdate'] = $obj->newdate; } mysql_free_result($items); return $array; Are there any simple steps i can take to make this a bit safer? Some scripts I've used before use pear library with a db-connect include, I'm just thinking it may be wise to go down this route, but I think it would be quite a task to redo the whole script. Is it safer if I extract the db name and pw to an include outside of the public html root?
-
Background on p / Hx with space in line height
Excellent, thanks!
-
Background on p / Hx with space in line height
Does anyone know of a way to get a background colour on a heading level or paragraph element, and create space in the line heights between the text? See the attached image for an example. When I put a background on an element then space out the line-height, the background is on the whole element.
-
multi browser viewer
Thanks for the suggestion. I am behind a secure environment, with limited access to the internet. This is one of the only options that's been approved for use. I'm not asking for alternative suggestions, I'm asking if anyone's used this software. Cheers for the help though!
-
multi browser viewer
Because I am on XP which is outwith my control, I am in a secure development environment which is outwith my control. I'd love to just fire up some virtual boxes, but I can't. This is not a bedroom setup (I have perfect solutions with normal OS access) but this is in my work. So, back to the question... Has anyone used this software before?
-
multi browser viewer
im testing out multi browser viewer at the moment, and it seems to be workign fairly well! will have to do a lot of checking to see that the browsers are accurate... has anyone used this before? how does it do it? have you found it to be accurate??
-
css gradient on button
great tool! I've also since learned they can be done on the fly with LESS. win!
-
css gradient on button
I need to put a gradient on a button with just CSS, the button should look like this: the second one is easier to see the gradient. It doesn't go from edge to edge, it is more like a fuzzy line through the middle. How would you achieve this with CSS? I've got the rounded corners, text, and shadow sorted I just need to nail the background / gradient.
-
Browser support matrix
I am going to commision a site soon and need to specify a browser support matrix for it. I've used yui a grade as a benchmark in the past, but I understand they're not maintaining this anymore (is this true?) What would you specify for browser support in this position at this time?
-
give div focus when anchor receives focus
Is it possible to give a div focus when it is brought into view with js and css? At the moment my tooltip appears when you mouseover or give an anchor focus. The div that acts as the tooltip isn't read out by a screen reader. I wish to give this div focus when the anchor link receives focus. Is this possible?
-
rewrite tab index for whole page
Yeah that's what I'm planning on doing, the CSS is not an issue. My question relates to the tab order of the page, and why I do reorder the structure of the page how do I keep the tab order the same as the on page visual...
-
rewrite tab index for whole page
Summary I have a mobile site on the way, the structure of the page is header content aside main nav second nav footer This works well with mobile, then when it gets bigger the fluid grid and media queries kick in and reorder the site to look like header main nav second nav - content - aside footer Problem I'm concerned about the tab order of the links on the site when it's in desktop mode. The markup will be structured differently to how it's laid out, so the tab order of the page will make it jump around. Does anyone know if it's possible to change the tab order of everything on a page to run through from top to bottom based on css layout? It's not something I've done before.
-
Sprite css background
Cheers man. Decided just to take the images in question out the sprite, was proving quite difficult!
-
Sprite css background
I use a css sprite to display backgrounds on a fixed width design. Im changing to fluid layout, but because of the background positions the background image goes wonky when the browser resizes. Is it possible to use a css sprite with a fluid grid background, where it resizes eith the layout?
-
Modern Mobile Device Browser Cache
Does anyone have any links to modern mobile web browser cache info. I'm under the impression iphones cache around 25k of data. I'm not sure if this is per request or the total page weight. Eg, if I have 2 stylesheets of 20k on the page, will both be cached, will one, if so the first one, or will none?? As a rule I tend to keep my entire page weight under 25k. Interested to find any evidence newer smartphones can cache a bit more.
-
html / css file manager fro snippets
I'm looking to start my own private boilerplate collection for a few projects im on. For this I shall be reusing regular snippets of code which I wish to comment and maintain in a central location. Does anyone know of any open source (or cheap, paid for) systems that can allow me to manage this boilerplate code? Thanks A
-
html5 attributes
I read an article a while back that outlined some differences with the new html5 spec, which indicated what attributes are no longer required on some tags (eg type on css links). Does this sound familiar to anyone and does anyone have a link to such an article? It was via a smashing mag tweet, and summarised html5 in general. Any help appreciated!
-
add class on click with jquery
Found the toggleClass docs in jquery that's what I was after. Getting adventurous with setting the html on clicks, no doubt I'll be back!
-
add class on click with jquery
I wish to hide certain elements when the user toggles with a list of links. Does anyone know of a resource that shows this in action when the user clicks a link a class is given to the element? I can then hide these elements with a display none.
-
Mobile javascript support
Does anyone have a link to a resource about smartphone js support? I need to build a site to support a web app, but the user has to click "accept terms" before the download link appears. I could probably do this with javascript, but I want to check it will work across devices before I implement it. Is this the easiest way to achieve this?
-
box shadow on all 4 sides
Hi Does anyone know how to apply a box shadow around all 4 corners of the div? I'm using -moz-box-shadow:inset 5px 5px 10px #ccc; -webkit-box-shadow:inset 5px 5px 10px #ccc; box-shadow:inset 5px 5px 5px #ccc; but it's only applying shadow to 2 sides.
-
tool to compile quiz questions
Does anyone know of a script or extension that will allow a user to log in, select a series of questions from categories, to be presented with a downloadable copy at the end? Something similar to lesson planning software for schools like http://tiny.cc/7cuir ?
-
javascript countdown on page load
Good googling. I'm actually after a javascript one, current limitations mean I can't include a framework.