Archive for November, 2005

I was asked to fix some code for a web site as the previous developer had left a couple of holes in it and presumably the client was unhappy with him so I was asked to take a look. Whilst looking at the known problems I've uncovered others too. Most of these are easily fixable but the main problem, the reason I was hired for, was that the instant payment notification from PayPal wasn't working. So I've spent all day today trying to look through someone elses code and work out why it's not working.

Once I'd checked it over I figured I'd learn how to test it for free as I've always used my own money previously. After a bit of investigate I discovered the PayPal Sandbox which can be set up at http://developer.paypal.com. In a nutshell, you register with the sandbox, then set up a test user and test business. Give each a bank account and the test user a credit card (all default info preset), turn IPN on in the test business and then set your paypal script to point to https://www.sandbox.paypal.com/webscr instead of https://www.paypal.com/webscr. Then you can run it all as normal except that it doesn't cost you. The only thing I couldn't get to work was for the status to come back as VERIFIED. It kept saying INVALID. This I believe was down to the fact that the IPN script wasn't sending the info back to the sandbox server and so the information was getting confused, however the rest of it worked fine and the payment status was saying completed so at least I know in the future to ignore the actual VERIFIED / INVALID status and just act on whether it's completed or not.

Anyhow, once I'd sussed this I moved on to the live system, ensured that the basics worked (just paying 1p per transaction) and then started uncommenting the previous extra code to see where it fell over. I've spent all day on this to finally work out that the database connection include was infact a function (why, why would anyone create it as a function?!! it doubles the number of lines used for a simple db connection!!!), and this function wasn't actually being run, just included, therefore there was no database connection and subsequently no database selected.

In the process of all this I completely forgot about how credit card cloners work and sent 4 payments of 1p off my business account card and now my card is locked down too until I get through to customer services in the morning! (good job there's no money in there!!). Incidentally you're better off loading your account with £5 and use that. All money paid out can be refunded for free as well, so you'll just lose the fee for putting the money into paypal (only because I had to use a credit card at that point!).

All in all a long day. And the cherry on the cake is a web site that I've been working on since August, for very little money, has just had a list of 'web site observations' sent back, all 7 pages of it! The best one was "please capitalise the first letter of every sentence". The text of course was supplied by them originally and copied and formatted by us, i.e. no cases were changed. Plus this was typed up in Word so in theory they purposely went through and made every letter lowercase as Word automatically capitalises the first letter of every sentence! Plus various other additions… I'll be glad when it's done, paid for and gone. At least then i can refuse work off them in the future if I feel like it. I have far too much to do and far more work worth a lot more than they'd ever pay out. Perhaps I'll send them in the direction of the developer whose code I'm now being paid to fix…?!! ;)

I've just picked this up off a site I subscribe to the feeds for. It's a free 10 week course on CSS and XHTML from the very start. A must for anyone who's interested in learning it the right way ;)

Free CSS & XHTML course

