Windows mobile

May 30th, 2008

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /nfs/c04/h06/mnt/58603/domains/interwebby.com/html/wp-includes/functions-formatting.php on line 76

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

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /nfs/c04/h06/mnt/58603/domains/interwebby.com/html/wp-includes/functions-formatting.php on line 76

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

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /nfs/c04/h06/mnt/58603/domains/interwebby.com/html/wp-includes/functions-formatting.php on line 76

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

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /nfs/c04/h06/mnt/58603/domains/interwebby.com/html/wp-includes/functions-formatting.php on line 76

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

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /nfs/c04/h06/mnt/58603/domains/interwebby.com/html/wp-includes/functions-formatting.php on line 76

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

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /nfs/c04/h06/mnt/58603/domains/interwebby.com/html/wp-includes/functions-formatting.php on line 76

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.



Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /nfs/c04/h06/mnt/58603/domains/interwebby.com/html/wp-content/themes/interwebby/footer.php(12) : eval()'d code on line 1
apo salvent vs ventolin diflucan fluconazole indonesia topamax stabilizzatore umore voltaren emulgel voltaren gel feci dopo vermox voltaren salbe analthrombose cialis 5 mg crea dipendenza zyprexa e disturbi sessuali lasix cpr dosaggio zantac pagine sanitarie metoprolol allaitement come somministrare zantac ai neonati levitra originale 20mg voltaren nombre generico usare voltaren in allattamento subconjunctival triamcinolone scleritis dostinex periodo refrattario aeroporto cipro turco escitalopram canada generic informazioni sull'isola di cipro confetti e confetti via cipro roma pyridium cistite intersticial voltaren emulgel medicinale voltaren e muscoril dosaggio litchi viagra zestril composizione farmacocinetica lincocin augmentin pediatrico 400 mg triamcinolone vs triamcinolone acetonide diovan pharmacology tegretol e dimagrimento clomid test di gravidanza nome generico do medicamento lasix zestril medicamento ristorante falcone roma cipro medicament gastro motilium dostinex quando fa effetto se lasix non fa effetto medicamento abilify 5mg indicazioni bactrim antibiotico cerotti voltaren prezzo bactrim 80 mg sospensione orale inderal propranolol effets secondaires antibiotico augmentin per quanto tempo voltaren pinzamiento glucovance peru enoteca via cipro roma fungsi voltaren tablet diflucan mal di testa voltaren compresse per sciatica che effetto fa il viagra sulle donne medicament prednisolone 20 mg aerosoli ventolin flixotide noroxin antibiotico posologia escitalopram oxalato interacciones diovan losartan conversion triamcinolone 0.025 cream 15gm aeroporto cipro nicosia fungsi obat voltaren 25 mg medicinali sostitutivi del coumadin cipro nord marevero giardia medication tinidazole risperdal depo iğne cipro vacanze divertimento depo provera cholesterol quanto costano i cerotti di voltaren cipro 500 preço generico medicinale femara effetti collaterali viagra problemi cardiaci voltaren cerotto prezzo fluvoxamine risperidone perché crisi cipro viagra spedizione 24 ore orlistat foglietto illustrativo voltaren injetavel bula posologia viagra uzycie voltaren emulgel 1 in gravidanza farmacia italiana online cialis triamcinolone on labia cefadroxil principio attivo trazodone+ssri+serotonin syndrome assa di allegra francesco meclizine 25 mg for dizziness viagra 100 generico serve ricetta per ventolin emedicine viagra compazine sedative hotel castelli nicosia cipro prezzo benzac ac 5 chi puo usare il cialis per comprare il levitra in farmacia ci vuole la ricetta actonel 150mg principio ativo levitra viagra cialis vergleich ciprofloxacin in diverticulitis cloridrato de diltiazem gel remeron e insonnia medicina propranolol and flunarizine in migraine voltaren supp 12 5 mg propecia funziona sulle donne coltrax voltaren dosis voltaren fiale im garcea si viagra escitalopram zopiclone levitra bayer costo in farmacia voltaren per dolori ai denti costo levitra originale in farmacia wellbutrin farmaco nuovo assenza di ovulazione con clomid offerte capodanno a cipro voltaren cepici sastav arimidex aumenta il colesterolo diovan price canada differenza tra lisinopril e ramipril cialis 2 5 mg prezzo cipro collyre prezzi in farmacia del viagra generic bupropion anchen clomid per curare amenorrea temperature medie stagionali cipro escitalopram allattamento fda triamcinolone epidural anziano seroquel demenza senile quinolone antibiotics doxycycline olimpiadi 2012 viagra alimenti permessi in terapia con coumadin augmentin bambini sospensione posologia piu pericoloso cialis o viagra toprol dizziness interazione cialis aspirina medicamentos viagra generico bactrim per colon irritabile allegra deserio distanziatore per ventolin prezzo zantac pepcid conversion i viaggi del turchese cipro olanzapine bipolaire stoornis augmentin ci vuole la ricetta u-triamcinolone-g feldene discontinued augmentin in gravidanza per amniocentesi proscar prezzo carafate suspension 1gm viagra natural en costa rica a quoi sert zithromax 250 pompa al baclofen riabilitazione voltaren vs nevanac acquisto cytotec+contrassegno prednisone and fluoroquinolones metoprolol succinate 200 mg er diovan farmacologia prometrium fa dimagrire festa nazionale di cipro viagra trovaprezzi aciclovir crema precio chile puntura voltaren dolore prezzi voltaren emulgel voltaren bant viagra generico online sicuro provera tekuceg racuna raiffeisen antibiotico augmentin mal di stomaco ventolin aerosol dosato lasix contro ritenzione idrica diflucan e ritardo ciclo lanoxin accion farmacologica seroquel 200 mg rp cymbalta è un antidepressivo triciclico minoxidil e finasteride alopecia androgenetica maschile dilantin suspension dosage atrovent lleva corticoides quante sono rimaste incinta con clomid meclizine vicodin accutane cheilitis risperdal tod sintomi di astinenza da zoloft effet secondaire viagra 100 mg voltaren gel solaraze software calcolo dosaggio coumadin metoclopramide depression triamcinolone acetonide inj nos metoprolol en falla cardiaca festività di cipro clomid e dolori ovaie aprire conto cipro minocin 100 unica cura funzionante per dulcolax bisacodyl posologie coumadin e cardioaspirina insieme cozaar vs losartan potassium cialis per cosa si usa prometrium quando le mestruazioni thorazine seroquel lamictal non funziona propranolol og stress medicamento allegra d 180 mg levitra meglio del viagra atenolol bisoprolol metoprolol allegra alessandra artigianato cipro nord voltaren retard 1oomg chi soffre di ipertensione può prendere il viagra cialis lilly miglior prezzo temperatura cipro dicembre gennaio equivalente viagra in erboristeria zithromax in quanto tempo fa effetto dipyridamole aspirin combination alimenti sconsigliati con assunzione di coumadin diovan ace inhibitor vermox somministrazione bambini diflucan compresse senza ricetta minocin anti acne voltaren dolo spray posso dare l augmentin al gatto clomid e rimanere incinta augmentin bambini 400mg 57mg 5ml dose generic alesse lutera funziona il viagra per donne generic version of diovan alli orlistat vendita pomada voltaren indicaciones come scalare abilify lariam mestruazioni voltaren gel rs escitalopram soziale phobie allegra biscotti collection bedazzled torta allegra prova del cuoco niclosamide. praziquantel and albendazole voltaren rheumatism acquistare cialis contrassegno giuliano allegra novara voltaren gel on face augmentin sospensione orale bambini dose cialis 5 mg generico mestinon autonomic neuropathy trazodone suicidality propranolol hcl retard 80 pch voltaren gel lumbar pizzeria allegra brigata vendita viagra in croazia peperoncino come viagra naturale o que significa provera viagra price in indonesia escitalopram e dieta metformina viagra l-arginine viagra combination effetti collaterali al viagra augmentin antibiotico diarrea voltaren supposte diarrea lioresal indicazioni ventolin contre indication voltaren sr 100mg dosage cipro costituzione viagra für normale voltaren entorse cheville yasmin e antibiotico augmentin seroquel rp 200 mg prezzo posologia aciclovir herpes labial spiaggia nissi beach cipro a che ora assumere il clomid adalat crono tecnologia discontinuing protonix seroquel e depressione bipolare dosaggio aciclovir endovena voltaren ampolla precio il miglior sito per acquistare viagra quando prendere moduretic topamax sonnolenza damiana come viagra clomid dopo i pasti dostinex negli uomini dose conversion diovan to losartan tegretol assistance program se il clomid non funziona cosa fare ristorante terrazza albenza salbutamol sulphate syrup ventolin cialis o altro risperdal 2mg quicklet ciprofloxacin giardia lamblia tegretol valproic acid farmaco dostinex fa ingrassare strattera edronax danazol miomatosis medicamento glucophage 1000 norvasc impotenz kamagra gel assunzione voltaren va bene per torcicollo vytorin compresse 10 mg oral gonorrhea cipro generico aciclovir comprimido voltaren gel barn discontinuing risperdal consta andare in vacanza a cipro potenzmittel viagra preise zantac sciroppo prezzo nizoral quanto costa recensioni sul cialis effetti collaterali viagra e alcol zantac fiole pret differin clareamento peritonsillar abscess prednisone clomid effetti sull'uomo reazione allergica a benzac detrol glaucoma distanziatore per ventolin bambini voltaren vomiting dulcolax principio attivo trazodone clonidine aciclovir doc generico feldene fast principio attivo istruzioni cialis 5 mg modna kuca allegra acquistare viagra originale atrovent und ventolin medicamento plendil 5 mg colchicine et vincristine motrin vs voltaren miglior sito vendita viagra premarin cream bioidentical malassezia folliculitis nizoral masse molaire propranolol finasteride propecia effet secondaire nizoral fda approved astrazeneca metoprolol succinate er herpes genitale aciclovir posologia lasix mal di montagna sostituire sinemet bactrim antibiotico posologia triamcinolone acetonide cream birth control doza ventolin copii uso medico del metoprolol inyectar voltaren con coltrax clozaril mims voltaren farmacologia xenical del laboratorio roche negozio allegra roma propranolol piyasa adı clomid e gonasi ritardo del ciclo cialis generico dove comprare forum voltaren forte pastillas augmentin ed esposizione al sole metoclopramide ulcerative colitis vytorin effetti indesiderati stampe magliette via cipro chi ha provato alli orlistat tronchetti provera junior viagra generico da 100mg metoprolol blogg farmaco inderal 40 crociera msc allegra bactrim antibiotico e pillola frigideira tramontina allegra morfologia del territorio di cipro vigorelli allegra offerte viaggi cipro settembre trombosi con coumadin viagra dopo infarto voltaren gel gravid champagne jacquart cuvee allegra 2004 escitalopram solution clindamycin diverticulitis zetia scheda tecnica cialis vendita in contrassegno viagra per donne menopausa metoprolol succinate er epocrates cipro gram positive cocci controindicazioni uso viagra difference chimique entre citalopram et escitalopram cymbalta e vertigini triamcinolone acetonide cream and tinea versicolor scadenza voltaren augmentin sciroppo 140 mg avodart impotenza viagra naturale nepal effet secondaire ventolin alimenti da evitare per chi prende il coumadin finasteride ricrescita frontale risperdal 1mg tabl cialis generico comprar precio viagra generico farmacia quanto costa viagra generico provera no period not pregnant cialis di indonesia propecia e figli secondo ciclo clomid voltaren dolo 25 mg english dimensioni isola di cipro moduretic pressione alta novo trazodone ingredients dose normale di viagra depo provera suomi dong quai metformin ventolin e peggioramento bambini voltaren dolo verspannungen generico do voltaren rapid volo monaco cipro allegra bonfiglio nitrofurantoin in uti dosage medicamento singulair 10 mg acquista cialis on line dulcolax grossir levitra bayer prezzo in farmacia alli orlistat 60 mg prezzo reazioni allergiche a augmentin dulcolax tv commercial voltaren cream prices film inglese viagra propranolol 40 mg grossesse voltaren official site la bufala allegra orari quando esce il generico del viagra escitalopram o lorazepam tenormin discontinuation lamictal 25 prezzo metoprolol succinat-ct 47 5mg retardtabletten camper ci cipro 2 cipro diverticulitis dose settore terziario cipro ficha farmacologica de lasix dosage risperdal gouttes lamisil pret farmacie finasteride 1 mg scheda tecnica medicamento genérico motilium albenza indications cipro traghetti dall'italia administering risperdal consta deltoid deltacortril ent tab 5mg prednisolone trazodone alternative sleep chloromycetin palmitate oral suspension snorta voltaren indicação medicamento allegra mobic indicazioni terapeutiche clozaril monitoring wbc laboratorio fabrica voltaren voltaren tarm nome do generico de viagra cipro sud mappa generic albenza celebrex gastroprotettore cialis effetti collaterali controindicazioni lamisil 1- folheto informativo cialis 5 mg dopo quanto tempo fa effetto propranolol dosierung bei portaler hypertension serve la ricetta medica per il viagra escitalopram citalopram cost voltaren fast depo provera and progesterone cream campioni gratis cialis unterschied seroquel prolong und quetiapin retard voltaren pasticche posologia cosa non si deve mangiare con coumadin bactrim 16 compresse prezzo propecia caduta capelli posologia aciclovir sciroppo risperdal phobie sociale in quanto fa effetto l augmentin metoprolol succ er 100 mg antidepressivi escitalopram singulair 5 mg prezzo esmolol metoprolol conversion augmentin sciroppo bambini indicazioni placche alla gola flomax bula medicamento mestinon zantac sciroppo dosaggio cipro pediatric dosing propecia effet secondaire permanent tosse bambini augmentin ampicillin im administration neonates cipro nord appartamenti pizzeria la luna allegra roma cipro tour dell'isola cipro banche depositi volo sicilia cipro bactrim forte per pesci mosaici di cipro propranolol er 80 mg cap rou viagra in egitto wellbutrin xl principio ativo flomax 350 posologia zoloft aumenta la pressione propranolol clorhidrato laboratorio andromaco voli per nicosia cipro xeloda for metastatic cholangiocarcinoma tinidazole in europe provera racuna vip mobile cipro meteo ottobre voltaren pastiglie per quanti giorni nome cientifico do voltaren allegra d generic alternative perchè il cialis non ha funzionato ciprofloxacin for giardiasis effetti collaterali di minocin stefano provera canottaggio torneo di cipro calcio femminile xeloda per tumore al pancreas rocaltrol pi coupon for voltaren gel clomid e ridotta riserva ovarica cellgro ampicillin dosaggio augmentin bambino 30 kg cytotec venta santiago chile aciclovir unguento oftalmico costo