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.


augmentin e ovulazione quanto costa una confezione di vermox efficacite levitra generique finpecia efficacia benzac prezzo crema diflucan tempo effetto bilocale cipro roma clomid dopo i pasti augmentin sciroppo eccipienti atrovent uso pediatrico clomid esiti positivi venta cialis guatemala atomoxetine strattera dose isotretinoin si sarcina cialis come si usa allegra d pdf voltaren pinzamiento lamisil 1 spray cutaneo soluzione agriturismo cipro voltaren gel rs dramamine pediatrico gotas voltaren per il mal di denti zovirax labiale sui genitali tutela viagra tumore al seno femara flunarizina e propranolol tegretol che farmaco è benzac prezzo in farmacia condilomi glande aldara lamisil onicomicoza voli per cipro da torino gente allegra il ciel sereupin zoloft differenze medicamento seroquel 200 mg cipro mycoplasma genitalium cipro diverticulitis dose perindopril viagra interaction cialis 5 mg e prostata nervo sciatico muscoril e voltaren voltaren nombre generico ventolin effet secondaire ci international cipro 25 voltaren pasticche posologia levitra da sciogliere in bocca minocin effetti collaterali varicella aciclovir dosaggio voltaren 50 mg compresse prezzo quante compresse di diflucan pressione alta gravidanza adalat augmentin bambini quanti ml per kg scadenza voltaren cipro sud mappa domperidone metformin voltaren gel utilizzo clomid da quale giorno comprar generico finasteride crestor venezuela viagra 25 mg non funziona compazine prolong qt groene viagra pil effetti collaterali antibiotico augmentin seroquel prolong einnahme seroquel rilascio prolungato prezzo voltaren retard 150 cipro prezzi vita prezzo cialis 5 mg originale seroquel prolong trastorno bipolar zoloft e impotenza metoprolol interaccion farmaco nutriente medicament prednisolone 20 mg tegretol ultrafarma lasix 25 mg indicazioni terapeutiche cipro atenolol tartrato de metoprolol medicamento lioresal posologie alcool triamcinolone inhaler discontinued metoprolol po iv conversion aldara creme periode allegra clinica odontologica df furosemide causa iperuricemia costo viagra in svizzera reazione allergica da voltaren colchicine emedicine farmaco anafranil 75 mg cytotec farmatodo venezuela posso comprare cialis senza ricetta diovan medication generic voltaren spray precio colombia propecia ilac prezzi viagra 50 mg peperoncino come viagra naturale garcinia cambogia vs lipitor cialis viagra levitra prezzi viagra e arginina dolore al seno dopo clomid allegra event valencia nebivolol dose conversion metoprolol moneta del cipro nizoral shampoo effetti collaterali escitalopram 10 mg cena il cialis influisce sulla fertilità subconjunctival triamcinolone scleritis glucophage effetti indesiderati aldara per verruche quando torna il ciclo dopo dostinex xenical come si usa parcheggio cipro roma via angelo emo epilim lamictal bipolar triamcinolone cream mosquito bites cymbalta e disturbi sessuali vendita viagra in croazia dramamine gravol in canada clozaril generic name evista contre l'ostéoporose domperidone motilium suspension dosage viagra venta libre colombia musica allegra inc bactrim foglio illustrativo viagra risco infarto tinidazole dosage for giardiasis plavix farmacodinamia aricept diverticulitis augmentin antibiotico faringite bactrim sciroppo per mal di gola che differenza ce tra il viagra e il cialis principio activo del voltaren gel voltaren gel mot svullnad voltaren rapid 50 overdose costituzione società a cipro micardis and voltaren famotidine protonix perchè cialis non ha funzionato dividere le pastiglie di cialis requip 4 mg rilascio prolungato co-diovan cost banca popolare di ancona via cipro depakin chrono e risperdal lasix insufficienza cardiaca componentes do allegra pediatrico acquistare viagra legalmente quanto diflucan per candida vacanze mare 2013 cipro co rosuvastatin calcium avodart e impotenza aldara 5 generico prometrium quando le mestruazioni prezzo cialis 5 milligrammi dopo diflucan perdite ranitidine pantoprazole combination immagini nicosia cipro generico do remedio viagra dove acquistare cialis originale a cosa serve il farmaco viagra clomid rimanere incinta subito alesse generic aviane biografia pasquale cipro neto musica al pianoforte allegra naltrexone cloridrato effetti collaterali depo provera dizzy propecia e calvizie gli effetti del kamagra carafate diverticulitis zoloft fa male al cuore propranolol salbe heilbronn qual generico do arcoxia succinato de metoprolol selozok finasteride dove si trova offerte capodanno a cipro cipro dizziness nausea flomax modo di somministrazione flomax mal di gola prezzo diflucan 200 indicazioni augmentin dolori articolari benzac 5 crema prezzo il viagra fa male ai giovani torneo di cipro calcio femminile viagra dopo infarto pacchetti vacanze cipro doxycycline dosage chalazion escitalopram nz topamax contiene glutine quanto costa il cymbalta voltaren gel liver damage cefixime per bambini xenical non si trova in farmacia vacanze cipro spiagge comprare cialis farmacia aristocort cream triamcinolone acetonide 0.02 15g levitra pret in farmacii augmentin antibiotico diarrea augmentin antibiotico a stomaco vuoto o pieno depo provera suomi il manzo via cipro orlistat foglietto illustrativo quante punture di voltaren si possono fare al giorno risperdal gynécomastie motilium suspension oral 1mg ml xeloda for metastatic cholangiocarcinoma affitto appartamenti a cipro farmacia germania voltaren strattera vs nuvigil simili viagra senza ricetta effet secondaire prednisolone chat does cipro come in liquid form come si prende lo zoloft augmentin antibiotico placche gola aldara pomata foglietto illustrativo laboratorio roche argentina xenical damiana come viagra voltaren und opipramol escitalopram zopiclone propranolol na arytmie serca amaryl fda approval date depo provera cholesterol metoprolol succinate 50 mg sa tab dostinex fa male al bambino farmaco dostinex fa ingrassare se prendo il cialis posso bere traghetti brindisi cipro lo zoloft fa cadere i capelli ampicillin vs e coli nizoral 2 shampoo funziona generico do diovan 160 methylprednisolone vs triamcinolone acetonide coumadin e il caldo voltaren y tension arterial levitra generico andorra cipro gi problems prometrium e ritardo del ciclo inderal pressione bassa imiquimod (aldara) chile voltaren resinat medikament cialis 20 mg quando prenderlo voltaren spray precio propranolol e cefaleia differenza tra zoloft e cipralex medicine cipro 500mg levitra orosolubile fegato viagra dolore muscolare laboratorio fabricante cialis bactrim generico prezzo seroquel unipolare depression de legale viagra - blue pill zoloft alza la pressione suprax suspension cost cialis generico nome bula do voltaren 50mg augmentin e infezioni genitali triamcinolone oral paste คือ ciprofloxacin fluocinolone acetonide and clotrimazole cream temperatura cipro dicembre gennaio differenza tra augmentin e klacid nebivolol equivalent metoprolol levitra dalla germania voltaren sr fiyat dulcolax generic name vigorelli allegra trazodone alternatives propecia scadenza brevetto cymbalta e disfunzione erettile generico arcoxia 60 mg cuanto vale orlistat colombia cialis che cosa è reazioni allergiche voltaren cipro tour operator specializzato differenza tra zovirax e vectavir come trovare viagra senza ricetta voli diretti da italia a cipro seroquel anziano autobus termini cipro risperdal et memoire motilium sciroppo indicazioni come inserire ovuli prometrium viagra 25 mg costo ablazione e coumadin voltaren sr 100mg dosage generico do differin gel finasteride chierica zantac sciroppo dosaggio ventolin quando usarlo città fantasma a cipro come agisce aciclovir viramune scheda bronchite asmatica ventolin pt chiara allegra living effetti di cialis generico do viagra azul intossicazione da plavix unterschied seroquel prolong und quetiapin retard viaggio cipro nord diflucan occorre la ricetta giltuss/prednisolone voltaren dolo germany cipro india travel medicament pour la goutte colchicine diltiazem infusione continua viagra a 30 anni cialis generico alta qualità cipro italia 1-1 escitalopram titration voltaren dolo stillen il viagra puo' non funziona crestor rosuvastatin calcium 5 mg foglietto illustrativo levitra 20 mg viagra al supermercato colchicine cristallisée ristorante allegra fattoria malchina proventil ventolin inhaler cipro spiagge più belle anafranil e ciclo mestruale trazodone e aumento di peso viagra mendoza argentina ritalin in combinatie met paroxetine celebrex 200 mg controindicazioni che cos'è il voltaren il tempio di afrodite a cipro doping con ventolin voltaren vs nevanac can voltaren cause stroke cosa non si può mangiare prendendo il coumadin foglietto illustrativo cytotec nitrofurantoin und pilz augmentin neonati dosi thuoc voltaren emulgel a cosa serve il voltaren emulgel lamisil dosage for tinea versicolor ventolin salbutamol precio argentina costo di cialis in farmacia cialis non ha fatto effetto clomid rischio gemelli celtium escitalopram difference chimique entre citalopram et escitalopram triamcinolone acetonide ointment rosacea voltaren tabletten doping allopurinol 100 zentiva hydroquinone triamcinolone tretinoin viagra generico informazioni allegra amazon com danazol composition triamcinolone acetonide usp .5 comprare viagra con bonifico vermox come prevenzione lamisil non funziona carta di credito anonima cipro come si fa il viagra escitalopram identifier tegretol ilaç pedia allegra calzature zoloft peggioramento sintomi roche xenical compresse dimagranti trazodone effetti collaterali vardenafil levitra generico uguale al viagra seroquel per il doc propranolol 40 mg grossesse augmentin e spossatezza generic alesse lutera risperdal au maroc come ottenere il cialis costo di una scatola di cialis benzac 5 efficace voltaren fiale in vena depo provera igne does voltaren gel contain salicylates nombre generico de proventil alternative to voltaren gel quando utilizzare il cialis viagra cialis levitra differenza dutasteride e ginecomastia acquisto cialis con pagamento in contrassegno trazodone cognition voltaren dolori articolari nizoral comprimé posologie ventolin spray con distanziatore voltaren grageas 50 quando usare lasix tempi di azione del viagra priligy e levitra insieme qual o generico de zoloft prometrium 200 mg to induce period farmaco lanoxin compresse can cipro delay period escitalopram and valerian aciclovir 400mg ultrafarma dove comprare cialis generico cerco zovirax 800 compresse prezzo chalazion augmentin allegra ziletti farmacocinetica y farmacodinamia metoprolol voltaren rheumatism comprare finasteride in farmacia cialis 5 mg generico propranolol 120 mg per day foglio illustrativo aciclovir sciroppo cialis spedizione in contrassegno tinidazole paediatric dose lanoxin 0.125 mg effetti collaterali viagra gegen cialis cipro tendons magnesium allegra d class foto isola di cipro pizzarium cipro roma durata operetta vedova allegra viagra generico precos viagra ohne potenzprobleme forum in quanto fa effetto il diflucan aciclovir lattanti triamcinolone ampule alternativa de viagra chile propranolol er 80 mg cap rou pamelor dizziness diflucan interferisce con la pillola strattera 10 mg preis cialis viagra uprima levita cialis dividere pillola cipro xl grossesse aumento di peso con arimidex viagra 100 mg farmacia panvel strattera reboxetine cheapest escitalopram 150 mg of voltaren cipro trivago propranolol fait grossir diminuer dose risperdal progesterone micronized (prometrium) 200 mg capsule tardive dystonia abilify norvasc impotenz confezioni viagra 100 mg se clomid non funziona will depo provera terminate a pregnancy differenze tra cialis e cialis generico metformin si ovare polichistice lisinopril posologia risperdal pagine sanitarie depo provera vs copper iud voltaren dopo i pasti lamictal non funziona voltaren gel preise augmentin 500 mg dosaggio yasmin e antibiotico augmentin orlistat generico comprar assuefazione al cialis generic version of diovan strattera und pille software calcolo dosaggio coumadin perseo via cipro 56 coumadin cosa non bisogna mangiare protonix po to iv conversion trazodone trazodone hcl dove trovo il cialis the medicine voltaren gabapentin palliative care trazodone e gravidanza depo provera positive pregnancy test aciclovir bambini effetti collaterali fluvoxamine aggression 2 puff de ventolin il prezzo di viagra cipro bancomat roche rocaltrol calcitriol carvedilol x viagra dose giusta di levitra noleggio auto low cost cipro augmentin in allattamento lioresal torrinomedica piatti tipici del cipro voltaren spanien augmentin va bene per i denti escitalopram actavis lihottaa voltaren im auge cipro crociere viagra effetti durata cipro or levaquin for uti ricambi auto via cipro 68 indocin vs voltaren scuola di danza allegra ghedi folheto informativo voltaren gel zona aciclovir posologie edmondo allegra clarinet albendazole chien cialis in italia senza ricetta tricyclische antidepressiva paroxetine augmentin sudorazione notturna tinea versicolor lamisil pills zovirax labiale istruzioni diovan 4 dollar copay alimentazione con farmaco coumadin augmentin bambini dimenticato dulcolax grossir tagliare pastiglia viagra differin vitamin a traghetto istanbul cipro tegretol e febbre allopurinol iv to po conversion zovirax dosaggio pediatrico citalopram combined mirtazapine evista 60 mg generic cipro nord passaporto farmacocinetica del diltiazem voltaren osteo cream