Windows mobile

May 30th, 2008

This isn’t much of a post, more a test of using my phone to do this as I wonder if I should attempt a little CPR on this blog.

I’ve got some fresh CSS and JavaScript discoveries to share so watch this space.

Busy busy busy…

February 8th, 2006

I was hoping to play around with the checkbox vs. radio button code a bit more but I’ve been temporarily pulled off of that project with v.1b of the project going live and v.2 being put off for 10 days.

Instead I’m back to working on our new HTML editor and making sure that the CSS for the whole site defines everything that can be defined. Otherwise there’s a real risk of conflict with our partners stylesheets.

Bringing the new HTML editor into play is a major step forward towards standards compliance and accessibility as we will finally be able to get rid of the antiquated editor that has been in play for years along with all of the tag-soup that goes with it.

Is it a checkbox or a radio button?

February 6th, 2006

Part of the requirements doc for a subscription form I’ve designed for an internal client at work stated that the form must use checkboxes for a particular function. One of our Java programmers, Satish, who created the whole mail system said that it would be a lot easier for him if we could use radio buttons.

Fortunately I remembered seeing a tutorial some time ago which discussed using images to replace the radio buttons, making it possible for me to make it appear that there were checkboxes on the page, keeping the client happy, and retain the functionality of radio buttons, keeping the programmer happy.

The original code from BrainError was only for changing checkboxes but I also stumbled upon a solution andrew Main had provided that changed radio buttons as well.

I stripped the checkbox part of the code out and created some true/false checkbox images and now everyone is happy :-) Here’s the code if you want to give it a go yourself… It’s not completely accessible in that tabbing through the buttons won’t work, but the form I’m working on uses so much Javascript already that it’s really not the end of the world.

<script language="javascript" type="text/javascript">
/*
THE FOLLOWING CODE HaNDLES THE GRaPHICaL CHaNGES FOR RaDIO BUTTONS
*/
//global variables that can be used by aLL the functions on this page.
var inputs;
var imgRadioFalse = 'images/radio_unchecked.gif';
var imgRadioTrue = 'images/radio_checked.gif';

//this function runs when the page is loaded, put all your other onload stuff in here too.
function init() {
replaceRadios();
}

function replaceRadios() {

//get all the input fields on the page
inputs = document.getElementsByTagName('input');

//cycle trough the input fields
for(var i=0; i < inputs.length; i++) {

//check if the input is a checkbox
if(inputs[i].getattribute('type') == 'radio') {

//create a new image
var img = document.createElement('img');

//check if the checkbox is checked
if(inputs[i].checked) {
if(inputs[i].disabled)
{
img.src = imgRadioTrueDisabled;
} else {
img.src = imgRadioTrue;
}
} else {
if(inputs[i].disabled)
{
img.src = imgRadioFalseDisabled;
} else {
img.src = imgRadioFalse;
}
}

//set image ID and onclick action
img.id = 'radioImage'+inputs[i].id;

//set image click event if button not disabled
if(!inputs[i].disabled) img.onclick = new Function('radioChange('+i+')');
//place image in front of the checkbox
inputs[i].parentNode.insertBefore(img, inputs[i]);

//hide the checkbox
inputs[i].style.display='none';
}
}
}

//change the radio status and the replacement image of checked and all in same group
function radioChange(i) {
var radios=new array();
var tmpradios;

// load all the inputs into tmp array
tmpradios = document.getElementsByTagName('input');

for(var j=0; j < tmpradios.length; j++) {
// add only the radios in this group to the array
if(tmpradios[j].getattribute('name') == inputs[i].getattribute('name'))
{
radios.push(tmpradios[j]);
}
}

if(inputs[i].checked) {
// already checked so do nothing as radio does not uncheck like a checkbox
} else {
// make all other group items unchecked
for(var j=0; j < radios.length; j++) {
document.getElementById
('radioImage'+radios[j].id).src=imgRadioFalse;
document.getElementById
('radioImage'+radios[j].id).checked='';
}
// make the selected item checked
inputs[i].checked = 'checked';
document.getElementById
('radioImage'+inputs[i].id).src = imgRadioTrue;
}
}

window.onload = init;

/*
END OF RaDIO BUTTON CODE
*/
</script>

Tomorrow I’m going to try and add to the code so that it will exclude radio buttons that I don’t want to change as at the moment it does a general sweep of the page and changes every radio button it finds. If you use the code be sure to give each of your radio buttons a unique ID so that the script can differentiate between which image to show when the checked state is changed. also remember to rename the image paths to match those of your own images.

