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.


che lingua parlano a cipro pletal generic cilostazol a cosa serve il medicinale flomax voltaren k in combinatie met paracetamol allegra co vaia allegra infantil 6 mg ml nitrofurantoin uti guidelines cloridrato de propranolol 40 mg comprimido moneta 2 euro cipro 2008 valore voltaren pastiglie 25mg il cialis provoca diarrea a cosa servono le compresse di cialis voltaren salbe 180g lisinopril e impotenza coumadin e aglio exelon foglio illustrativo harga levitra di indonesia suprax colonoscopy prep cipro antibiotic while pregnant effetti sovradosaggio seroquel propranolol et hypotension lancia allegra usata cat costa un sampon nizoral cipro glutathione cymbalta 60 mg è mutuabile risperdal og ritalin cialis 10 e 20 mg opinioni risperdal consta precaution chlorothiazide to hydrochlorothiazide dose conversion giramondo cipro augmentin sciroppo bambini 35 ml il farmaco cardura a cosa serve noleggio auto cipro sud quanto costa il levitra orosolubile lincocin gravidanza el viagra colombiano levitra diovan olimpiadi londra 2012 viagra risperdal et uv quanto costa il lamisil esiste cialis generico italia motilium domperidone suspension fluocinonide and triamcinolone acetonide offerte cipro aprile 2014 meglio fostimon o clomid come aumentare effetto viagra aciclovir esposizione sole la vedova allegra banda allopurinol 300 craveri retard cipro spontaneous bacterial peritonitis allegra santomauro effetti collaterali norvasc 5 mg prednisone discoid lupus lupin tricor generic zantac nei neonati viagra tempi assunzione prednisolone comprimé orodispersible benzac ac precio argentina viagra generico a napoli cipro - azia resort & spa ***** larnaca - cipro indocin dizzy costo volo per cipro dilantin periodontitis il viagra fa male alle donne escitalopram bagó vista allegra in ischgl plavix indicazioni esclusive per quanto tempo si può prendere lo zoloft methotrexate e stanchezza diflucan 150 2 compresse prezzo allegra vista ischgl tretinoin gel color cialis fa male alla salute eucerin triamcinolone il cialis aumenta il psa date sortie cialis colchicine antimitotic agent cipro presidenza europea finasteride funziona sempre costo del zovirax voli per cipro da italia propranolol lyrica interaction preis voltaren tabletten levitra generico farmacia italiana l allegra ortografia de grisogono allegra price nizoral comprimate in sampon ampicillin denature temperature trazodone mild antidepressant ludoteca la tana allegra cernusco voltaren gel cold sore trazodone unisom reazione allergica antibiotico augmentin campeggio la ballena allegra menstrual migraine depo provera effetti di viagra dieta da seguire per coumadin quanto costa cialis 5 mg in farmacia che tipo di farmaco è il seroquel lyrica cymbalta neurontin metoprolol ramipril combination brands provera vaccine budesonide to prednisone conversion voltaren retard con alcohol arimidex senza piano terapeutico vanzari viagra cialis interazione augmentin estinette a cosa serve la avodart alimenti per chi prende il coumadin come diminuire seroquel il clomid fa dimagrire budesonide vs prednisolone for ulcerative colitis compazine pills pillole simile al viagra proprietà del levitra wellbutrin e depressione bipolare prednisone conversion iv po trazodone in dementia alimenti da evitare quando si assume il coumadin voltaren topical gel crestor non generic bactrim sciroppo per canarini dosi depo provera personal stories arcivescovo ortodosso cipro lamictal sospensione improvvisa propranolol 10 mg posologie male uti cipro dose prednisone anticoagulanti cumarinici bugiardino voltaren 100 mg pastilla caverta 50 diflucan candida prezzo natural progesterone vs provera viagra senza ricetta costo affitto monolocale roma cipro aciclovir compresse controindicazioni come prendere diflucan 200 toprol to metoprolol conversion sciroppo ventolin per bambini clopidogrel e fibrillazione atriale voltaren gel and citalopram voltaren 50 mg + alvedon diovan gleich valsartan ditropan effetti collaterali trittico trazodone 100 mg antibiotics tinidazole concor und cialis comprare finasteride in italia clozaril medication schizophrenia nadolol propranolol portal hypertension crestor generico portugal metro cipro musei vaticani roma medicamento rocaltrol agence immobiliere arava bactrim forte allattamento voltaren 75 gram dove acquistare viagra in italia sale nero cipro proprietà associazione tarquinia allegra augmentin bambini frigorifero voltaren gel generic name xenical è stato tolto dal commercio prednisone 20 contre indication abuso viagra disfunzione erettile edificio villa allegra cabo frio quando usare il ventolin provera pergotime metoprolol caraco voltaren 75 mg diclofenac arava farmaco biologico effet secondaire crestor 10 mg terme di afrodite cipro cialis gaziantep feldene fast ci vuole la ricetta viagra por internet opiniones miglior sito per acquisto viagra mitologia di cipro dosaggio augmentin sciroppo bimbi propecia utilizzo tenormin fda approval come acquistare il viagra in farmacia viagra sordità cialis alle erbe opinioni voli bologna cipro low cost cialis 5 mg generico contrareembolso voltaren hernia de disco ciclo mestruale dopo il clomid tegretol mood stabilizer dosage aprire una ditta a cipro lamisil spray indicazioni sito sicuro cialis generico lombalgia e voltaren voltaren per ginocchio risperdal alpträume voltaren 70 mg ziana post accutane dulcolax dopo quanto fa effetto minocin per i brufoli il principio attivo del viagra viagra.alle.bg мнения femara puregon iui success funziona meglio il viagra o il cialis lisinopril gicht cipro prodotti tipici benzac ac 10 cost triamcinolone acetonide .5 cream augmentin antibiotico ogni quante ore dutasteride e tumore prostata losartan avapro conversion methotrexate somministrazione dipyridamole sigma aldrich provera pavimenti torino provera dosage to induce period tumore alla prostata cialis influenza intestinale augmentin generico do medicamento motilium cytotec venta en chile santiago iniezioni intramuscolari e coumadin clorhidrato de propranolol 10 mg voltaren gel 2012 quando prendere il clomid procardia postpartum hypertension chiamare cipro dall'italia esiste un farmaco alternativo al coumadin cleocin crema e pillola allegra agencia turismo alli orlistat miglior prezzo distanza milano cipro compra viagra originale on line cialis originale o generico viagra che significa voltaren eof prometrium uso orale in gravidanza diflucan 150 come si prende voltaren jicht cipro last minute agosto case vacanza a cipro remedio allegra d serve augmentin fa passare il dolore usare il ventolin fa male cipro chiede aiuti triamcinolone acetonide cream for molluscum contagiosum cialis aumento desiderio viagra e cibo cialis brevetto scadenza incendio cerro calan cipro storage temperature dulcolax suppository pediatric dose villaggio callisto cipro ma il cialis funziona la vedova allegra flauto dolce voltaren iv natriumbicarbonaat viagra e anticoagulanti lioresal singhiozzo quanto costa voltaren crema motilium nombre generico équivalence risperdal xeplion caratteristiche del viagra farmaco con finasteride assistenza braun roma via cipro storia del viagra crestor si alcool qual o generico de cymbalta notizie sul viagra minocin 100 mg minociclina cloridrato dose of tinidazole in giardiasis medicamento differin 0 3 dostinex pillola anticoncezionale risperdal milchfluss nome commerciale del prednisolone nuovo farmaco in sostituzione del coumadin viagra compresse 50 mg prezzo informazioni su viagra clomid bruno farmaceutici voltaren coupon gel cipro nella comunità europea differin gel foglio illustrativo caverta india price kreuzallergie penicillin ampicillin agenzia viaggi via cipro brescia medicament crestor 5 mg in spagna serve la ricetta per il cialis cipro quin 500 mg forum si trova cialis in farmacia eszopiclone escitalopram opisthorchis viverrini albendazole gonfiore dopo puntura voltaren viagra a domicilio capital federal 2013 allopurinol 300 mg posologie viagra dosi giornaliere prevacid solutab alternative dosaggio coumadin secondo inr diltiazem er 120 mg cost difference citalopram escitalopram costa nord cipro provera pill to delay period prinivil effetti collaterali 2 pastiglie di clomid cipro generics coumadin ed estrazioni dentarie viagra senza effetto clomid dopo raschiamento voltaren rapid medsafe viagra peremption crème aldara efficacité voltaren dolo liquid 12 5 voltaren compresse indicazioni terapeutiche musica allegra fisarmonica clomid e follicoli che non scoppiano perchè cipro è in crisi arznei metoprolol cymbalta compresse prezzo lasix compresse somministrazione voltaren alzheimer crestor 10 mg pret farmacia dona quante punture di voltaren differin crema effetti costa allegra in vendita dove acquistare viagra online sicuro provare viagra tegretol e fibromialgia define compazine claritin loratadine antihistamine hotel villa cipro a venezia lido a che serve il viagra volare a cipro con ryanair maxalt e pillola anticoncezionale reazione allergica all augmentin divisione isola di cipro voltaren dolo cerotto termico prezzo arava immobilier grenoble zyprexa farmacologia sito sicuro per acquistare cialis forum voltaren usa price aciclovir eg in gravidanza anafranil 75 farmaco risperdal consta pris glucophage nierinsufficientie depo provera period dark brown abilify 10 mg effetto indesiderato triamcinolone cream 80gm zoloft e ansia sociale medicament prednisolone sandoz 20mg clobetasol propionate vs triamcinolone acetonide nitrofurantoin 25mg 5ml oral suspension viagra 25 effetti aviane alesse generic triamcinolone acetonide ampoule allegra gianclaudio cipro sulla mappa precio strattera 25 mg pomata di nistatina-triamcinolone acetonide lisinopril vs diovan prednisolone zentiva cortisone diflucan 2 pasticche viagra soldaten levitra compresse orodispersibili prezzo allegra 180 composicion anafranil rivotril generico de allegra pediatrico nome generico de diltiazem ricette di cipro nizoral crema per capelli bugiardino del seroquel voltaren soluble augmentin prima delle 12 ore prandin generic date che cos è il dostinex risperdal tdah prezzo ventolin farmacia prednisolone+clioquinol cialis farmaco prezzo glibenclamide metformin combination cytotec contiene mifepristona clomid 50 mg prezzo qualcuno ha provato alli orlistat farmacia cialis generico viagra legnica cipro immobili vendita seroquel 50 mg a rilascio prolungato opinioni triamcinolone occhio compresse a base di aciclovir furosemide metolazone timing cuanto vale benzac trazodone generic name succinato de metoprolol tem generico farmacologia del clopidogrel i am allergic to voltaren voltaren and grapefruit penzioni fond provera staza voltaren ilaç 75 mg tinidazole pid benzac funziona per i punti neri levitra senza effetti collaterali viagra della pfizer empório tavola allegra antibiotic cipro alcohol elenco cibi da evitare con coumadin compatibilité cialis viagra viagra controindicazioni ipertensione triamcinolone acetonide anus fluocinolone acetonide 0.01 hydroquinone 4 tretinoin 0.05 cream thuoc boi ngoai da voltaren diovan generic patent prednisolone chlorphenamine histacort acquistare kamagra in svizzera imodium e aspirina lasix 25 indicazioni ogni quante ore posso prendere augmentin il flomax è un fans cena crestor 20 mg muscoril e voltaren fiale precio mestinon argentina trombosi e cialis trazodone savella voltaren picaturi oftalmice propecia ricetta non ripetibile voltaren gel 1 amazon aglio e cialis propranolol serotonina como se aplica la crema differin sintesi diltiazem voltaren dosing card elavil cardiac tronchetti provera intercettazioni sospensione abilify propranolol berotec prednisone and tinea versicolor pfizer viagra brevetto levitra meglio a stomaco vuoto periodo fertil apos serophene viagra price sulit musica allegra rheden pasticceria siciliana via cipro roma cmi voltaren rapid gioielleria allegra san teodoro clomid e ovulazione forum augmentin infezioni dentali bupropion quetiapine combination allegra duerre aldara price in india hidroclorotiazida captopril glibenclamida e metformina acquisto viagra sicuro qual o laboratorio do benicar voli charter italia cipro moduretic effetti indesiderati cipro società holding norgesic or voltaren feldene per il mal di schiena amiodarone et citalopram bologna cipro aereo zovirax per occhi escitalopram in menopause nizoral shampoo per funghi novo prednisone chien triamcinolone 0.1 cream 454gm unito lettere allegra prednisolone loratadine dulcolax poop prison zovirax esposizione al sole viagra chiclete augmentin prezzo bustine lioresal 25 mg pret compensat voltaren suppository ingredients controindicazioni del topamax gruppo musicale russo viagra voltaren gel 150 gramm la bufala allegra pizzeria seroquel 150 rp scheda tecnica nolvadex 20 mg controindicazioni aldara senza prescrizione oq significa viagra generic cialis nederland aciclovir genericon 5 creme cipro cosa comprare risperdal 0.5 mg tabletten avodart caduta capelli bufala allegra roma via orazio scintigrafia con test al lasix risperdal bei asperger controindicazioni di avodart motrin suspension infantil vademecum nitrofurantoin discussion voltaren uso oftalmico allegra lenceria viagra nome generico albenza almenno clomid blocca le mestruazioni durata tratament crestor significato dei nomi allegra farmaci base di prednisolone allegra gicla cipro nord spiagge farmacologia del atrovent levitra generico venezuela cialis quando si prende dostinex quanto dura la cura nizoral shampoo in gravidanza norvasc e effetti collaterali levitra uso giornaliero isola di cipro turisti per caso