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.


colchicine demie vie zovirax sciroppo prezzo motilium 10 mg suspension topamax sonnolenza dostinex durante il ciclo vermox sciroppo effetti collaterali buzzi stanza allegra differin 0 3 gel generico dulcolax lassativo controindicazioni antibiotic nitrofurantoin macro camere in affitto roma cipro escitalopram oxalato interacciones cialis generico blog propranolol corta efeito anticoncepcional diltiazem clorhidrato nombre comercial voltaren fitil fiyat clomid ritardo mestruazioni viagra e assuefazione allegra d ou generico l augmentin va bene per la candida bere alcolici con augmentin limassol cipro cap costo maxalt con ricetta mefloquine doxycycline or atovaquone/proguanil ( malarone ) logo voltaren levitra orosolubile scheda tecnica lopressor toprol conversion olanzapine chlorpromazine e meglio il viagra o il cialis diovan go generic diflucan insufficienza epatica dolo-voltaren diclofenac allegra pediátrico 6 mg bula metoprolol succinate to carvedilol conversion si può prendere il cialis scaduto triamcinolone acetonide lcms cipro centrale elettrica compazine dose migraine levitra orosolubile crea dipendenza cialis generico lo vendono in farmacia finasteride ricrescita capelli medicaitalia via cipro 17 brescia roche rocaltrol calcitriol augmentin dosage for periorbital cellulitis triamcinolone acetonide cream anti itch caravane allegra 475 broncovaleas o ventolin voltaren emulgel pericoloso lo zoloft è uno psicofarmaco posologia aciclovir herpes labial clomid e dolori ovaie aciclovir compresse prescrizione noroxin 400 mg leggi le opinioni perchè topamax fa dimagrire voltaren dolo liquid 25 meglio propecia o trapianto voltaren retard infarmed miniprep ampicillin concentration cialis farmaco a cosa serve cipro codeine risperdal per quanto tempo clomid stomaco pieno nizoral suomi24 lopressor dizziness come applicare voltaren emulgel zoloft aumenta la pressione mucca allegra prezzo cialis 20 mg in farmacia voltaren dispers geigy cucine stosa allegra prezzi farmacodinamia aciclovir metoprolol succinate er watson labs costo viagra in svizzera cipro invented generic bupropion anchen tenormin discontinuation triamcinolone generic name ventolin inhaler pediatrik doz augmentin antibiotico bambini compresse effetti collaterali al viagra cipro stool color cipro temperatura a ottobre nome cientifico do voltaren trazodone indigestion farmaco aricept 5 mg altace cost alimentazione con farmaco coumadin risperdal mi ritalin mi zantac pepcid conversion trental 400 indicazioni escitalopram erowid vault il cialis si puo' acquistare in farmacia biglietto aereo cipro riccardo allegra offerte pacchetto cipro aldara non fa effetto finpecia cost cialis analisi del sangue propecia chi lo usa cipro infeccao intestinal secondo ciclo di clomid andare in vacanza a cipro allegra pediatrico 60ml preço cipro tendon rupture percentage cialis ogni 24 ore interazione coumadin e farmaci feldene iniezioni prezzo traghetto istanbul cipro clopidogrel e intervento chirurgico metoprolol con cerveza aciclovir pastile cat costa olanzapine iv to po conversion meglio viagra o altro cialis e pressione bassa viagra contro l'ansia da prestazione viagra bei normaler potenz zetia scheda tecnica conversione betamethasone prednisone aerosol ventoline atrovent pulmicort zoloft aumento dell'ansia triamcinolone acetonide pupps allegra glatzer differin vitamin c clomid e cisti ovariche voltaren fiale monografia danazol 200 capsule ancona cipro ventolin spray a cosa serve aumento di peso con anafranil cipro coste buffetti roma cipro cialis funziona poco sandoz clozaril can nitrofurantoin cause dizziness diflucan 150 funziona diltiazem infusion svt voltaren retard 150 depo provera costo colombia si può assumere cialis e viagra insieme posologia voltaren ofta a quoi sert kamagra foro de strattera clomid niente ciclo triamcinolone alternatives risperdal au maroc benzac prezzo in farmacia mezclar voltaren y ibuprofeno cipro agosto all inclusive quando usare il lanoxin voltaren gel lumbar risperdal consta buy paxil diverticulitis discussioni su levitra contrattura muscoril o voltaren pastiglie di voltaren allopurinol 100 zentiva cialis generico similares comprare accutane clomid e sintomi ovulazione lioresal narcotic cloridrato de diltiazem 30 mg bula decameron allegra brigata proscar caduta indotta provera stanja na racunu societe generale orlistat generico precio peru cipro aeroporto principale effet secondaire chibro proscar voltaren gel gravidanza differenza kamagra e viagra diclo ratiopharm voltaren anafranil trastorno bipolar linee guida sospensione plavix diflucan tempo effetto provera racuna societe generale anafranil disturbi sessuali crestor 10 mg posologia cipro 500 mg ne ilacı cerati usaba viagra viagra dla pań opinie ranitidine non prescription augmentin bambini opinioni ingrediente activo del voltaren allegra roberti clomid blocca il ciclo risperdal consta deaths allegra d generic alternative viagra nell'acqua film viagra ed i suoi effetti deralin 10 propranolol brevetto levitra scadenza dutasteride e ginecomastia viagra biologico viagra fa male ai giovani hormone prometrium effet secondaire el voltaren contiene aspirina medicamento propranolol de 10 mg generico viagra nomes prezzo del cymbalta cozi pasta allegra voltaren sr fiyat interazione cortisone coumadin trazodone fiale alternativa natural al ventolin metoprolol succ price che cosa 'è la viagra voltaren ili brufen cytotec farmatodo venezuela come funziona benzac crestor venezuela clomid allattamento rocaltrol in pregnancy clomid eccipienti arimidex e capelli nizoral shampoo effetti indesiderati voltaren resinat vergleich voltaren dispers trazodone nicotine colchicine chondrocalcinosis differin crema posologia viagra facmed unam cipro nord passaporto viagra schedule dea prednisolone and cerazette generico do viagra-citrato de sildenafila spiagge polis cipro posologia vermox bambini decadron aumenta a glicemia via cipro 8 roma alli orlistat vendita effetto antabuse cos'è quando arriva viagra generico cialis rischi per la salute farmacocinetica lincocin metoprolol 25 mg generico estrace suppositories nitrofurantoin mrsa uti cialis + 20 gratis tegretol e orticaria benazepril lisinopril conversion proscar ricetta bianca cymbalta inizio terapia celtium escitalopram metoclopramide aspirin voglio provare viagra viagra 25 mg non funziona triamcinolone and clotrimazole ventolin per tosse secca lioresal 10 prezzo varicella e aciclovir adulti cipro vacanze 2013 voltaren pinzamiento dove si trova viagra il clomid fa ritardare il ciclo augmentin in allattamento risperdal consta libido cialis confezione da 28 augmentin antibiotico in bustina suprax foglio illustrativo prednisolone chat posologie foglio illustrativo di augmentin lasix come prenderlo betamethasone prednisone conversion avodart in farmacia diflucan candida quanti giorni adalat 10 mg in gravidanza furosemide dosaggio cane triamcinolone ulcerative colitis pt chiara allegra living il viagra aumenta la libido voltaren dispers 46.5 mg allegra varron kamagra viagra differenze trazodone dosage for schizophrenia medicamento dramamine dimenhidrinato parrocchia albenza tegretol cr 400 novartis prometrium 100 mg prezzo lasix diuretico a cosa serve quanto cialis si puo assumere zoloft 50 mg indicazioni tegretol 400 argentina paseo via allegra utilizzo del voltaren depo provera muscle deterioration depo provera period pregnancy xenical pillole dimagranti lamisil at tinea versicolor cuanto vale voltaren emulgel foto della pillola viagra cialis tadalafil prezzo la vedova allegra fasano diflucan per 10 giorni voltaren fiale im cialis rossore al viso prevacid solutab dosage pediatric foto di cipro grecia dramamine pediatrico gotas è scaduto il brevetto viagra viagra o viagra generico generico amoxil bd motilium sciroppo per neonati voltaren dolo 12 5 mg beipackzettel medicament pour la goutte colchicine clomid e colica strattera und pille medicamento levitra 10 mg clomid progesterone grossesse prometrium quando le mestruazioni metoprolol succinat-ct 47 5 mg beipackzettel prendere mezza pasticca di viagra metoclopramide sciroppo sintomi di astinenza da anafranil propranolol cyp inhibition voltaren guatemala principio ativo provera prednisone in pericarditis tomar nolotil con voltaren b&b roma vicino metro cipro fisiocrem o voltaren turisti per caso cipro bella vacanza cipro nizoral pomata indicazioni j'ai arreter le risperdal lisinopril prontuario propranolol uso clinico remedio orlistat ultrafarma differenza tra zovirax e vectavir medicamento albenza escitalopram dipendenza cisti ovariche dopo clomid camper ci cipro 1 femara compresse effetti collaterali cipro nord appartamenti cap via cipro 4 roma giudizi sul cialis depo provera sore arm cipro è bella leggende di cipro alimenti consentiti con coumadin autobus termini cipro mal di gola meglio oki o flomax prezzi in farmacia del viagra quanti follicoli si producono con clomid tegretol e dimagrimento quanto dura effetto del viagra dostinex+sospendere allattamento escitalopram qt intervall effetti collaterali viagra generico viagra per donne in polvere voli diretti da roma a cipro ibu 600 oder voltaren frasi la vedova allegra triamcinolone acetonide ointment lichen sclerosus dopo quanto fa effetto il cialis come assumere cialis allegra gliwice opinie diflucan interferisce con la pillola chiste loro viagra plavix generico prezzo levitra generici ciclosporina e diltiazem malassezia folliculitis nizoral cialis va preso a stomaco pieno rimedi naturali come il viagra singulair 4 mg effetti indesiderati prevacid solutab cost frasi ironiche sul viagra propranolol in upper gi bleed clomid e azoospermia dove sono le spiagge piu belle a cipro levitra originale 20mg triamcinolone acetonide inj nos quanto costa una pasticca di cialis madopar e sinemet differenze prezzo finasteride generico imodium propranolol metoclopramide bambini cipro gi problems cipro spiaggia delle tartarughe propranolol contraceptif placche alla gola flomax macelleria allegra torino per quanto tempo usare zoloft prometrium per via orale in gravidanza voltaren e inzitan cuando falla la viagra metoprolol succ er alcohol farmaci sostitutivi al coumadin allegra giordano consigliatemi una canzone allegra vizarsin o viagra cipro 15 occasion off depo provera no period carta identità con timbro cipro ancor vantin voltaren fct xenical ritirato dal commercio unterschied voltaren voltaren dolo cialis generico a napoli prezzo viagra generico dose giusta di levitra nuovo cialis one day nizoral comprimé posologie augmentin antibiotico e diarrea nuova opel allegra detrol la generic date ordine avvocati cipro bactrim 80 mg sospensione orale zyrtec antialergico pediatrico unterschied seroquel prolong und quetiapin retard adalat crono gonfiore provera noleggio differenza tra clomid e serofene does cipro come in liquid form a quoi sert crestor 5 mg posso comprare cialis svizzera senza ricetta cialis 5 ml prezzo augmentin 875 mg + 125 mg polvere per sospensione orale - bustine vendita on line cialis in italia tegretol carbamazépine 200mg voltaren und opipramol escitalopram metoclopramide differenza tra ventolin e flixotide viagra quanto costa farmacia motilium e colite depo provera in perimenopause passaggio da cipro sud cipro nord generico do micardis 80 mg cipro dizziness nausea lariam quinolone effetti dopanti del viagra olanzapine cinv diovan medication generic risperdal 4 mg effet secondaire use of voltaren suppositories voltaren g6pd deficiency effet secondaire prednisolone chat aciclovir doc foglio illustrativo aglio al posto del viagra savella cymbalta comparison prezzo avodart (dutasteride) cialis da dipendenza come mettere il viagra effetti collaterali assunzione cialis seroquel foglietto illustrativo cipro pesca subacquea tinidazole dosage for giardiasis come prendere feldene fast mobic per sciatica viagra dosaggio consigliato il viagra nelle donne medikamente lioresal augmentin pediatrico causa diarrea inderal compresse costo voltaren gel 1 100g price meglio coumadin o cardioaspirina hydroquinone triamcinolone tretinoin muscoril e voltaren insieme oral prednisone alopecia areata il viagra fa male alla pressione voltaren salbe analthrombose dostinex fa venire i brufoli anafranil nome generico protocollo diflucan pyrazinamide hyperuricemia allopurinol t cap via cipro ventolin atrovent pulmicort isi dari combivent viagra a domicilio rosario depo provera cellulite l'occupazione allegra trazodone adrenaline anafranil 25 effet secondaire bactrim forte sciroppo bambini avodart per la prostata clopidogrel genericon foto trattamento finasteride cipro turista fai da te levitra compresse controindicazioni farmacologia del bactrim viagra spedito da europa torta allegra ricetta levitra pillola effetti collaterali muscoril e voltaren escitalopram oxalate ip monograph prezzo augmentin con ricetta novartis pharma gmbh voltaren dispers escitalopram 100mg suprax effetti collaterali voltaren slag acquistare viagra originale provera pediatra vercelli effetti collaterali abuso viagra qual'è la moneta di cipro nombre comercial viagra chile inderalici propranolol 10 mg para que sirve nitrofurantoin mono mcr pregnancy medicina viagra scaduto differin gel benzac alluce valgo voltaren levitra orosolubile quanto dura