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
snorta viagra strattera mirtazapine viagra tempi di reazione chloramphenicol augensalbe quante compresse ci sono in una scatola di augmentin triamcinolone vs cortisone augmentin compresse indicazioni differin gel 0.3 precio colombia voltaren emulgel prezzo farmacia pristiq lamictal combination quanto costa il cialis con la ricetta levitra nuovo prezzo aciclovir soluzione orale augmentin antibiotico ci vuole la ricetta tegretol faza nome cialis generico triamcinolone suspension uses è sicuro acquistare cialis online seroquel tempi di efficacia coumadin e aumento di peso clomid e ingrassare collegamenti creta cipro novartis pharma gmbh voltaren dispers bere alcolici con augmentin significato di allegra coumadin e il caldo isola di cipro superficie pillola simile viagra garcinia cambogia vs lipitor escitalopram e colon irritabile pressione bassa e cialis medicamento diovan amlo tegretol cr 200 divitabs anafranil 10 mg effetti indesiderati cipro 500 mg ne ilacı calculo farmacologia decadron xenical generico farmacia adalat crono 30 in gravidanza bula medicamento trileptal finasteride teva prezzo diflucan 150 modo di somministrazione viagra prezzi italia zyprexa sospensione lamisil 1 spray cutaneo soluzione piatti tipici del cipro rusa på voltaren impotenz durch cialis voli ryanair milano cipro crisi di astinenza da risperdal feldene fast compresse prezzo cipro trasporti pubblici evista 60 mg generic albania cipro pronostici mobic per sciatica nimotop gocce dosaggio stosa cucina allegra prezzo voltaren sr 75 ne hapı cipro for uti prevention la vedova allegra trieste diflucan per la candida orale cialis originale inghilterra voltaren pastiglie indicazioni voltaren gel 1 percent bactrim e spermiogramma wikipedia voltaren resinat clomid e stick persona lyrica e viagra cuscuzeira inox allegra tramontina diovan da tosse quanto costa il cialis generico il viagra si può dividere effetti di risperdal voltaren mot tannverk tagliapillole proscar seroquel prolong beipackzettel 50mg zoloft durante l'allattamento escitalopram qt intervall collegamenti aerei roma cipro madonna di cipro acquistare cialis generico italia aumento di peso con anafranil presidente golf albenza ventolin aerosol tiene corticoide atarax compresse prezzo voltaren gel safe in pregnancy cosa non si può mangiare col coumadin cucine stosa allegra colori maxalt rpd foglio illustrativo propecia risico albendazole chien usare voltaren in allattamento prezzo arcoxia 60 voltaren gel for elbow pain dopo quanto fa effetto il cialis differenza tra zitromax e augmentin voltaren cepici 12 5mg clomid e sintomi ovulazione viagra sfd nizoral pomata indicazioni provera grande distribution viagra natural brasil risperdal loxapac voltaren loco diflucan e spermiogramma po to iv lopressor conversion clomid e rimanere incinta carina allegra e spensierata sei carina tegretol effetti collaterali forum depo provera da sono indicazioni flomax bustine clomid e riuscita novità su propecia cloridrato de propranolol e anticoncepcional noroxin antibiotico posologia risperdal pagine sanitarie finasteride x capelli sterile triamcinolone acetonide suspension usp tabaccheria via cipro brescia musica classica allegra famosa risperdal prise poids pastiglia sostitutiva coumadin voltaren salva pris triamcinolone acetonide .05 seroquel e fibrillazione atriale alberghi a nicosia cipro come si fa il viagra stillen voltaren salbe carafate suspension uk effet prednisolone sportif propranolol na arytmie serca quanto costa il cialis in austria seroquel titolazione cefacilina 500 cefadroxil montpellier monica provera rodriguez metoprolol succinate ramipril depo provera and vitamins voltaren e tachipirina differin 0 3 gel generico alternativa naturale al voltaren accuretic quinapril hcl hydrochlorothiazide viagra a chi non serve differin crema per macchie vacanze mare 2013 cipro metoprolol succinate po to iv conversion provera przy menopauzie ultrafarma cialis 10mg bactrim va bene per mal di denti se prendo il cialis posso bere tinea versicolor lamisil generico do lipitor 20mg per comprare il levitra in farmacia ci vuole la ricetta psoriasis triamcinolone acetonide cream augmentin antibiotico diarrea motrin farmacodinamia voltaren tiene corticoides lipitor plaque stabilization tegretol e febbre creme aldara efficacité lopressor lp posologie zimox oppure augmentin bactrim sciroppo costo voltaren cerotti in allattamento alimenti consentiti con coumadin metoclopramide bambini viagra naturale come farlo dosaggio augmentin nel gatto olanzapine in indonesia risperdal sedatif voltaren sr 75 mg ampul canzone d'amore italiana allegra cipro case acquisto antidepressivi zoloft in gravidanza in quanto tempo fa effetto propecia aciclovir compresse assunzione diovan 160 mg posologia abolizione piano terapeutico clopidogrel fio allegra pingouin pillola yaz e aciclovir pastiglie comprare cialis in sicurezza risperdal et memoire viagra generico online sicuro dosaggio iniziale coumadin crestor gemfibrozil combination allegra d não da sono generico do micardis 80 mg voltaren resinat n1 prevacid solutab cost crestor 5 mg posologia voltaren per la sciatica campionato calcio cipro negozio celiachia roma via cipro cymbalta fobia sociale perindopril comparison lisinopril levitra periodo refrattario come procurarsi viagra senza ricetta novartis pharma voltaren dispers no tengo ventolin software calcolo dosaggio coumadin escitalopram bipolar depression voltaren gel for ms zoloft antidepressivo bugiardino voltaren tabletten docmorris esiste seroquel gocce allegra davis ca casa allegra lenzerheide voltaren retard 1oomg voltaren ili brufen dose minima di cialis cosa serve medicinale diflucan benzac acne opinioni propranolol in upper gi bleed lasix fiale costo biaxin clostridium difficile tintoria via cipro roma quoi sert medicament atarax diovan medication generic quando arriva il ciclo dopo prometrium diltiazem infusion svt dott gigli e finasteride allegra d 240 mg sanofi chattem allegra vendo viagra generico madrid ventolin aerosoli copii logo voltaren crestor 10 mg posologia cipro è bella viagra chino 100 natural sin contraindicaciones dulcolax compresse in gravidanza epilim lamictal bipolar thorazine seroquel comment arreter propranolol viagra natural femenino chile diflucan occorre la ricetta voli trapani cipro chlorpromazine vs olanzapine risperdal consta missed doses voltaren efeito colateral cura con cialis 20 mg propranolol sa 120 mg cap gravidanza grazie a clomid metoprolol pubchem feldene colica menstrual snai roma cipro voltaren ivf medicamento similar al orlistat voltaren hiccups video isola di cipro salbutamol ventolin in pregnancy offerte speciali cipro cialis giallo perchè il levitra non funziona sinemet ed effetti collaterali nitrofurantoin for uti in pregnancy salbutamol ventolin dosages affitto monolocale via cipro roma levitra ed ipertensione gatto di cipro sandoz rosuvastatin calcium allegra d magnesium propecia immagini clopidogrel colonoscopia allegra corteggiatrice uomini e donne voltaren e mal di schiena sostituzione al viagra feldene farmacocinetica indikasi combivent udv detrol la glaucoma cost of voltaren 1 gel risperdal et la libido quando sarà disponibile il viagra generico escitalopram 10 mg price escitalopram e cannabis k significa viagra propecia generico 2012 ricerca su cipro clomid allattamento viagra scaduto controindicazioni plavix farmacodinamia voli per cipro nicosia diovan scribd site officiel vente viagra voltaren ppi tegretol e anticoncezionali naltrexone vitaflo tabletti cialis 5 mg funziona subito a quoi ca sert viagra voltaren fascia lata domande e risposte sul cialis acquisto kamagra con paypal levitra disfuncion psicologica composicion del medicamento allegra dove comprare il cialis online nexium esomeprazolo effetti collaterali aciclovir generico 200 mg preço remedio natural tipo viagra zithromax clostridium difficile affitti roma prati cipro dove comprare kamagra sicuro augmentin antibiotico da 1 grammo viagra natural venta argentina bactrim pillola anticoncezionale clomid sudorazione notturna differenza tra coumadin e plavix manfaat voltaren 25mg risperdal phobie sociale periorbital cellulitis augmentin wellbutrin smettere di fumare procès contre risperdal escitalopram oxalato interacciones voltaren 12 5mg domperidone cipro metoprolol succinate usp prezzo cialis originale da 5 mg nitrofurantoin contraindicated renal impairment provera and no periods dutasteride ricrescita finasteride effetti collaterali cane allegra d 120 mg dosage fattura da cipro voltaren aumenta la pressione sinemet prontuario terapeutico risperdal consta im dosing escitalopram citalopram unterschied clomid quanti cicli sono consigliabili voltaren emulgel con sintrom prezzo del viagra da 25 mg medicamentos viagra generico trazodone molecule depo provera 150 mg cost trazodone p-glycoprotein voltaren gel pain relief il cialis ha effetti collaterali allegra clinica odontologica df voltaren concussion chi usa viagra viagra ai giovani fa male 8 mg de risperdal tegretol foglietto illustrativo zoloft per depressione cialis oppure viagra hydrochlorothiazide induced acute non cardiogenic pulmonary edema levitra generico acquisto tratament aerosoli cu ventolin voltaren dolo 12 5 mg beipackzettel converting risperdal consta invega sustenna zithromax in quanto tempo fa effetto zyprexa in quanto tempo agisce diflucan interferisce con la pillola effet secondaire amantadine voltaren ofta coll prezzo antibiotics for diverticulitis cipro buzzi stanza allegra benzac gel perossido di benzoile 5 prezzo cialis originale 10 mg nystatin triamcinolone acetonide psoriasis zantac in gravidanza voltaren gel for knee tendonitis motilium ricetta medica ci vuole ricetta per cialis atrovent provoca tosse uti medication cipro dosage generico aciclovir pomada prednisolone epocrates pediatric coumadin valori normali tegretol per depressione cipro conti deposito viagra forum al femminile peritonsillar abscess prednisone triamcinolone face rash risperdal consta libido strattera and pristiq levitra da sciogliere in bocca ricambi auto via cipro 68 wellbutrin e sonnolenza viagra bei normaler potenz viagra 25 mg durata cipro iv incompatibilities vacanze cipro pagina 1 voltaren gel package size viagra massimo effetto mezclar voltaren y ibuprofeno chloramphenicol za decu alimentazione in terapia con coumadin noroxin 400 mg leggi le opinioni levitra 10 mg precio colombia clomid regolarizza il ciclo prometrium a bioidentical lamisil chien rgo motilium gaviscon dove comprare orlistat viagra fa sempre effetto farmacocinetica del finasteride cialis per cosa si usa effet secondaire cipro 500 tegretol cr 400 novartis antibiotici compatibili con il coumadin allegra printing vienna va risperdal et phobie sociale perdite scure dopo clomid triamcinolone acetonide usp .5 ciprofloxacin pille leios tinidazole paediatric dose medicament lioresal acquistare aldara online differenza coumadin e sintrom viagra cialis levitra costi iv compazine dose dulcolax bisacodyl posologie alberghi a protaras cipro cream voltaren gel meglio cialis da 10 mg o da 20 mg perseo via cipro 56 augmentin fa bene per il mal di gola depo provera sore arm naltrexone dermatillomania voltaren supposte bugiardino tardive dystonia abilify voltaren slag propecia ogni 3 giorni cioccolateria cipro via cipro 3 roma voltaren gel on face viagra spezzare pillola augmentin sospensione generico minocin 100 indicazioni clopidogrel e gastroprotezione augmentin quanti giorni prenderlo impianto di pompa al baclofen sito sicuro per acquisto viagra oral prednisone alopecia areata cardura piedi gonfi componentes xenical generico quanto costano i cerotti di voltaren allegra brigata ponte san nicolò strattera milch cipro oral suspension 5 cymbalta dá sono cialis e soffio al cuore abilify farmaco mutuabile propranolol sfd case in vendita a cipro roma ventolin pipa ára generico do voltaren rapid voltaren 75 mg posologia si puo prendere mezza pasticca di cialis forma farmaceutica viagra viagra e problemi di cuore nolvadex nell'uomo costo de cytotec colombia voltaren emulgel medicinale posologia augmentin per bronchite compazine iv alternative strattera sobredosis voltaren gel 1 o 2 risperdal vida media acquisto cytotec+contrassegno arimidex aumenta il colesterolo triamcinolone acetonide nystatin gramicidin neomycin lisinopril consulta dimensione turismo cipro anti diarrhea medicine cipro atrovent con ventolin clomid test di gravidanza acquistare xenical orlistat coumadin e caduta dei capelli grotta del remeron varese lamisil at tinea versicolor riduzione seroquel voltaren sandoz casa del re di cipro conegliano allegra madrid dolore al seno dopo clomid viagra generico uk zovirax crema generico viagra de vanzare in timisoara venere.com cipro metoprolol a ciaza alluce valgo voltaren diflucan per l'uomo pizzeria la luna allegra roma il viagra nelle donne cialis pagare in contrassegno voltaren 75 indicaciones viagra leucemia ingorgo mammario augmentin temperature mensili cipro levitra 10 mg en colombia finasteride cosa serve dutasteride bellicapelli strattera generico mexico vendo lipitor chile camper ci cipro 2 viagra venta libre colombia lisinopril biodisponibilidad escitalopram chile nizoral comprimé posologie restaurant pizzeria allegra mannheim voltaren und opipramol motrin farmacologia intossicazione methotrexate