Windows mobile

May 30th, 2008

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /nfs/c04/h01/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/h01/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/h01/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/h01/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/h01/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/h01/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/h01/mnt/58603/domains/interwebby.com/html/wp-content/themes/interwebby/footer.php(12) : eval()'d code on line 1
caduta capelli finasteride voltaren gel coupon canada allegra d pediatrico bula diflucan effetti indesiderati prometrium e ciclo abbondante aciclovir 800 prezzo trasporti cipro nord aldara non fa effetto mescolare viagra e cialis augmentin compresse dosaggio bambini conjunto cozi pasta allegra inox - tramontina kaya artemis cipro dimensione turismo tempo larnaca cipro peritonsillar abscess prednisone mefloquine doxycycline or atovaquone/proguanil ( malarone ) remeron e attacchi di panico farmaco cialis 5 mg prezzo situazione bancaria di cipro norvasc impotenz olanzapine raim seroquel foglietto illustrativo coumadin e sonnolenza coumadin cosa non devo mangiare anafranil discontinuation limassol cipro cap torta allegra prova del cuoco is viagra legal in tenerife escitalopram 10 mg precio colombia come calcolare la dose di augmentin viagra generico citrato de sildenafila clomid quando prendere risperdal uso pediatrico is trazodone a serotonin inhibitor generico do voltaren rapid procès contre risperdal prednisolone performance sportive interaccion captopril aspirina musica spot voltaren cefadroxil principio attivo vico von allegra seroquel e fobia sociale differenza tra clomid e puregon si puo comprare viagra senza ricetta in svizzera depo provera cramps but no period metoprolol niereninsuffizienz propecia e calvizie aspirina e plavix insieme cialis 20 mg quando prenderlo tegretol cr 200 a ciąża preco pomada differin effetti collaterali abuso viagra medicament lioresal viagra senza ricetta germania miconazole versus diflucan dostinex obbligo ricetta ventolin evohaler szteroid augmentin e ovulazione pastiglie finasteride cibo sostitutivo al viagra cagliari cipro voli low cost elavil dog aggression precio lariam chile vendo cytotec peru vendita viagra in croazia risperdal phobie sociale sospensione coumadin per estrazione dentale ventolin salbutamol precio argentina dostinex è un anticoncezionale periactin sonnolenza risperdal consta insomnie propranolol taquicardia sinusal allegra casa argentina informazioni sulla pillola viagra quantiferon prednisone trazodone suicidality la vedova allegra fasano zovirax e insufficienza renale indicazioni flomax bustine allegra pediatrico jarabe buy voltaren australia zoloft durata del trattamento anima allegra vittadini augmentin e infezioni genitali zona aciclovir posologie revatio vs viagra cost prezzi viagra 50 mg propecia chile precio pediatric hemangioma propranolol riccardo allegra trazodone sommeil risultati finasteride capelli cialis na ultrafarma risperdal consta deltoide propecia scadenza brevetto cipro a quale nazione appartiene furosemide scheda tecnica voltaren ultrafarma uusi voltaren el voltaren contiene aspirina luoghi turistici di cipro assa di allegra francesco bula do creme dermatologico aciclovir finasteride effetti sulla prostata escitalopram actavis lihottaa posso prendere 2 cialis da 5 mg risperdal consta datasheet trazodone nerve pain voltarol and aspirin depo provera positive stories orabase triamcinolone acetonide posologia aciclovir herpes labial colica renale voltaren supposte cialis generico è illegale quali sono dosi del viagra cipro sun poisoning diltiazem balcor symbicort si ventolin aldactone nello scompenso cardiaco coagulazione del sangue coumadin prednisone fait grossir triamcinolone acetonide cream versus ointment olanzapine in indonesia medicamentos strattera augmentin compresse quando si prende proprietà terapeutiche del viagra aricept 5 10 mg effetti provera noleggio augmentin in gravidanza diarrea naltrexone cloridrato effetti collaterali pamelor bula posologia provera effet secondaire limassol cipro foto xalatan collyre posologie el medicamento viagra banche cipro nord il cialis dopo quanto fa effetto escitalopram oxalate schedule tegretol 400 argentina strattera edronax come comprare il viagra online benzac ac gel sulit costo motrin pediatrico spiriva und atrovent viagra per un cardiopatico allattare con dostinex zovirax tempo guarigione quando avere rapporti per rimanere incinta con clomid chi non puo prendere il viagra albendazole oral suspension dosage voltaren vs gabapentin antiinflammatoire non steroidien arcoxia studio allegra novara interruzione trattamento finasteride voltaren resinat 75 mg diclofenac costo de cytotec colombia noleggio auto low cost cipro dove comprare cialis generico cerco lamisil lozione spray diflucan allattamento propranolol e cefaleia cymbalta farmacodinamica posso dare l augmentin al gatto salbutamol ventolin dosages risperdal vida media generico do micardis 80 mg opinion levitra generico assistenza sanitaria cipro voltaren resinat medikament benzac 5 gel prezzo dulcolax laxative pregnant nitrofurantoin geriatrics ventolin spray e bambini dostinex non funziona epilim lamictal bipolar metoprolol 25 mg generico cerco viagra per donne tegretol bambini effetti collaterali cymbalta dipendenza strattera 40 mg pris colchicin und allopurinol nitrofurantoin fluorescence effetti del cymbalta medicament prednisolone mylan 20 mg cymbalta e vertigini la vedova allegra trieste furosemide doc principio attivo frolla allegra mulino bianco cytotec panama chiriqui novartis pharma gmbh voltaren dispers combivent ipratropium bromide albuterol sulphate lasix mal di montagna quanto costa una pasticca di cialis lotrisone cream in india allegra d impotence voltaren german risperdal consta refrigeration ricette per viagra cialis tadalafil prezzo augmentin contro scarlattina come agisce il seroquel volo roma cipro offerte lipitor di indonesia chloramphenicol resistant e. coli strain augmentin pediatrico 400 mg levitra orosolubile funziona posologia do allegra infantil effetti collaterali da femara alberghi a nicosia cipro levitra composizione chimica che ora sono a cipro promethazine potentiate codeine augmentin sciroppo fuori frigo escitalopram actavis unettomuus che cos'è viagra cosa serve levitra meglio del viagra cipro antibiotic calcium normandia petrosani calan diflucan candida quanti giorni provera detiene el periodo salle allegra laval costo farmaco arcoxia voltaren pricing lanoxin 0.125 mg effetti collaterali viagra ai giovani fa male voli low cost da bologna a cipro viagra come utilizzare diflucan 150 funziona taxotere prednisone prostate cancer lisinopril comp. abz allegra tem generico triamcinolone acetonide cream 0.1 poison ivy apa fungsi cipro viagra obbligo di ricetta medicamentul strattera levitra generico funziona ho preso il cialis ma non funziona cleocin crema in gravidanza come comprare viagra senza ricetta augmentin 70 ml prezzo rocaltrol precio chile dispensing clozaril cerotti voltaren prezzo case vendita roma cipro cipro italia under 21 pronostico alternativa de viagra chile dieta in terapia con coumadin uti medication cipro dosage anafranil da dipendenza carbenicillin ampicillin concentration lisinopril mas diuretico confezioni di cialis 5 mg diflucan 150 modo di somministrazione panotile cipro rezeptpflichtig que significa viagra chiste olanzapine cinv propecia e prostatite lisinopril posologia viagra per uomini e donne trazodone and propranolol cialis dalla romania voltaren sr 100mg dosage quando avere rapporti assumendo clomid rosuvastatin calcium scientific discussion principio activo del voltaren gel colchicine maladie periodique cialis generico forum al femminile seroquel e fibrillazione atriale tinidazole and giardia luoghi più belli di cipro voli diretti per larnaca cipro flomax per mal di schiena il cialis ha effetti collaterali cipro antibiotic class crociera msc allegra fludrocortisone to prednisone conversion dose giusta di levitra cymbalta and phendimetrazine el viagra natural chino strattera plus caffeine efficacité du risperdal betamethasone dipropionate vs triamcinolone viagra nel latte furosemide doc generici 25 mg voltaren spanien viagra generico uk sintomi da astinenza da cymbalta lasix funzione renale generico do lipitor 20mg foglietto illustrativo cytotec voltaren rapid na gravidez costo xenical generico gia voltaren gel the medicine voltaren cipro dose salmonella dilantin suspension dosage ramipril lisinopril conversion paphos cipro cosa vedere giudizi sul cialis sergio paolo cipro codice iata cipro inderal clorhidrato de propranolol citalopram combined mirtazapine diovan farmacologia dosaggio del viagra voltaren gel 1 100g price tricor pacific capital logo lamisil 1- folheto informativo generico de viagra chile villaggi cipro 5 stelle allegra d da sonolencia viaggi delle pleiadi cipro cialis zoll strafe voltaren suppository singapore augmentin dimenticato di prendere zovirax suspension pediatrico nizoral discontinued hydroquinone fluocinolone acetonide tretinoin metoprolol interaccion farmaco nutriente forum su cialis generico principio ativo berotec e atrovent nifedipine procardia muscoril interazioni coumadin propranolol hcl retard 80 pch tegretol per depressione augmentin antibiotico in bustina ristorante la mucca allegra viterbo metoclopramide qt interval cipro bancomat chloramphenicol o.5 metoprolol farmacodinamia recensioni acapulco beach club cipro bugiardino aciclovir compresse la pimpa allegra lamictal 25 prezzo voltaren retard bcfi viagra online italia generico propecia effetti collaterali repubblica ablazione e coumadin voltaren 50 mg compresse prezzo dosaggio prednisone nel gatto prednisone dosage pericarditis rabeprazole ranitidine combined voltaren mazilo cena sintomi di astinenza da zoloft zoloft e ossessioni acquistare cialis generico italia augmentin amoxicillina acido clavulanico in gravidanza sildenafil e cialis ventolin per la tosse allergica medicina natural igual viagra rocaltrol 0 25 prezzo tegretol 200 scheda tecnica voltaren interfere com pilula quanto tempo prima deve essere preso il viagra motrin farmacologia glucophage effetti indesiderati nystatin triamcinolone combination viagra ilaci fuso orario milano cipro comment diminuer risperdal augmentin e pillola loette cialis prostata infiammazione viagra mendoza argentina come creare il viagra in casa vitamin e selenium betaine metformin rosiglitazone pioglitazone groene viagra pil campioni gratis cialis acquisto cialis con pagamento in contrassegno trazodone qt interval strattera reboxetine wellbutrin xl principio ativo che effetto fa il viagra sulle donne abilify e peso corporeo suprax effetti collaterali viagra leczy pcos provera no period cleocin crema rapporti sessuali voltaren e eritema provera contiene progesterona allergie voltaren salbe terapia ormonale con clomid allegra caltagirone email risperdal 1 mg infarmed levitra farmacii spiagge naturiste cipro liprimar lipitor finasteride funziona veramente volare a cipro nord triamcinolone acetonide lcmsms chloramphenicol viceton bupropion costo colombia diflucan occorre la ricetta alli orlistat funziona come assumere cialis 5 felodipine metoprolol succinate tricor lovaza bactrim bartonella dosage farmacia fischel cytotec clima cipro in aprile farmaci generici viagra cialis voltaren daily dose metropolitana di roma fermata cipro voltaren gel period pain voltaren zel a ciaza generic viagra in malaysia tabella alimenti per coumadin è scaduto il brevetto viagra cialis nello sport chloramphenicol palmitate zinett seroquel 25 mg ne ilacı iniezioni voltaren dolorose allegra 120 medicamento viagra scaduto controindicazioni minocin 50 mg costo voltaren diclofenac zalf augmentin infezioni gengive augmentin antibiotico diarrea sinemet ed effetti collaterali zofran pill color trappa ut zoloft viagra nell'ipertensione polmonare stillen voltaren salbe carta stradale di cipro effetti di risperdal medicina tegretol carbamazepina viagra ricetta obbligatoria allegra davis ca interazione cialis aspirina diflucan e ritardo ciclo posologie voltaren 75 mg viagra trotz stent cialis eruzioni cutanee comprare viagra in germania costo del viagra en colombia inyeccion coltrax voltaren motrin vs voltaren efficacite levitra generique voltaren sr fiyat dramamine pediatrico gotas doxazosin effetti indesiderati estrogen dominance alesse sustituto natural propecia temperature mensili cipro diflucan compresse senza ricetta dosaggio augmentin per bambini differenze tra prednisone e prednisolone aciclovir per occhi augmentin compresse contiene glutine componenti chimici del viagra metoprolol succinate rxlist pacchetti vacanza cipro agosto cialis generico blog pesca sportiva cipro cipro and c difficile risperdal consta deaths trazodone alternatives bisazza cipro mix medicamento allegra d 180 mg clindamycin fluocinonide voltaren novartis 25mg cipro nord opinioni diflucan ricetta bianca requip allucinazioni spiaggia nissi beach cipro posologia de risperdal pletal farmaco scheda tecnica cucine stosa allegra colori herpes genitale aciclovir posologia zofran cost generic posologia claritin comprimido qual'è il migliore il viagra o il cialis trazodone questions voltaren gel utilizzo augmentin interferisce con nuvaring trazodone 20 mg comprare il cialis su internet risperdal consta lp 25 mg voltaren 75 contraindicaciones cymbalta collagenous colitis rifampicin isoniazid ethambutol combination cipro diazepam viagra na cardiologia zyrtec farmaco generico prezzo nizoral crema voltaren retard 100mg uk crestor eccipienti viagra vih positivo villaggi cipro nord tripadvisor spiagge cipro a cosa serve il farmaco isoptin requip rp scheda tecnica risperdal consta 50 mg τιμη pyrazinamide hyperuricemia allopurinol augmentin antibiotico a stomaco vuoto o pieno augmentin in allattamento quanto custa o medicamento allegra seroquel prolong beipackzettel 50mg dostinex durante il ciclo il cialis fa male alla salute