I've spent the whole of today staring at a tiny number of clicks making a tiny amount of cash (I could probably pick up more between the house and the car). Yet in the last hour my adsense earnings updated and made my eyes open for the first time since the Swish site went live. Now I know I'm not meant to discuss clicks and figures so we'll use algebra (well I am a mathematician afterall!). For the first part of the day I had x number of clicks making y cents. Then 1 extra click made y * 10+ times earnings. I know anyone who deals with using adsense will probably understand what I'm saying, basically why is it that on the same web site you can make anything between 1c and over $1 in a click? And more to the point, how do I get the higher paying adverts on every page??!! I've started to rewrite my current page text and add more content to the internal pages, targeting better phrases on each page, hoping to bring in the higher paying ads. I know the media partners bot from google reads your site and then determines the likelyhood of the advert displayed being clicked on and more to the point making a sale via that click.nnI've made more on this site with 2 clicks than i have with 30-40 clicks on my swish site – it's just very frustrating. Unfortunately I don't have the time to download the new version of the software and play around with it to give me the knowledge to write any articles, plus my content writing is bad enough as it is! The only help I can offer is with PHP but I don't think you can use that with Swish, just Flash.nnTo add to this, the Amazon links are for Amazon UK and of course most of my visitors are from the US. I've looked at signing up with amazon.com (I'm sure once a long time ago I had…!) however the options available for payments is amazon.com credit, a cheque for $100 less $8 fee ($8 to write a bloody cheque?!!) or else payment into a US bank account. Handy that last one :( I'm thinking about the options and if I did set up with amazon.com as well (I can't seem to find any other book site selling the book) then I guess the account credit would be used for stuff. Of course a cheque for $92 would be better than nothing, but I just feel that 8% of it going back into amazon's pocket is a bit much. Still I have a lot of looking around to do once the busy period of work is over with, I've just not had a great deal of time to research stuff, plus I get paid more per hour by clients than I currently do by my sideline sites so I can't justify the time at the moment!

I thought I'd do a quick round up of my Swish World AIS site's earnings as it's been a month and a 3 days since I purchased the site and started work on it (and I'm bored and fed up of doing client work!).nnPaid out £20 for the web site:nAdsense – $51nAmazon – £1.40nnTherefore this site has definitely covered the money paid out for it from my perspective. Of course there's 4 years worth of domain fees that my friend has paid out so I can't say for sure if it's broken even on money yet. However time is another thing. I've spent around 5-10 hours on this website, adding products, cleaning up the pages, researching key phrases etc. Unfortunately there is a lot I would like to do to the site however time is one thing I don't have much of recently due to my business.nnThat said, the visitor numbers are beginning to drop from their post-indexed-in-google high of 140 down to around 70-80 a day. Whilst I still get into double figures for clicks, the money generated per click is just miniscule. In theory, if I'd had payouts that I've received on other sites (such as this and even a contentless holding page) I'd be looking at over $500 of adsense revenue easily! It's just a shame that it's a low paying topic when it comes to adwords.nnI have managed to find another template source tonight however so I've signed up to that as an affiliate and just waiting for confirmation. Whilst the Template Monster templates are great to sell and easy to set up… everyone sells them! A lot of the Swish sites I've looked at have Swish templates from template monster for sale. Unfortunately when something gets a little repetitive people get fed up of seeing it! So I'm hoping to source other products or templates that I can sell.nnI've also started to work on pulling all the files into the root directory. This makes it easier to update, easier for the linking and hopefully google will not see the directory structure as a 'footprint' of a link directory site and be nicer to me! I've started to add content to each page too hoping to trigger better paying adverts and also give something for the spiders to feed off. Unfortunately it doesn't seem like Googlebot is at all interested again as it's not indexed any of the altered pages I put up last week :( I know my content writing is bad but that bad?!! I've not looked into the raw logs to see where googlebot is actually going during visits so I'm hoping that it'll notice an update on the sitemap and the 302 permanent redirects I've put in place for the old to new pages and perhaps re-cache the pages.nnHowever on to bigger and better things! The Tribal Tattoo site has had 15 pages indexed since going live on Monday, yesterday's visitor count was 51 and so far we've had 35 visitors via search engines, Google supplying 33 of them. Money wise, no Tattoo Flashes have been sold yet and the adsense doesn't even hit $5 but it's early days and you have to bear in mind this website is completely brand new unlike the Swish World one, so it's still taking time to get the spiders in – but I hope things will start to change soon. Again we have a lot of work and products still to add to this site too, I'm just looking for the time inbetween client work, contract work and sleeping.nnOh and I sold a template last night for $13 commission so that's spurned me on to get my template site more up-to-date with more template suppliers as I think there's more money to be made quicker in that business :D

So now we can take information from the various lesson posts and tie it all together to do something wortwhile! I've explained how to Retrieve Form Post variables and Send Emails, so how about a comment form that gathers a person's details and emails them to you?

Okay first you need the form:

<form method="post" action="form-mail.php">
<label for="name">Name:</label> <input type="text" name="name" id="name" size="20" />
<label for="email">Email:</label> <input type="text" name="email" id="email" size="20" />
<label for="comments">Comments:</label> <textarea name="comments" id="comments" cols="30" rows="5"></textarea>
<input type="submit" name="submit" id="submit" value="Submit Form" />
</form>

So above we have a simple form (which you would use CSS to style how it is displayed). When the form is submitted it will post the values to the form-mail.php page. This page would contain PHP script at the top to retrieve the form post data, email it to you and then just display a simple thank you page. The PHP script required is:

<?php
$name = $_POST['name'];
$from_email = $_POST['email'];
$comments = $_POST['comments'];
$mailbody = "From: ".$name."\n";
$mailbody .= "Email: ".$from_email."\n";
$mailbody .= "Comments: ".$comments;
mail("toemail@domain.com", "Form Results from Web site", $mailbody, "From: website@domain.com");
?>

Here the code retrieves the information from the _POST array. It then creates a string variable called $mailbody and stored the information into it. Similar to using the print method, but instead of outputting the information to the screen we just save it to a variable instead. The "\n" at the end of each line just means a newline in the plain text email body to make it easier to read. Then the mail() function is run.

This is a very simple example. To expand on this you could (or should) check to ensure that the form fields have had information entered however I'll give an example of that after I've explained control structures ;)

Page 1 of 912345»...Last »

Latest Tweets