Once again props go to BrainError and anthony Main, the first for coming up with the original checkbox code and the latter for adding radio button functionality.

Pain Injection

February 6th, 2006

I was expecting a nice quiet days work today on my Sunday job, with just one site to be uploaded that I’d already finished last week and two pages needing very minor edits. Of course nothing is ever that simple!

When I called Simon this afternoon, he told me that he’d received 350 spam e-mails today alone, with thousands more since Thursday. It didn’t seem like the strangest thing in the world what with the amount of spammers about these days, until he told me that all of the e-mails were coming from one of our servers. a quick check of one of the e-mail headers confirmed that the e-mails had indeed come from our server.

Had we been hacked? How many other people were now receiving spam that appeared to come from us?

I Googled for a while and found that we’d been the victim of a “Sendmail Injection Exploit.” Basically a spammer uses a site’s contact form URL and adds extra variables that enables them to use a server for sending anonymous spam. I couldn’t find a fix that worked for me so I put up a temporary holding page to keep the spammers at bay before going off to learn some new PHP to help me come up with a solution of my own.

The final result seems to work but I won’t be putting it into production until tomorrow night when I’ll know for sure. The following code is part research, part guess-work and just a smidgen of actual PHP knowledge.

$email = preg_replace("/\r/", "", $email);
$email = preg_replace("/\n/", "", $email);
if (eregi("cc", $email) || eregi("bcc", $email) || eregi("to", $email) || eregi("Content-Type", $email)) die("Sorry, there was a problem with your message being sent. Please click <a href=\"javascript:history.go(-1)\">here</a> to try again");

I would have used a more ‘choice’ message for the spammers when filtering them out but it’s always possible that a legitimate customer could receive the message by mistake. With this being a possibility there’s also the chance that we could block legitimate contacts but I think this is the lesser of two evils here.

If you find yourself a victim of such an attack please feel free to add the above code to your PHP mail() form. Just replace $email with whatever field you use to collect the senders e-mail address.

Stumble

February 4th, 2006

So you stumbled upon my little blog eh?

Well then you’re sure to have noticed that this is very much a WIP and will probably remain to be so for the next month or so as I struggle to find the time to get some kind of design down for it in between my full-time job, my Sunday job and of course spending time with my wonderful wife and son.

Edit: Okay so maybe I won’t be struggling to find the time to design this as I’m fairly happy with what I’ve put together in just one day :) (just some minor tidying needed when I next get a few hours to get into it).
Installation was incredibly simple and I’m sure you could customize to your hearts content with just a little PHP, (x)HTML and CSS knowledge.

I did have a briefly worrying moment a couple of minutes ago… Having completed the design aspects for now I added a re-direct for anyone coming in to www.interwebby.com to bring them straight to this directory where WordPress is installed. after that I thought it would be a nice idea to change the URI in the options to ensure that any WP generated links also led to the short address. Big mistake! This caused every link to break and made it impossible for me to change the URI back. Fortunately I was able to go into the db and correct my error :)

Close a window or tab in Firefox with JavaScript…

February 4th, 2006

Update… Unfortunately this code no longer works in Firefox 2.x ~ I guess they saw this and fixed it, (for them - broke it for us!).

Recently at work I was asked to make javascript:window.close(); work in FireFox. I searched hard and long across numerous forums and on each and every one the answer was the same - it cannot be done unless the page was opened by a script! Or at least it couldn’t until I was required to make it happen ;-)

I’m by no means a JavaScript expert - in fact I hardly know any at all - but I couldn’t believe that this was completely impossible so I came up with the following:

The first step is to fool the browser into thinking that it was opened with a script…

window.open('','_parent','');

This opens a new page, (non-existent), into a target frame/window, (_parent which of course is the window in which the script is executed, so replacing itself), and defines parameters such as window size etc, (in this case none are defined as none are needed). Now that the browser thinks a script opened a page we can quickly close it in the standard way…

window.close();

and there you have it - I told you it was simple! In case you didn’t follow that, here is the complete solution in two easy steps:

1. Copy/paste the following code to the head of your page…

<script language="javascript" type="text/javascript">

function closeWindow() {

window.open('','_parent','');

window.close();

}

</script>

2. Set your link like this:

<a href="javascript:closeWindow();">Close Window</a>

and there you have it - a problem that it seemed, (according to my trying to find a solution before coming up with this one anyway), to have baffled everyone else.


