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.


cialis 5 effetti collaterali bula medicamento singulair 10mg offerte volo cipro tegretol bipolar pregnancy effetto del coumadin viagra naturale dove comprarlo come mettere ovuli prometrium augmentin dosaggio bambini 25 kg dostinex e ricetta medica risperidone palliative care zoloft in allattamento temperatura isola di cipro allegra linea ersatzteile cipro-italia 1-2 siti affidabili per comprare cialis on line voltaren supp 50 augmentin per 12 giorni atarax posologie antihistaminique dose augmentin bambino 10 kg grotta di remeron varese cardizem rate control levitra diovan vre ampicillin sensibel voltaren aines augmentin prezzo farmacia propranolol esophageal varices risperdal tabletten dosierung voltaren rapid sivuoireet acquistare viagra con mastercard viagra.alle.bg мнения cialis quanto dura l'erezione arreter le strattera diovan 160 mg cena trazodone discontinuation taper artane 5 mg posologie pomada voltaren gel il viagra deve essere prescritto dal medico nitrofurantoin mono pregnancy augmentin va bene per i gatti viagra consegna in 24 ore principio attivo bactrim antibiotico natural progesterone vs provera abilify e insonnia diovan comp 80 mg 12 5 mg quanto costa levitra in farmacia link gente allegra dio l'aiuta deralin propranolol hydrochloride metoprolol contre indication quoi sert abilify medicamento diovan 320 escitalopram stada 10 mg opiniones abilify statt seroquel augmentin sciroppo concentrazione cialis 5 opinioni isotretinoin for granuloma annulare escitalopram digestion voltaren compound gel el generico del cialis triamcinolone seroma ventolin serve ricetta quando finisce il brevetto del viagra propranolol avlocardyl stress aciclovir ampolla colombia finasteride e calvizie femminile seroquel 150 rp scheda tecnica tronchetti provera intercettazioni took provera no period voltaren dolo posologie mobic generic cost cialis levitra viagra vergleich cipro itinerario effetti indesiderati di aldara crema inderal e attacchi di panico sale bianco di cipro che cos'è orlistat portare ventolin in aereo cipro spiagge tripadvisor risperdal piqure voltaren 12.5 diclofenac natr antibiotico bactrim principio attivo quanto costa un ventolin allegra co vaia apr provera statusa farmaco al posto del coumadin cosa serve il flomax is strattera a maoi allegra brigata potenza detrol la pharmacology a che cosa serve zoloft voltaren gel muscle aches risperdal consta dailymed remedio generico de viagra risperdal consta needle size ansia da prestazione cialis o viagra farmaco lasix...diuretico voltaren 100 mg ingredients aldara crema molluschi contagiosi voltaren rapid 100mg anafranil e ritenzione idrica allegra brigata asilo messina miglior sito per acquisto viagra remeron foglio illustrativo allegra infantil suspensão bula rimedio naturale al viagra placche in gola augmentin aerosol pulmicort atrovent tempi di somministrazione viagra trovare viagra a milano farmaco generico del seroquel sentenza cipro c. turchia chi non deve assumere il viagra dove e come comprare il viagra voltaren postpartum crestor 10 mg posologie arcoxia 90 mg prezzo paroxetine 20 mg posologie clomid per far tornare il ciclo foro viagra generico percentuale gravidanze con clomid digoxin si calciu dove acquistare proscar aceon perindopril arcoxia compresse prezzo cipro uti mg pillola che sostituisce il viagra ci cipro 55 sale chi non può prendere il viagra sito affidabile cialis generico do claritin d comprimido aciclovir crema indicazioni informacion medicamento viagra dove comprare cialis generico online aprire un'azienda a cipro effetti voltaren in gravidanza caverta india price ovaie multifollicolari e clomid cardizem farmacocinetica generico del propecia aldara price in india remeron interazione con altri farmaci pvp escitalopram 10 mg strattera medicament pret astrazeneca seroquel 100 mg nedir voltaren rapid sachets posologia voltaren intramuscolo augmentin senza lattosio ficha farmacologica del metoprolol allegra infantil 6 mg ml cipro delusione xenical receta medica chile case vacanze e appartamenti cipro viagra tempi assunzione protonix generic dose prograf chiapas escitalopram zulassung abilify a cosa serve varicocele e propecia viagra vendita online svizzera levitra generico farmacia italiana lariam effetti indesiderati avapro statin edificio altace pemex voltaren child dose noleggiare auto cipro nord quante ore dura l'effetto del viagra singulair composizione cialis online italia contrassegno ventolin hfa aer generic cialis succo di pompelmo voltaren dispers novartis pharma beipackzettel voltaren emulgel 2 generico gioielleria allegra san teodoro isoptin foglio illustrativo volo per cipro da roma voltaren pilule vicio viagra risperdal vs invega allegra xarope infantil preço depo provera pote aciclovir crema funziona zovirax crema per genitali effet secondaire du medicament cytotec seroquel potenzprobleme naltrexone imodium voltaren o brufen trazodone savella orari tana allegra cernusco allegra cuzzocrea voltaren ophtha pris lasix quante volte al giorno propecia trattamento cymbalta 30 mg confezione lega calcio cipro triamcinolone acetonide application levitra eruzione cutanea principio ativo do allegra 180 il viagra alza o abbassa la pressione salon allegra novi sad allegra turismo santa cruz do sul depo provera metodo anticonceptivo generico do viagra principio ativo propecia assuefazione epilessia gravidanza tegretol ciprofloxacin for uti duration tricor sacramento finasteride e pillola anticoncezionale esomeprazole clopidogrel 2011 tronchetti provera massoneria chi usa il topamax meglio di propecia è meglio levitra o viagra combinatie ritalin en risperdal propecia tumore prostata el anticonvulsivo dilantin strattera.nl viagra naturale omeopatia quali sono le dosi del viagra clozaril poisoning propecia 1 mg funziona abilify e prolattina aciclovir per varicella nei bambini augmentin interferisce con yaz furosemide conversion po to iv colchicine contra indicaties tempi di azione augmentin serophene gravidez gemelar zovirax crema bugiardino diflucan per unghie uso di finasteride ciclo mestruale dopo il clomid carvedilol metoprolol conversion ludoteca tana allegra cernusco cipro vacanze prezzo qual o generico de cymbalta traghetti turchia cipro nord cosa non posso mangiare con coumadin viagra dubai verboten elavil pronounce coumadin e latte in polvere strattera schizoaffective disorder comprare cialis senza problemi dogana fludrocortisone prednisone conversion terapia con coumadin dosaggio cuanto vale benzac triamcinolone acetonide on pimples triamcinolone acetonide inhalation aerosol anguria effetto viagra cipro stomach medicine avodart compresse indicazioni medicamento de allegra triamcinolone acetonide pharmacology aciclovir interaccion con alcohol notice du medicament zoloft bisoprolol et cialis augmentin per bambini prezzo risperdal e allucinazioni risperdal quicklet 2 tinidazole pediatric dosage cialis 20 mg diviso bula do voltaren gel voltaren grageas 75 mg escitalopram colombia dosaggio giornaliero cialis voltaren retard bg voltaren gel controlled substance provera lungo dora torino cialis farmacia ricetta escitalopram 1 mg tegretol e iponatriemia singulair farmaco generico effet secondaire zoloft 50 mg pronunciation triamcinolone acetonide levitra mezza compressa cialis e ansiolitici conjunto cozi-pasta tramontina allegra opisthorchis viverrini albendazole orlistat nutricionista levaquin cipro same viagra e mal di stomaco effetti da sospensione da zoloft acquistare kamagra in svizzera cialis problemi psicologici budesonide vs prednisolone for ulcerative colitis stosa allegra opinioni diovan comp 160/ 25 mg allegra d dayquil quanto costa voltaren pastiglie tegretol cr e gravidez dose giusta viagra voltaren gel and citalopram canzoni di natale allegra voltaren doccheck baclofen meccanismo d'azione viagra generico online miglior prezzo total tv provera racuna otite media e augmentin de grisogono allegra price inderal nome generico prazosin incontinence voltaren uso oftalmico triamcinolone in dogs triamcinolone acetonide cream underarms viagra feminino o globo prezzo viagra orodispersibile voltaren chinese name ventolin e clenil prednisone perianal abscess precio mestinon argentina methotrexate tempi di risposta finasteride acquisto propranolol coq10 base musicale vedova allegra augmentin fiale intramuscolo ho preso il cialis e barca allegra usata augmentin dose per chilo lipitor diverticulitis aciclovir pastiglie ricetta propranolol grasscity benzac in farmacia allegra animalia ampicillin sodium salt biochemica diflucan a stomaco pieno atarax sospensione orale preturi voltaren pastile arginina meglio del cialis triamterene hydrochlorothiazide generic a quoi sert le prednisolone sandoz distanza milano cipro voltaren mandeloperation voltaren zuby chloramphenicol mazilo cipro base militare cialis senza ricetta in italia la vedova allegra le sirene del ballo motilium lingual posologia strattera bugiardino quando ovulazione dopo clomid dosaggio aciclovir per varicella a quoi sert le cytotec studio provera moncalvo ventolin pediatrico inhalador servizio iene viagra anafranil e fertilità maschile augmentin e lampade abbronzanti augmentin prezzo bustine celebrex per mal di schiena clomid scatola voltaren compresse ginocchio dulcolax dopo quanto fa effetto cipro posti più belli voltaren dna moczanowa metoprolol succinate espanol composizione zovirax crema accutane paronychia lisinopril fosinopril comparison diflucan per candida genitale cipro casa affitto minocin 100 mg controindicazioni cipro 500 antibiotico dipyridamole pet scan venta cytotec santiago chile coumadin è un anticoagulante milano nicosia cipro depo provera period dark brown stimolazione ovarica con clomid lo ultimo del viagra cipro isola cartina zovirax bambini posologia clomid e nessun sintomo risultato cipro romania u21 airtal o voltaren campi golf cipro alternativen zu risperdal augmentin quante volte al giorno trombocid voltaren augmentin antibiotico infezioni ginecologiche patente italiana a cipro cosa succede se prendo il viagra scaduto cosa serve il levitra lisinopril to fosinopril conversion tempio di apollo cipro allegra quadriglia dove acquistare viagra generico online voltaren gel narcotic nolvadex e progesterone viagra slovenia ricetta salep voltaren gel voltaren tunnel carpien le nozze di figaro actos bb via cipro roma risperdal vs saphris viagra sintomi voltaren proibido brasil finasteride generico prezzo differin ulcerative colitis sertralina zoloft fa ingrassare lincocin mal di gola effetti collaterali di moduretic aciclovir sospensione torrino cipro artigianato locale diovan gleich valsartan significato dei nomi allegra cialis 5 mg quando prenderlo voltaren cepici 12 5 mg olanzapine dea schedule effetti collaterali voltaren compresse cleocin foglio illustrativo diovan generic date 2012 viagra campione gratuito forum viagra naturale per donne triamcinolone cream grams cialis contiene glutine prednisone e glicemia patellar tendonitis cipro efficacia di propecia scopolamine vs meclizine scopolamine and zofran diovan hct 320 25mg generico ville cipro nord voltaren cream rash cipro linea di frontiera pillola estinette e antibiotico augmentin cialis generico in farmacia italiana lariam depression come si usa aldara zantac mercola citta isola cipro conversion diovan losartan acquistare viagra con pagamento alla consegna lamisil or lotrimin for tinea versicolor seroquel prolong reduzieren is voltaren rapid 12.5 an anti inflammatory lioresal singhiozzo norvasc e effetti collaterali dopo quanto tempo fà effetto il viagra meglio repaglinide o metformina generische cialis professional 20 mg voltaren creme günstig coumadin ed estrazioni dentarie zoloft e tensione muscolare prezzo del cialis in svizzera precio differin crema dopo quanto tempo funziona il viagra paroxetine incontinentie provera solventnosti firme posologie prednisolone 20 mg allergie alimentazione in trattamento con coumadin effetti collaterali levitra 5 mg lasix sospensione off provera no period xenical ci vuole la ricetta allopurinol 300 craveri retard evoluzione casa roma via cipro non stimulant strattera levitra cialis viagra confronto copegus controindicazioni augmentin si può usare in gravidanza atarax posologie allergie metoprolol succ er 100 mg t definitie viagra pil voltaren rapid 25 asthma prezzo cialis 5 mg farmacia vimovo voltaren dove trovare cialis senza ricetta problemi con propecia zoloft toglie la fame che cos è il femara viagra generico in italia quando furosemide 25 mg prezzo nazionale rugby cipro consolato di cipro italia nitrofurantoin oral suspension price controindicazioni aciclovir varicella seroquel provoca sonnolenza trimox azitromicina come si usa il clomid viagra consumo diario meclizine potentiate hydrocodone decadron compresse+effetti collaterali prezzo del benzac detrol la 4mg cost clomid ricetta bianca noleggio auto cipro sud suprax colonoscopy prep diflucan 150 come si prende mal di schiena brufen o voltaren effetti indesiderati con clomid arava farmaco biologico olimpiadi londra 2012 viagra viagra scade brevetto clomid dal 6 giorno methotrexate e rettocolite ulcerosa coumadin interferenze farmacologiche lopressor xl generic name finasteride dermatologia a cosa serve il farmaco cialis dosaggio aciclovir herpes genitale discontinuing escitalopram strattera precio farmacia