logo
Currently Browsing: Web Programming
Sep
9

htaccess redirect url with space

Ok a super quick post today as I wanted to share this with the world. I had some link building done for me a little while ago and I was just looking over the reports sent back to me. To my horror the links were actually pointing to http://www.mywebsite.com/%20 ! This of course was a 404 as I didn’t have a page that contained a space at the end of my URL. There wasn’t much I could do as this work... 
Mar
28

php inline error reporting on

There are going to be times when you are faced with a blank screen and a wave of frustration! Welcome to web programming. I know C programmers are going to argue that the pitfalls of php programming are nothing when compared to segmentation faults and memory leaks, but never the less it is very frustrating when you are developing and PHP error reporting isn’t turned on. Whenever I am faced with an empty... 
Mar
24

RSS Link in URL bar

Those of you that use firefox on windows will probably already have seen the little orange RSS icon that appears in the URL bar on some sites, including this one. This isn’t something I personally gave too much weight until today when a client who owned a joomla website wanted this exact same functionality on their site. Basically they wanted their RSS feed acknowledged in the URL bar so that everyone... 
Feb
20

NicEdit WYSIWYG alignment issue

For those of you that don’t know NicEdit is a pretty awesome little WYSIWYG that is very easy to integrate into any website. Simple slap in a bit of javascript and away you go (well, pretty much). Anyway, I noticed a small problem when trying to align text in firefox, it seemed to break my site completely and gave an error in firebug when clicked. This was a bit of a problem as it was something I needed... 
Jan
12

htaccess redirect from one site to another

Whether your idea failed or you’re just not feeling the magic with an old website you may want to take advantage of the SEO you have done by passing this onto another website. By now you probably already know about 301 redirects and how they can pass on the PR and link juice from the old page, but what about if you want to redirect an entire site using an htaccess? For the argument of this article let’s... 
Dec
23

Disable auto complete cache on input fields

I’m really surprised by how hard it was to find this on the net! I was working with a form the other day at work when I had a text field that seems to have a very common name. Now this isn’t an issue in itself but when I went to type something into this field I was given a big drop down of suggestions from my browser cache as to what I may want to put in this field. This is awesome, but not in this... 
Sep
14

Easy MySQL String replace

This is a very handy trick if you work a lot with mysql databases as there comes a time when you will want to replace every instance of a word/phrase with another word/phrase. So how do we do this? Easy: UPDATE mytable SET mycolumn = REPLACE(mycolumn,”needle”,”replacement text”) Where “needle” is the word or phrase you are looking for and “replacement text” is well…the... 
Aug
13

Javascript detect IE

When you have written a few different pieces of JavaScript you come to realize that IE and Firefox have different opinions on what works and what doesn’t work. What this means is you may need to have different JavaScript firing if the current browser is IE! Here is a little example of how we can detect if the current browser is IE: <script type="text/javascript">    //we start... 
Jul
30

Adding a custom iPhone/iPad Favicon

For those of you that don’t know  iPhone and iPod touch users can now save a “Webclip” bookmark to their home screens. “How exciting” I hear you say in a sarcastic tone. Well, in short it is exciting! With users using their phones more and more for web browsing it can really pay to have a nice custom iphone favicon that users will be able to relate too! So how do you do it? By... 
Jul
22

PDF Opening parameters

It seems to be quite a common occurrence that a client will want to have their PDF link behave in a particular way such as opening at a certain zoom or page number. Luckily for us there is a bunch of options for opening a PDF from an html link! Setting the PDF zoom on open is very easy: http://example.org/doc.pdf#zoom=50 This will set the zoom to 50%. Setting the page number is also very easy: http://example.org/doc.pdf#page=3 This... 

logo
Powered by Wordpress | Designed by Elegant Themes