zovirax labiale a cosa serve pillola viagra e simili differenza tra lyrica e cymbalta suprax per bambini voltaren fascia lata effetti collaterali decadron lincocin per ascesso per comprare il levitra in farmacia ci vuole la ricetta medicamento crestor 40 mg la costa allegra conversion avapro to cozaar avis autonoleggio cipro clima cipro in aprile voltaren dispers geigy dulcolax pastile pret voltaren australia price posologie motilium lingual inderal debolezza clonidine posologie iv cozaar 50 mg posologia gatto di cipro prometrium fino a quando augmentin cu metronidazol ricerca cipro wikipedia acquistare avodart minocin 50 mg costo pomada voltaren indicaciones allegra d class trattamento aldara crema l augmentin va bene per la candida aldara creme dellwarzen intralesional triamcinolone acetonide etodolac sulfa allergy conversione betamethasone prednisone come comprare il viagra online nombre generico dilantin comprare viagra on line è reato metoprolol pareri dostinex generico colombia clopidogrel aspirina infarto miocardio quando avere rapporti usando clomid fludrocortisone to prednisone conversion forum effet secondaire lamictal costo de cialis 5 mg lipitor plaque stabilization chi soffre di ipertensione può prendere il viagra voltaren gel coupon canada ci vuole il passaporto per andare a cipro inderal clorhidrato de propranolol vacanze cipro novembre voltaren dolo 12 5 mg beipackzettel volagratis cipro periorbital cellulitis augmentin triamcinolone acetonide pupps tour operator appartamenti cipro trazodone sommeil cipro price rite aid premarin e provera rocaltrol vitamin d equivalent frasi ironiche sul viagra tegretol pagine sanitarie xenical acquisto atarax sciroppo costo augmentin sciroppo eccipienti periactin con clusivol sospensione coumadin per intervento il prezzo di viagra villaggi bravo a cipro isoptin press scheda tecnica triamcinolone acetonide on a tattoo finasteride propecia opinioni placche alla gola bactrim voltaren e fertilità maschile candida diflucan funziona viagra tempi di reazione protocol for late depo provera is trazodone a maoi inhibitor benzac cicatrices olanzapine procyclidine quanto custa remedio allegra levitra generici frase canzone allegra cialis generico italia farmacia diovan da tosse a quoi sert le medicament singulair trazodone missed period generique viagra doctissimo medicamento lisinopril 10 mg mucca allegra aldara ricetta limitativa vermox somministrazione bambini acquistare propecia on line allegra d dosage provera and no periods tenormin discontinuation pillole tipo viagra dott. allegra ginecologo palermo il viagra come va assunto clomid ciaza clomid e dolori al basso ventre tripadvisor spiagge cipro aciclovir sospensione bugiardino premarin pronunciation nizoral quanto costa farmacie per acquisto viagra obat viagra di indonesia cipro quando andare dolo voltaren novartis sinemet 100+25 a rilascio prolungato uti medication cipro dosage proscar pagine sanitarie levitra e cardiopatie quanto dura effetto cialis 5 mg metoprolol er succinate recall voltaren bant arimidex anastrozole gli effetti collaterali voltaren gel priser viagra citrato de sildenafil succinato de metoprolol impotencia altace cost comprare viagra in polonia metoclopramide india effetti collaterali antibiotico augmentin biovail tricor acquisto finpecia risperdal vida media lamisil pret farmacie augmentin bambini dosaggio ml voltaren per il mal di denti lioresal indicatii sildenafil e cialis a cosa serve il farmaco viagra pityriasis versicolor nizoral tabletten volo fiumicino cipro danni da levitra finasteride risultati frontale augmentin si prende prima o dopo i pasti risperdal gynécomastie cipro centrale elettrica cialis 20 mg generico triamcinolone acetonide cream 5 acne benzac crema opinioni stampe magliette via cipro triamcinolone usp monograph depo provera vs copper iud generico cialis no brasil quando scade il cialis motilium compresse è mutuabile alesse estrogen progesterone finasteride e serenoa insieme costo levitra 20 mg spiagge limassol cipro adalat farmacocinetica eczema triamcinolone acetonide ointment ibuprofen 400 oder voltaren voltaren emulgel 1 in gravidanza voltaren 75 mg retard filmtabletta voltaren use in pregnancy propecia e calvizie vacanze cipro spiagge clopidogrel dell'ictus topamax contiene glutine medicamento tegretol cr 200 verdure foglia larga coumadin effetti indesiderati nizoral shampoo a quoi sert propranolol voltaren salbe histaminintoleranz diovan phlegm augmentin flora batterica cipro vacanza per giovani musica allegra per foto effetti collaterali al viagra qual generico do arcoxia come capire se un uomo ha preso il viagra pastiglia sostitutiva coumadin offerte capodanno a cipro ficha farmacologica de lasix zovirax sospensione bambini voltaren pvp generic alesse lutera quanto custa o viagra generico voltaren dolo unguento tempi di efficacia cialis simvastatin contra crestor informazioni sulla pillola viagra avodart e sessualità broncovaleas o ventolin augmentin modalità di assunzione voltaren oftalmico prezzo minocycline dosage for perioral dermatitis terazosin saw palmetto e meglio il viagra o il cialis augmentin antibiotico placche gola pcos provera no period strattera 40 mg presentacion voli trapani cipro medicament gastro motilium atrovent uso pediatrico diflucan forme farmaceutiche macelleria via cipro roma associazione amici grotta remeron viagra nell'ipertensione polmonare leo harlem pollo viagra cialis funziona dopo prostatectomia alcohol uti cipro voltaren punture emorroidi diflucan compresse senza ricetta voltaren cpr voltaren anti-inflammatory emulgel viagra online prezzo interazione coumadin e antibiotici suizid durch seroquel ludoteca via cipro roma requip allucinazioni 10 centesimi cipro wikipedia voltaren resinat conversion from citalopram to escitalopram augmentin per raffreddore gatti motilium tropfen suspension lioresal indicazioni ragazza prende viagra sintomi gravidanza con dostinex generico amoxil bd prima moglie di tronchetti provera seroquel opinioni zithromax clostridium difficile o que significa provera triamcinolone mast cell tumor diovan 4 dollar copay nervo sciatico muscoril e voltaren voltaren dolore al ginocchio trazodone and propranolol commercialista cipro propranolol traumatisme arimidex e depressione tricor pesticide voltaren emulgel pericoloso compazine dose migraine perchè cialis costa tanto triamcinolone acetonide nih augmentin ci vuole la ricetta champagne jacquart brut cuvee allegra principio attivo del lasix cytotec per abortire come usarlo evista 60 mg generic augmentin effetti collaterali nel cane prezzo cialis 5 milligrammi uso del voltaren aerosol risperdal phobie sociale nystatin triamcinolone acetonide cream generic naltrexone cloridrato effetti collaterali augmentin dolori articolari dove sono le spiagge piu belle a cipro seroquel 150 rilascio prolungato costo del diltiazem cipro tendons magnesium crestor astrazeneca shionogi quoi sert medicament atarax acquisto viagra generico in contrassegno isola di cipro mappamondo lisinopril 10 mg qualitest comprare finasteride in farmacia ventolin aerozol chpl clomid posologie efficace bactrim forte per quanti giorni risperdal consta libido cipro codice postale escitalopram difference citalopram voltaren dispers forum paseo via allegra alli orlistat vendita augmentin per lo streptococco cura ormonale con femara vermox sciroppo effetti collaterali flomax per il raffreddore propecia tunisie crociera msc allegra prometrium ovuli a cosa serve colchicine colsalide si può acquistare il viagra in farmacia senza ricetta voltaren compresse per sciatica dulcolax laxative pregnant augmentin posso bere latte cuanto vale voltaren emulgel nizoral sampon indicatii voltaren fiale im dosaggio cialis 10 mg femara compresse effetti collaterali acquistare viagra online opinioni cefacilina 500 cefadroxil montpellier provera 10 mg 5 dias allergico augmentin carvedilol coreg generic propecia finasteride costo differenza coumadin e sintrom betamethasone prednisone conversion viagra mendoza argentina triamcinolone acetonide cream vs hydrocortisone lanoxin 0.125 mg effetti collaterali indikasi chloramphenicol palmitat voltaren 75 mg suomi voltaren sr 75 mg ampul prometrium 200 mg to induce period rocaltrol 0 25 prezzo propranolol fait grossir cipro vendita immobili ciclo corto con clomid esiste viagra senza ricetta meteo a cipro a settembre alimenti viagra naturale viagra donne acquisto voltaren sr ne demek voltaren concussion cosa vedere e fare cipro eruzioni cutanee coumadin voltaren gel pil triamcinolone 0.1 cream 15gm celebrex 200 mg controindicazioni voltaren resinat gift abilify impotenz prometrium period delay generico do cialis diario compazine prochlorperazine maleate pecora allegra via delle capannelle effetti collaterali viagra generico viagra di apotik century cosa non si può mangiare prendendo il coumadin norvasc impotenz medicamento allegra d 180 mg durata cura anafranil tricor lovaza concerta and risperdal voltaren o voltfast ristorante camoretti albenza cialis generico da 5 mg diminuer dose risperdal augmentin effetti collaterali nausea assunzione diflucan gravidanza voltaren 100mg price propranolol comprimate prospect previsioni meteo a nicosia cipro differin clareamento voltaren gel gravid diflucan e rapporti sessuali lincocin bugiardino allegra columbia il bissulfato de clopidogrel 75mg generico gliclazide metformin indications come smettere con cymbalta vytorin 10/40 posologia quanto costa levitra generico triamcinolone acetonide cream on neck elenco telefonico nicosia cipro prezzo del levitra originale alimenti permessi in terapia con coumadin diflucan mal di testa diflucan occorre la ricetta lotrisone alternatives dove comprare viagra generico sicuro chloramphenicol resistant e. coli strain voltaren suppository overdose voltaren rischio infarto allegra petta viagra dolore muscolare que contiene allegra d diflucan per l'uomo alberghi 5 stelle cipro taxi cipro tariffe rocaltrol muadili vytorin colombia per comprare il viagra occorre la ricetta triamcinolone fluorinated diflucan reazioni allergiche il dosaggio lasix per un cane interazione cortisone coumadin metoclopramide in under 20s risperdal mi ritalin mi generico do micardis 80 mg fermata metro cipro indirizzo il cialis si puo' acquistare in farmacia l-arginine viagra combination voltaren forte pret difference chimique entre citalopram et escitalopram trazodone cost canada ente del turismo di cipro voltaren fiale antidolorifico ampicillin principen ali larter allegra coleman feldene stomaco pieno colchicine cristallisée effetti viagra uomo foro de strattera cose il coumadin voltaren gel for ms escitalopram price india depo provera muscle deterioration voltaren dolo 12 5 mg filmtabletta 20x effet secondaire micardis 80 mg a quoi sert ranitidine farmacocinetica y farmacodinamia de metoprolol crestor gemfibrozil combination voltaren fiale scaduto nitrofurantoin und pilz dottor allegra dietologo colchicine cost per pill si puo dare augmentin al gatto de benedetti e tronchetti provera compazine suppositories dose augmentin bambini esposizione al sole voltaren pain gel farmacocinetica y farmacodinamia aciclovir metoprolol 100 mg effet secondaire famotidine ranitidine pregnancy quartiere cipro roma ventolin per gatti voltaren retard 100mg uk meglio coumadin o cardioaspirina maladie periodique colchicine prednisolone antiemetic viagra generico in farmacia costo bisoprolol diovan noroxin 400 mg leggi le opinioni allegra via biocomputing diflucan 200 effetti collaterali augmentin bambini opinioni depo provera provoca sangramento augmentin gatto dosaggio fda triamcinolone epidural dulcolax compresse effetto metoprolol farmacocinetica farmacodinamia inderal pressione bassa augmentin bambini quanti ml per kg cardura e cataratta augmentin bambini fermenti lattici colchicine bij pericarditis cardizem la generic allegra fattoria canzone allegra calciatore napoli cialis si puo bere quando riaprono le banche a cipro acquistare viagra generico come interrompere il coumadin xenical del laboratorio roche prometrium blocca ovulazione indocin dizziness cialis libera vendita in farmacia cipro fiumi compazine gg 953 differenza tra zoloft e daparox banche chiuse a cipro diflucan per la candida orale coumadin va preso a digiuno soffro di pressione alta posso prendere il viagra prednisone distemper moduretic pressione alta escitalopram con sertralina colica renale voltaren supposte lybrido viagra per le donne risperdal pagine sanitarie presa elettrica cipro voltaren emulgel voltaren gel levitra orosolubile crea dipendenza artane dublin postal code reazioni allergiche a augmentin anafranil somnolencia viagra trovaprezzi frigideira allegra tramontina hotel 5 stelle a cipro nord metoprolol tartrate apo metoprolol qual laboratorio produz o crestor hydroquinone triamcinolone tretinoin zoloft 50 effetti differenza tra cialis originale e generico costo alli orlistat viagra e cardiopatici trazodone 20 mg generic remeron cost bactrim per cuccioli banche cipro nord cialis generico cos è allegra pediatrico 60ml preço villaggi cipro nord aeroporto cipro nicosia iperico indinavir levitra e alcolici diflucan interferisce con la pillola cialis generico soft tratament onicomicoza lamisil seroquel 25 mg ne ilacı voltaren im plm cipro voli economici torta allegra prova del cuoco allegra.com feldene colica menstrual telenor provera racuna u romingu prednisolone 21-hemisuccinate levitra orosolubile prescrizione ristorante giapponese zona cipro clomid test ovulazione negativo zyrtec antialergico pediatrico