I’m a curious sort of guy; I like to delve into things; as a result when things don’t work the way they’re supposed to I don’t give up in disgust but look for a reason in the hope that I’ll find a ‘cure’.
Sometimes this leads to a lot of frustration, because we all naturally like to overcomplicating things. And, very often, the ‘cure’ is often much simpler than we would ever have believed.
If you’ll allow me I’ll just illustrate this with a couple of changes I’ve had to make to a sales page and, indeed, this blog.
First, as you’ll have seen, I’ve been helping Frank Haywood iron out the wrinkles in his Nickel Sale script prior to it being released for sale.
Now, in Frank’s usual way, this is all going well and no real hiccups so far. But I did come across a problem when I tried to combine both the Unlimited Exit Popup software that I’m selling AND the Nickel Sale script (if you’re curious you can see both in action here www.monday-madness.com/UEPNS ).
The ‘problem’ is caused by Frank’s script being helpful in coding the Buy Now button as a php tag. And the Unlimited Exit Popup employs a piece of Javascript code that has to be applied to the href link for the Buy Now button.
The upshot was that, because I didn’t have an href link for the Buy Now button, I couldn’t apply the Javascript code. No doubt much to the first few buyers’ amusement, and possibly annoyance, this meant that when you clicked the Buy Now button the Unlimited Exit Popup did it’s job and asked ‘Are you sure you really want to leave this page’!
Hah! I must admit I was panicking as the deadline for the Nickel Sale going live approached. And, when you panic, it impedes you even more from seeing the answer.
A simple answer
The answer, when it finally came to me five minutes after the sale went ‘live’, did prove ridiculously simple. After a good hour of messing around with Javascript coding and delving into the php code (plus following a lot of well meaning, but overcomplicated, stuff about using OnClick functions that I found on coder’s web pages) I just housed the php tag and Javascript in an html anchor so:
<a onClick=”javascript:PreventExitPop = true”>{PAYMENT_BUTTON2}</a>
Ridiculously simple, and I kicked myself for not thinking of it earlier!
If you’ve bought the the Unlimited Exit Popup you may well find this useful when applying UEP to your own sales pages. Just replace the {PAYMENT_BUTTON2} tag with whatever target link you want UEP to ignore. If you are planning on buying Frank’s Nickel Script, and I recommend you do when it’s finally available, and using it with UEP then again make a note of this too. It could save you hours of frustration!
Pretty Permalinks
Again I’m mentioning this simply because it cost me several hours of searching before I found it.
I received an email today from Jeff (thanks for your help, Jeff) who alerted me to the fact that my Pretty Permalinks weren’t working. Now I like to use Pretty Permalinks for my blogs because, not only are they SEO friendly, but they look better in your browser too.
I won’t bore you with the ins and outs of WordPress Permalink structure but just to say that, again, the answer proved ridiculously simple. All I had to do was add one line to the wp-includes/vars.php file as outlined in this extract from the WordPress Codex:
Server Blockage: Your host might have blocked the SERVER_SOFTWARE variable and this will cause WordPress’ .htaccess generation to fail. If you are sure that your server is running Apache, you can force WordPress to believe that your server is running Apache by changing your wp-includes/vars.php file. Follow the steps below to implement these changes.
1. Open the wp-includes/vars.php file using the built in file editor in your WordPress Admin panel. To navigate to this panel, login to WordPress, click on “Manage”, then on “Files”, scroll to the bottom and type in wp-includes/vars.php into the text box under the “Other Files” title.
2. Look for $is_apache = strstr($_SERVER['SERVER_SOFTWARE'], ‘Apache’) ? 1 : 0;, once you find it replace it with// $is_apache = strstr($_SERVER['SERVER_SOFTWARE'], ‘Apache’) ? 1 : 0;
3. Add a new line under // $is_apache = strstr($_SERVER['SERVER_SOFTWARE'], ‘Apache’) ? 1 : 0; and type in
$is_apache = 1;
I downloaded and modified the vars.php file as described above to force WP to believe that Apache was there, then uploaded it again (you’ll have to do this if your server permissions don’t allow WP to modify the file in the Admin panel). Then I reset my permalink options to my custom style and WP successfully created the new .htaccess with the proper mod_rewrite rules.
Again I’m including it in the hope of saving someone else hours of frustration when the answer is disturbingly simple (once you know)!
Hi Jonathan, I am glad that you have the SEO friendly permalinks fixed. It can be a real drag sorting out how the php and your host’s server interact. I had my share of that when I started a blog some time back.
The snow covered countryside look lovely (a previous post of yours). I live on the Gold Coast, Australia and so we do not see any snow here.
Geoff