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.


dulcolax per bambini cialis istruzioni per l'uso mix voltaren ibuprofen allegra etimologia voltaren 800mg posologia atrovent e berotec apertura conto corrente a cipro moduretic e cellulite augmentin per curare la candida alli orlistat farmaco senza ricetta per dimagrire come portare il cialis in aereo nizoral per la caduta dei capelli quando va preso il levitra prednisone 20 mg effet secondaire diltiazem emedicine cipriani escitalopram ristorante pecora allegra roma differenze tra aciclovir e zovirax voltaren bei rippenprellung passaggio da eparina coumadin carvedilol propranolol varices periodo fertil usando serophene zoloft e psicofarmaci norvasc somministrazione costo attuale viagra voltaren arthritis medicine dosaggio augmentin gatto levitra pressao alta lopid controindicazioni is voltaren an anti inflammatory voltaren e feldene insieme la sposa allegra streaming cipro nicaragua lincocin principio attivo escitalopram cialis lamictal e depressione bipolare cialis disturbi gastrici propranolol medicamento controlado aciclovir compresse bugiardino aciclovir 800 costo differenza tra plavix e cardioaspirina generico diovan amlo fix quanto dure l'effetto del viagra risperdal wikipedia español dulcolax pico perles boots allegra dollfus pda chloramphenicol risperdal und dipiperon viagra e acido acetilsalicilico triamcinolone acetonide oral paste uk albendazole cattle la tavola allegra sesto meclizine allegra interaction allegra fattoria fisher price lasix a che cosa serve come si somministra augmentin bambini levitra stomaco pieno o vuoto consolato di cipro venezia augmentin per ascesso dentale viagra-generico-italia.net voltaren y ciatica tegretol anziani propranolol to lopressor conversion procardia xl pill identifier medicamento glucophage 850 cytotec colombia legal prognoza meteo calan 15 zile cialis per ipertensione aripiprazole escitalopram combination triamcinolone acetonide cream usp 0.1 sale voltaren dispers 30 tabletten medicamento generico de cytotec prednisolone mylan a quoi sert il lamisil solo sauna propecia esperienza assumere cialis scaduto pristiq strattera interactions propranolol na co abilify e piano terapeutico seroquel promethazine condylomata acuminata aldara viagra africain maca come viagra e se clomid non funziona augmentin e tachipirina in gravidanza provera in menorrhagia chlorhydrate de propranolol posologie levitra 10 mg istruzioni risperdal consta oral conversion zovirax in gravidanza per varicella tamoxifen sclerosing peritonitis risperdal spritze preis voltaren gel creatine combivent vial monodose cipro clima luglio differin gel 0 3 generico mancata ovulazione dopo clomid come usare il ventolin nei bambini differin gel serve para que hilton nicosia cipro coumadin dosaggio iniziale donde venden viagra chile fanconi anemia tetracycline amazon potenzmittel cialis effetti di abilify viagra che effetto fa alle donne bactrim contro i coccidi voltaren vs mobilat allegra nova ghent voltaren tendinitis hombro augmentin dosaggio minimo dieta consigliata per coumadin zoloft per disturbo bipolare vermox per gatti prezzo voltaren su ferita cefixime ornidazole suspension proventil proair ventolin bula allegra d 60 mg coumadin dose iniziale e zigarette liquid viagra offerte viaggi last minute cipro cialis generico giornaliero metoclopramide chemical name medicamento viagra generico cialis e ipotensione cialis chi l'ha usato wellbutrin disturbi sessuali effetto del viagra quanto dura come usare benzac 10 voltaren gel calf muscle voltaren max tanio anafranil ritardante clomid con ovaie policistiche sito sicuro per comprare viagra generico estrace no period augmentin contiene cortisone zyprexa effetti positivi micardis e insufficienza renale voltaren supposte foglietto illustrativo voltaren halftime cura diflucan 150 mg ma il levitra fa male voltaren crema e ibuprofeno acquistare viagra senza carta di credito effet secondaire atarax 25 placche alla gola e augmentin relafen 750 mg contiene aspirina somministrazione cialis 20 mg serophene e positivo voltaren 50 mg prezzo comprare viagra in italia augmentin per curare candida tronchetti provera e l'inter ยา norgesic voltaren dosaggio furosemide nel cane risperdal siroop voltaren fainting voltaren e distorsioni vendita di cialis in italia mezza compressa di zoloft generic name for voltaren ovitrelle e clomid fungsi escitalopram cirrosi epatica e viagra clomid clomifene farmaci ovulazione prometrium dal 14 giorno ibumetin vs voltaren neurontin fobia social cymbalta diverticulitis mobic 15 mg controindicazioni viagra sin receta on line allegra d contem corticoide provera fet tranzistora comprare levitra in italia augmentin bustine per bambini la vedova allegra teatro regio torino cialis e rivotril voltaren retard pastile viagra natural en chile triamcinolone acetonide cream on cold sores vytorin medicamento bula uso di zovirax in gravidanza voltaren 50 mg rus effetti da sospensione cymbalta come agisce risperdal chloramphenicol 10 mg คือ cipro villaggi turistici 5 stelle differin gel menor preço costo del augmentin dove comprare il cialis su internet viagra spedizione corriere espresso voltaren 50 cmi diflucan 2 pastiglie cibi effetto viagra propecia gia bao nhieu allegra le rolland metoclopramide pharmacological classification cialis prezzo in francia quanti sono gli abitanti di cipro augmentin senza ricetta medica antialergico allegra d voltaren tbl cena quando prendere norvasc non prescription viagra in usa turisti per caso cipro offerte isola di cipro prednisolone mylan 20 mg a quoi ça sert tinidazole diarrhea fungsi dulcolax supp vedova allegra trento generic dulcolax suppositories cialis originale in 24 ore vistaril and risperdal istanbul cipro voli terapia onicomicosi diflucan can ampicillin cure uti cosa serve clopidogrel augmentin bambini sciroppo foglio illustrativo cymbalta palpitazioni plavix e impotenza can strattera cause ed le dieci erbe e coumadin viagra che non fa effetto voltaren dispers 600 arznei telegramm arcoxia viagra salg norge foglio illustrativo bactrim compresse lopressor po to iv conversion lioresal et alcoolisme posologie colchicine pericarditis uptodate atrovent ventolin normal saline cipro inno levitra 10 mg durata vermox 100 controindicazioni dostinex il prezzo propranolol glycemie augmentin antibiotico per i denti oral lamisil for tinea corporis augmentin pediatrico 400 anafranil dosi consigliate depo provera leg pain metoprolol succinate er amlodipine remeron effetti da sospensione carvedilolo e viagra augmentin inizio gravidanza motilium medicament notice dose di augmentin sciroppo prednisone e proteinuria aborto con cytotec dolor coumadin lontano dai pasti voltaren 23.2 mg/g gel plavix cardioaspirina differenze voltaren salbe alternative pillola e augmentin gravidanza voltaren uso topico cipro.co.za ck1 risperdal fiala prometrium giramenti di testa vacanze cipro forum voltaren pack sizes can ciprofloxacin cause clostridium difficile effet secondaire du medicament crestor propranolol cavernoma cipro in pneumonia differenze levitra cialis lariam opinioni cipro mappa stradale allegra seo trazodone prolonged qt feldene 20 mg posologia voltaren gel shingles voltaren resinat 50 mg affitto villa con piscina cipro iperico o zoloft clomid anche se si ovula normalmente zovirax compresse 800 prezzo dott provera milano viagra lima peru allegra rangoni machiavelli depo provera chemical castration dose cosa serve medicinale norvasc dove si trova isola di cipro voltaren tab ec 50mg clopidogrel e hemorragia digestiva voltaren rapid 25 active ingredient cialis generico miglior sito metoclopramide imodium prednisolone gastro resistant 5mg furosemide ed insufficienza renale prezzo di zovirax labiale chi ha provato cialis 5 mg seroquel prolong und tavor i componenti del viagra assumere dostinex in gravidanza ventolin solutie aerosoli viagra generico roma cipro 500 infeccao urinaria cuanto vale risperdal voltaren dopingmittel posologie voltaren 50 dulcolax milk of magnesia colonoscopy prep per acquistare il viagra serve la ricetta medica cialis prezzo al pubblico generico cialis colombia effet sevrage propranolol augmentin suspension pediatrica 12 h voltaren gel 1 espanol ricerca scolastica su cipro chloramphenicol et grossesse diflucan per cistite cipro appartamenti in affitto voltaren gel cvs pharmacy terramycin sivilce izi farmaci tipo viagra senza ricetta dosage trazodone depression diflucan oppure el medicamento risperdal blod i urinen voltaren medicament benzac costo cialis 2013 viagra perche tretinoin metronidazole mobic principio attivo finasteride 1 mg precio chile clomid e gonasi ritardo lasix dove agisce vantaggi levitra orosolubile venta strattera da vedere cipro nord dosaggio augmentin compresse risperdal bambini effetti collaterali dulcolax presentation voltaren emulgel per strappi cipro po iv conversion hipertension arterial diovan costo confezione viagra harga viagra di indonesia clomid e farlutal farmaco propecia per capelli voltaren ampolla posologia pillola viagra per uomini spiagge per nudisti a cipro cipro dosage in uti ventolin mocos chi può assumere il viagra metoprolol varices benzac e eritromicina escitalopram superiority minocin antibiotico e pillola yasminelle vacanze cipro opinioni naprosyn principio attivo dostinex dopo quanto si abbassa la prolattina atenolol po to metoprolol iv conversion prescrizione del plavix affittare auto cipro effetti positivi del clomid viagra generico comentarios propranolol in ugib propranolol er capsules metoprolol tartrate er succinate finasteride e attacchi di panico albendazole single dose nome generico viagra ems comparatif viagra levitra cialis bactrim per infezioni vie urinarie effet secondaire tegretol lp problemi di erezione con levitra risperdal consta conversion to po voltaren capsule prezzo diovan sintomas finasteride inutile clopidogrel qual o laboratorio cipro schengen prometrium subito dopo ovulazione siringa di muscoril e voltaren mecanismo accion motilium quanto tempo prima si prende viagra voltaren nuro b voltaren sod ec 75 mg metoprolol succ vs metoprolol tartrate cialis insieme a viagra casodex principio attivo acquisto viagra in farmacia dove viaggi cipro tutto di viagra lamictal 25 scheda tecnica augmentin va conservato in frigo voltaren fiale per sciatalgia aciclovir compresse ricetta voltaren and ssri mirtillo rosso coumadin meclizine dizziness vertigo cialis perdida vision motilium suppo volwassenen prurito anale vermox clomid ed ecografia utilizzo cymbalta meteo a cipro ad aprile lotrimin vs lotrisone medicamento lipitor generico estetica via cipro brescia medicamento generico de cymbalta dove comprare il viagra in farmacia cialis esperienze forum camera in affitto roma cipro generico de diovan 160 quanto costa levitra orosolubile diovan pronounce triamcinolone cream keratosis pilaris quando scade il brevetto di propecia association leponex risperdal cipro spiagge sabbiose bactrim e influenza nizoral sampon sarcina linola creme erythromycin periorale dermatitis navio costa allegra foto risultati proscar trazodone respiratory distress hotel bella napa cipro voltaren dispers höchstdosis cozaar insert propranolol quelle dose candida che non passa con diflucan medicamento proventil hfa allegra d nyquil voltaren uso cutaneo rischi assunzione viagra qualcuno ha usato levitra dove comprare viagra senza ricetta roma farmacity viagra femenino trental 400 mg compresse prezzo tretinoin collagen elastin grupa viagra sostav cymbalta ricaduta ciprofloxacin difficile anafranil contre angoisse effetto collaterale del viagra sospensione coumadin dopo cardioversione detrol la efficacy voltaren emulgel per contusioni trazodone pill identification allegra compagnia degli assurdi prezzo aciclovir pomata inconvenient medicament crestor metoclopramide otc australia farmaco arava effetti collaterali strattera sin receta dividere cialis 20 mg benzac gel 5 senza ricetta cartina geografica di cipro triamcinolone acetonide for cradle cap escitalopram pregnancy class metoclopramide neonates lotrisone unguento nizoral 200 mg comprimé furosemide ipernatriemia clomid aumento di peso musica allegra per video bambini levitra in farmacii pret mobic 15 mg compresse prezzo clomid e prontogest mi az ampicillin chloramphenicol ung sandoz metoprolol effet secondaire allegra fattoria malchina prezzi bactrim batteriostatico alendronate (fosamax binosto) ventolin non fa effetto levitra serve la ricetta posologie flovent ventolin prometrium per ritardare il ciclo stampa magliette via cipro qual generico do xenical levitra da dipendenza biodisponibilité bactrim perdita capelli finasteride differin crema gravidanza clomid provames ovitrelle duphaston cymbalta citalopram zusammen quando si prende il lasix come faccio a comprare il viagra hydrocortisone decadron conversion seroquel ritenzione urinaria cialis online miglior sito massimo provera bain clomid clomifene gravidanza calcolo dose augmentin sospensione ciprofloxacin pharmazie medicamento antimicotico lamisil lamisil at cream tinea versicolor viagra lichida free voltaren gel coupon voltaren gel vs solaraze diflucan polvere come si prepara nizoral per dermatite seborroica il tegretol fa male augmentin sciroppo composizione a che età prendere il viagra vermox 500 mg prezzo percentuale di rimanere incinta con clomid