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
anima allegra vittadini mescolare viagra e cialis clindamycin iv po conversion zoloft 100 effetti collaterali indicazioni flomax bustine zimox oppure augmentin viagra spedizione 24 ore voltaren injetavel infarmed medicinale equivalente al viagra previsioni meteo nicosia cipro comet trial carvedilol metoprolol quanto viagra si puo' prendere remeron e iperico proscar ricetta medica viagra für normale alimenti viagra naturale clopidogrel e intervento chirurgico il clomid aiuta voltaren na hemoroidy benzac differin bha pantip tegretol ritalin viagra cialis levitra helleva vivanza zovirax compresse scheda tecnica voltaren supposte per cervicale diminuer dose risperdal paroxetine in combinatie met ritalin dipyridamole intermediates torneo di poker cipro lopid fda approval lisinopril e idroclorotiazide cleocin crema e rapporti diovan phlegm come comprare del viagra remeron ingrassare viagra eczane com demografia cipro flomax 350 bustine indicazioni colchicine et vincristine dove acquistare proscar online usare cialis a 20 anni crestor rosuvastatin calcium 5 mg danazol 200 capsule differin gel ricetta effet secondaire viagra 100 mg confronta prezzi cialis valori psa dopo avodart lariam recensioni perdite scure dopo clomid voltaren emulgel serve ricetta allegra petta cipro if allergic to penicillin voltaren opiat clopidogrel tem generico voltaren suppository singapore lisinopril 10 mg qualitest caravan international cipro 2 voltaren dispers wofür ristorante terrazza albenza cialis spedizione in contrassegno farmacologia del bactrim ventolin aerosol pediatrico liprimar lipitor voltaren cerotti prezzi protonix efficacy prezzo clomid compresse propranolol salbe heilbronn costo de motrin 2a allegra avenue belmore nsw 2192 allegra bonfiglio cipro libano nave cuanto vale orlistat colombia allattare con dostinex contre le risperdal dose massima giornaliera di cialis costo del viagra en colombia co diovan lek composto do motilium trazodone persistent genital arousal disorder risperdal consta 12.5 plavix farmacocinetica lamisil ficha tecnica generic viagra pillen costo viagra cialis levitra intossicazione da metoclopramide propranolol duizeligheid augmentin posologia bambini sciroppo dott. allegra ginecologo palermo ciprofloxacin pille leios clomid ritardo mestruazioni cymbalta ed erezione lincocin antibiotico prezzo temperature mensili cipro nimotop gocce dosaggio voltaren dolo emulgel preis come agisce il seroquel cipro iv incompatibilities proprietà terapeutiche del viagra acquistare viagra generico a cosa serve il plavix 75 mg nizoral hydrocortisone cream zoloft dose consigliata trazodone pap l arginine natural viagra strattera ilaç fiyat serve la ricetta medica per il diflucan depo provera nipple soreness differin vitamin c comprar generico finasteride differenza citalopram e escitalopram streptococco resistente augmentin viagra x uomo vendita di viagra in italia medicinale voltaren fiale noleggio barche vela cipro viagra generico miglior prezzo quanto costa voltaren fiale seroquel casa farmaceutica metoclopramide hydrochloride depression plavix meccanismo d'azione viagra per donne wikipedia voltaren coach prednisone usp certificate arret brutal risperdal effets secondaires triamcinolone vs triamcinolone acetonide protonix clostridium difficile voltaren vicodin promethazine potentiate codeine eliberare viagra madopar e sinemet differenze 150 mg of voltaren viagra on line e reato strattera og ritalin acquisto viagra generico in contrassegno scuola media via cipro ascoli milano cipro 500mg antibiotic depo provera and primolut antibiotico augmentin mal di stomaco tinidazole chemical properties bactrim forte nella prostatite trental motilità furosemide doc generici 25 mg trazodone e gravidanza effet secondaire enalapril hydrochlorothiazide ibuprofen 600 voltaren prezzo cialis 5 milligrammi generico do medicamento singulair il cialis in erboristeria risperdal consta image zoloft e dipendenza lasix compresse indicazioni quantiferon gold prednisolone voltaren rischio infarto lamictal e pillola anticoncezionale agenzia tecnocasa via cipro roma american pie viagra anafranil 25 effet secondaire effet secondaire prednisone 20mg farmaco cymbalta effetti collaterali cantiere allegra furci siculo augmentin antibiotico 70ml augmentin va bene per la gola provera period twice dosaggio augmentin bambini in ml come somministrare viagra di nascosto qual'è la moneta di cipro tri glide vs tricor cialis 5 mg generico voltaren regeneration voltaren oftalmico prezzo colchicine costochondritis idroclorotiazide e furosemide singulair 5 mg prezzo escitalopram identifier effetti collaterali del nexium allegra event valencia depakin chrono e risperdal lincocin 600 intramuscolo viagra generico farmacia italia metoprolol ticari ismi prezzo nizoral crema bipolare störung seroquel prolong stillen voltaren salbe programmi per dosaggio coumadin ezerex e cialis insieme pacchetti vacanze cipro agosto levitra originale 20mg mitico re di cipro carvedilol coreg generic rischi del viagra aldara creme dellwarzen viagra che dose allegra predsim elavil schizophrenia villaggi turistici italiani a cipro ristoranti italiani a cipro viagra hipertension arterial pulmonar voltaren 75 dosierung zoloft aumenta la pressione trazodone 50 mg pill identifier augmentin cu metronidazol glucosamine tegretol voli diretti da roma cipro costo cialis farmacia svizzera raiffeisen provera racuna dove ordinare viagra online propranolol precio chile arcoxia 60 prezzo clopidogrel 75 posologia cipro mycoplasma genitalium kamagra viagra differenze voltaren gel distorsioni efficacia levitra 5 mg diflucan 150 antimicotico cerotti di voltaren tronchetti provera prelios il prometrium fa ingrassare aciclovir blocca la varicella differenze tra prednisone e prednisolone celebrex farmaco effetti indesiderati chi dinh micardis zetia farmaco medicament abilify aripiprazole triamcinolone acetonide steroid class clima cipro dicembre cialis esenzione per patologia cosa ne pensate del cialis vitamin e selenium betaine metformin rosiglitazone pioglitazone triamcinolone ampule linee guida sospensione plavix risperdal consta nhs sito sicuro per comprare cialis airedale terrier von allegra naltrexone vitaflo tabletti voltaren injection pediatric dose metformin glimepiride combination come si calcola il dosaggio di augmentin voltaren suppositorier 12 5 mg rheuma voltaren metoprolol niereninsuffizienz cialis dauerlatte nimotop foglietto illustrativo finasteride fa bene ai capelli naprosyn 750 indicazioni allegra madrid prometrium 200 mg ovuli quanto costa voltaren aumenta la pressione accutane aloe vera gel augmentin antibiotico 1 mg biaxin clostridium difficile lopressor metoprolol 100 mg trazodone cost canada clomid e ridotta riserva ovarica si puo dare augmentin al gatto costituzione società a cipro rosuvastatin pravastatin conversion adalat 10 mg in gravidanza is meclizine a diuretic micardis plus scheda tecnica voltaren o cortisone voltaren emulgel diclofenaco sodico lamisil dosage for tinea versicolor provera 5mg induce period confezioni di levitra viagra nach prostataoperation assuefazione da zoloft marcella allegra cit costa o pastilla viagra mosaici di cipro prednisone distemper allegra duez voltaren grageas 50 viagra natural en costa rica finasteride cataratta propecia chi lo usa dolo voltaren tendinitis quanto costa viagra generico in farmacia augmentin sciroppo bambini dose revatio vs viagra cost foto risultati con propecia risperdal soluzione posologia mestinon efficacy perindopril comparison lisinopril ldip provera india frutta da evitare con coumadin clomid e dolori al basso ventre diflucan cura la cistite principio ativo berotec e atrovent cosa non mangiare quando si prende il coumadin villaggi all inclusive cipro tronchetti provera junior augmentin in gravidanza per amniocentesi dott. allegra pneumologo fuso orario italia cipro cipro tendon rupture percentage cartina isola cipro allegra ziletti via cipro cesena dove prendere viagra diltiazem 60 mg posologia giudizi sul cialis overdose di abilify topamax compresse effetti collaterali risperdal et memoire escitalopram titration informazioni sulla pillola viagra nizoral generic shampoo lariam soldiers capitale della repubblica di cipro minocycline dosage for perioral dermatitis meglio cipralex o cymbalta costo viagra in svizzera diltiazem infusione continua cialis generico è illegale mappa cipro garmin voltaren artrosi xeloda for metastatic cholangiocarcinoma quando prendere zoloft voltaren gel for lupus pain finasteride effetti collaterali gravidanza cipro infeccao intestinal viagra spedito da europa come faccio a prendere il viagra cozi pasta allegra antibiotico augmentin fermenti lattici controindicazioni uso viagra depo provera and progesterone cream viagra e simili differin gel serve ricetta ventolin e peggioramento bambini finasteride risultati sorprendenti viagra meccanismo d'azione allegra d da sonolencia aldara chevaux inderal nella cirrosi isola di cipro mappamondo levitra orosolubile sopra o sotto la lingua quante sono rimaste incinta con clomid differin quanto tempo usar alerta agemed escitalopram voltaren vs percocet metoclopramide aspirin voli per cipro da bergamo augmentin 1 gr confezione cialis e aspirina insieme assunzione clomid in gravidanza voltaren tabletten arten natart allegra crib set posologie de risperdal varicella aciclovir dosaggio medicina tegretol carbamazepina u-triamcinolone-g atrovent ventolin difference voltaren gel safe in pregnancy feldene iniezioni prezzo aciclovir richet sostituire zyprexa aciclovir lattanti ludoteca via cipro roma co diovan generikum principali città di cipro quali sono gli ingredienti del viagra el viagra chino procardia gerd hotel arcotel allegra in zagreb croatia utilizzo del voltaren augmentin antibiotico per tracheite oral prednisone alopecia areata conversion from citalopram to escitalopram augmentin prezzo euro quantità di cialis da assumere farmacocinetica del orlistat biere viagra aciclovir 400 mg laboratorio chile posologia ventolin 100 albendazole echinococcose alveolaire ranitidine and escitalopram clostridium difficile prilosec viagra nel latte farmaco cialis 5 mg prezzo costo di avodart luoghi turistici di cipro se prendo il cialis posso bere triamcinolone acetonide pdf crestor rosuvastatina astrazeneca side effect voltaren suppositories quanto costa viagra generico escitalopram philippines quando prendere moduretic solo affitti roma cipro la grotta del remeron voltaren salbe histaminintoleranz corticosteroid triamcinolone acetonide cream zoloft 50 mg effetti ciprofloxacin for uti e.coli zoloft e disturbi alimentari voveran content pioglitazone metformin sulfonylurea a che ora assumere il clomid precio viagra generico farmacia strattera bfarm ibuprofen 400 oder voltaren cipro severe diarrhea cozi pasta tramontina allegra conjunto cozi pasta allegra inox - tramontina cuanto sale el viagra chile italiani che vivono a cipro interaccion captopril aspirina abilify disturbo bipolare prandin generic launch altace lisinopril conversion allegra pediatrico da sono bactrim 80 mg sospensione orale clomid dal quarto giorno farmacie online vendita viagra augmentin fa bene per il mal di gola trazodone palinopsia diovan comp 160 mg augmentin bambini nel latte avis autonoleggio cipro interrompere l'allattamento dostinex nolvadex composizione a quoi sert kamagra costo della crema benzac differenza tra augmentin e klacid voltaren patches australia bula vytorin medicamento diare av voltaren cara pakai ventolin inhaler salbutamol cfc free finasteride effluvio cronico clomid ovidrel progesterone escitalopram e cannabis seroquel turkce premarin cream bioidentical paseo via allegra prometrium period delay efeito colateral motilium aciclovir interferisce con la pillola cialis 5 mg miglior prezzo augmentin compresse contiene glutine finpecia australia pomada voltaren indicaciones voltaren sr ne demek maxalt foglietto illustrativo coumadin dopo ablazione betamethasone dipropionate vs triamcinolone ventolin quando usarlo zovirax labiale in allattamento allopurinol contre la goutte medicamento phenergan 25 mg dose conversion diovan to losartan augmentin antibiotico e diarrea metronidazole ciprofloxacin bei diverticulitis dopo quanti giorni fa effetto vermox clomid e gonal f funziona vermox per prurito anale voltaren quando fa effetto avodart 0 5mg generico levitra femminile voltaren fiale prescrizione zantac foglietto illustrativo voltaren supposte dosaggio monitoraggio del coumadin a quoi sert le bactrim forte metoprolol carvedilol bisoprolol brolene vs chloramphenicol clomid quando non funziona la luna allegra arcoxia 90 foglio illustrativo voltaren dolo spray acquista cialis on line protocol for late depo provera cialis rossore al viso cymbalta und impotenz seroquel dopo quanto agisce voltaren resinat allergie glucophage xr ovario poliquistico effetto antabuse cos'è clopidogrel e inibitori di pompa indikasi combivent udv voltaren per il mal di denti qui prend du abilify finasteride per 5 anni levitra generico funziona methotrexate 15 mg effetti collaterali risperdal alcool effets secondaires augmentin sospensione pediatrica posologia ultram contiene aspirina lisinopril farmacologia dopo quanto tempo si rimane incinta con clomid aciclovir 800 prezzo case in vendita a cipro roma metformin pharmazie.com diflucan posologia candida villaggi cipro nord novartis pharma voltaren dispers allegra d post nasal generico urispas clomid per ovaio multifollicolare bactrim forte per quanti giorni nome cialis generico