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.


il viagra alza o abbassa la pressione proscar per la caduta dei capelli voltaren rapid 25 asthma non proprietary name for zantac avodart 0.5 mg capsule molle acquisto viagra senza ricetta in farmacia voltaren piu oki dulcolax si anticonceptionalele bactrim combate giardia profilattico al viagra voli diretti bari cipro allopurinol pre chemo aciclovir esposizione sole effetti collaterali voltaren 100 dove acquistare il cialis senza ricetta voltaren gel cold sore per andare a cipro ci vuole il passaporto allegra d comprimidos chloramphenicol/beclomethasone dipropionate/clotrimazole/lignocaine hcl primperan zantac coumadin dose massima giornaliera prandin generic date aerolin combivent cipro spiagge foto cipro e tartarughe interaccion farmaco nutriente del clopidogrel tagliare cialis 20 mg voltaren piede coumadin e interazioni alimentari nizoral shampoo quanto costa volo diretto bari cipro orlistat 120 mg laboratorio colmed international cuanto vale cialis 5 mg con il clomid quanti follicoli fiche seroquel voltaren gel sprained wrist pillola estinette e antibiotico augmentin qualitest hydrochlorothiazide chiamare cipro dall'italia bula risperdal pdf feldene principio ativo aldara applicazione metro rome cipro voltaren oral canada conversion lyrica neurontin finasteride per tutta la vita viagra e antibiotico cipro alternatives for diverticulitis medicament glucophage 1000 albendazole dose in pediatric prazosin in scorpion sting carafate suspension administration risperdal epilepsie iv to po conversion zofran il methotrexate fa dimagrire ficha tecnica del metoprolol generic lariam existe generico do differin citodon eller voltaren viagra durata effetti uso prometrium in gravidanza crème aldara efficacité sentenza cipro c. turchia meccanismo azione aciclovir norvasc gonfiore alle gambe zovirax labiale e gravidanza augmentin sciroppo bambini 35 ml voltaren rapid 50 mg prospect tetracycline diverticulitis incendio costa allegra tegretol potassium iv to po conversion diltiazem estrazione dente e coumadin canzone allegra di de andre voltaren postpartum augmentin fa passare il dolore reminyl rilascio prolungato estrace applicator grams medicamento motrin 600 mg cardura categoria farmaceutica dove comprare levitra generico voltaren gel max dose sirve la sandia como viagra cipro-italia 1-2 benzac ricetta medica bula medicamento singulair 10mg ventolin pediatrico inhalador aprire conto deposito cipro naltrexone imodium interazione coumadin cialis antibiotico tipo augmentin ci vuole ricetta medica per viagra tegretol e dieta finasteride a giorni alterni équivalence risperdal xeplion a cosa serve la avodart albenza pediatric dosage for pinworms controindicazioni per cialis zovirax durante allattamento sertralina zoloft effetti collaterali lincocin fiale prezzo tretinoin cream dizziness nomi di viagra candida intestinale e diflucan tratamento erisipela cipro simile al viagra ma senza ricetta come prendere orlistat un euro di cipro acquisto viagra generico voltaren salbe forte sito affidabile cialis cefixime bambini albendazole pediatric dosing pinworm generici viagra cialis levitra voltaren gel blood pressure viagra sert a quoi cosa cura il prednisone voltaren retard bg augmentin antibiotico pillole me tome una viagra topamax effetti collaterali depressione cipro otologico interazione flomax pillola capitale di cipro nicosia abilify e insonnia assumere levitra scaduto calcular periodo fertil com clomid metoclopramide bahasa indonesia lioresal intratecal argentina bactrim posologie pediatrique voltaren velo evista effet secondaire effetti collaterali del farmaco femara zoloft e sonno generico do viagra sandoz augmentin contro i brufoli villa cipro 3 seroquel è un antidepressivo ambasciata cipro nord augmentin bustine dose bambini augmentin suspension pediatrico dosis cialis alle erbe funziona trazodone 50 mg pill avventure nel mondo anatolia e cipro panotile cipro 1.0 preis olanzapine diphenhydramine motilium composizione chi c è l ha fatta con clomid dove si trova il cialis po to iv conversion metoprolol cipro a febbraio risperdal intraveineuse effetti collaterali di topamax trombocid voltaren associazione viagra cialis uso clinico aciclovir peggioramento con zoloft proprietà del viagra albenza golf calendario gare software per dosaggio coumadin clomid e ovulazione forum diovan citrus ludoteca la tana allegra cernusco foros viagra generico vendita propecia originale che cos è il femara viagra con speed medicament lioresal 10 mg cipro - azia resort & spa ***** larnaca - cipro propecia primi risultati crise de goutte allopurinol colchicine contra indicaties viagra per infartuati depo provera cancer lawsuit voltaren compresse ricetta diovan no generic si può usare il ventolin in gravidanza appartamento via cipro milano effetti collaterali del norvasc seroquel 50 mg a rilascio prolungato opinioni cipro in nelspruit depo provera medical diflucan 150 posologia finasteride galenica torino norvasc e disfunzione erettile clozaril nz voli low cost per cipro larnaca aristocort triamcinolone acetonide cream 0.02 viagra pocelui zippy voltaren cefalea provera period stop compazine percocet è più efficace cialis o viagra orlistat alli acquistare furosemide effetti doping ventolin salbutamol 100 cataflam diclofenaco potássico remeron generic cost pompa di baclofen effetti collaterali viagra senza ricetta svizzera il viagra puo uccidere albendazole suspension usp voltaren gel 150 gramm clomid quando fare test di gravidanza viagra in italia cartia aspirin pregnancy zoloft e ipotiroidismo doxycycline e coli resistance qual è il prezzo del viagra metoprolol succinat ct 23 75 mg voli low cost cipro italia levitra 10 mg indicazioni estrazione denti e coumadin venta online viagra argentina preis voltaren dolo motilium 10 discontinued cipro pill color voltaren gel 150g cena remedio allegra tem corticoide ventolin semprot allegra printing in grand rapids mi differenza tra zoloft e efexor via cipro 112 brescia eczema and triamcinolone acetonide augmentin si probiotic quanto costa dulcolax quando cominciare il clomid wiki voltaren resinat campeggio la ballena allegra loratadine alavert quanto costa il taxi a cipro propranolol grasscity diclofenaco cinfa voltaren clomid blocca le mestruazioni succinato de metoprolol tem generico carafate suspension 100mg provera 10mg e gravidez viagra bisoprolol fumarate triamcinolone acetonide ulcer dove acquistare viagra sicuro voltaren y migraña cialis farmaco prezzo zofran pediatric suspension il ventolin fa male in gravidanza prednisone e glicemia voltaren gel 100g cena prezzo del plavix augmentin in quanto tempo fa effetto clima cipro nord giugno nitrofurantoin monitoring costo co diovan cialis 5 mg fa effetto sediaan chloramphenicol voltaren gel o flogoprofen dosaggio augmentin sciroppo bimbi claritin da somnolenta cipro vacanze cosa vedere voltaren creme test voltaren w uk voltaren resinat propranolol suspension ora blend decadron compresse+effetti collaterali triamcinolone acetonide cream usp 15g ampicillin dose in uti aciclovir creme efficace controindicazioni di avodart esperienze con cialis generico meglio augmentin o levoxacin lasix interazione con altri farmaci stanza singola roma zona cipro dottor allegra ortopedico roma voltaren retard 75 mg annostus augmentin dose per chilo propranolol varices mechanism seroquel da dipendenza principio ativo do cialis generico finasteride alopecia risultati escitalopram and lorazepam risperdal consta pharmacology voltaren mazilo motilium farmaco generico albenza epocrates strattera atomoxetine hci 25 mg noleggio auto paphos cipro come si sospende lo zoloft riccardo cuor di leone cipro musica allegra strumentale levitra orosolubile opinioni metoprolol accion farmacologica finasteride sovradosaggio allegra animalia posologia del aciclovir 400 mg voltaren su emorroidi allegra carteras nuovi prezzi del viagra cialis fine settimana periactin uso veterinario lipitor granuloma annulare perchè cipro è in crisi zestoretic e impotenza combivent posologia can prednisone cure a uti effetti collaterali del fosamax cipro curso costo ventolin salbutamol inhalers coumadin e pressione arteriosa co diovan en generico viagra scadenza brevetto cipro nascita di venere que significa levitra quanto costa il levitra orosolubile cipro vacanza agosto triamcinolone age spots co diovan forte 160mg/25mg invasione turca cipro pastilla caverta 50 ordinare cialis in italia apa itu chloramphenicol generic propecia proscalpin losartan o diovan quanto costa viagra da 50 xenical è mutuabile cipro 3 giorni antimicotici e coumadin banche presenti a cipro il cialis abbassa la pressione trazodone coma olanzapine dea schedule voltaren emulgel package insert triamcinolone acetonide emc provera in copd dulcolax la pisica levitra cialis viagra vergleich levonorgestrel gestodene desogestrel ou acetato de ciproterona depo provera endometrial cancer assenza ciclo dopo clomid sustituto viagra rocaltrol 0 50 prezzo crestor ramipril metoclopramide palliative care oltre al viagra protonix drip pediatrics voltaren gel al 3 centrifugeuse allegra x-12r remeron potenz propecia assuefazione voltaren pulled muscle date apparition viagra voli per cipro larnaca levitra confezioni da comprare levitra generico con postepay semi di lino e coumadin norvasc beta bloccante farmacodinamica do metoprolol cosa deve mangiare chi prende il coumadin muscoril voltaren iniezioni ristoranti cipro prezzi seroquel lento rilascio terapia con coumadin dosaggio allegra fornaca medicina lindeza orlistat alternative naturali al ventolin principio attivo augmentin sciroppo vendita immobili a cipro musica allegra con pianoforte propecia ed erezione lopressor protocol depo provera cramps no period voltaren peligros triamterene hydrochlorothiazide generic viagra levitra eller cialis escitalopram hiperico single dose cipro diarrhea interferenze alimenti coumadin ho preso il cialis e medicina viagra femenino dove è situata cipro prometrium e perdite bianche strattera piracetam linea attila cipro allegra quadriglia can viagra cure pe cipro pretoria office can voltaren gel cause constipation chi deve usare il viagra remeron foglio illustrativo lamictal dosaggio ematico tegretol calcium cialis uso continuo otite augmentin per quanti giorni nizoral conditioner zoloft muito sono lanoxin uso veterinario avodart compresse indicazioni voltaren actinic keratosis primperan metoclopramide hcl 2 6 mg colchicine epanchement pericardique voltaren 50 cena atarax per bambini depo provera and vitamin c toprol to metoprolol conversion problemi con propecia depo provera pregnancy rate seroquel smettere propranolol dose in variceal bleeding posso prendere cialis scaduto ventolin rotacaps voltaren 75 rapid evista fait grossir c è l euro a cipro differin ulcerative colitis musica allegra video matrimonio propecia sospensione levitra a quoi ça sert ziana post accutane differin pore minimizer aciclovir suspension ficha tecnica clomid negli uomini la pillola cialis viagra natural huang he venta cardura foglietto illustrativo alternativa naturale al cialis alimenti non consentiti per coumadin trazodone ambien combination risperdal consta 25 mg effets secondaires ventolin sirop strattera or concerta sotatic 10 metoclopramide viagra chinois prospecto risperdal consta voltaren cream sale combinar alcohol con viagra allegra d 180 mg posologia astrazeneca seroquel 100 mg nedir pritor 80 e cialis cymbalta dolori muscolari chlorambucil allopurinol come usare prometrium in gravidanza generico cipro xr import viagra schweiz symbicort e ventolin escitalopram tachycardia voltaren gel 1 amazon cymbalta costochondritis escitalopram 1 mg ten thuoc voltaren farmacologia del clopidogrel voltaren 75 mg cena allegra d sono co diovan muadili trazodone dialysis scopolamine and zofran dove comprare il cialis on line ventolin 100 volumatic methotrexate nella sclerosi multipla spiriva and ventolin voli per cipro da bologna 2 pastiglie di clomid strattera trichotillomania danazol y ovario poliquistico aciclovir fuoco di sant'antonio il clomid nell'uomo prontogest e prometrium insieme levitra uso giornaliero voltaren fl im cialis dura una settimana risperdal 0 5 vidal funcion medicamento allegra glimepiride pioglitazone metformin hydrochloride valori inr per coumadin prednisolone solone seroquel prolong spiegel cipro e i fenici aciclovir profilassi varicella voltaren iğne ne için zoloft debut difficile bugiardino prometrium 200 voltaren pilleri dermnet nz isotretinoin viagra e cardiomiopatia dilatativa augmentin post operatorio precio cytotec costa rica valzer della vedova allegra flauto dolce il cialis come cura a quoi sert le medicament neurontin cialis problemi alla vista triamcinolone acetonide iupac il viagra deve essere prescritto dal medico voltaren alebo ibalgin voltaren alzheimer cytotec colombia cali viagra effetti collaterali vista cosa conviene comprare a cipro ventolin e doping voltaren range levaquin prednisone tendon rupture citalopram e risperidone diovan faq promethazine seroquel clomid causa ritenzione idrica