Jump to content

chibineku

Members
  • Posts

    1,278
  • Joined

  • Last visited

Posts posted by chibineku

  1. To send HTML emails, you have to use a server side programming language, like ASP or PHP. It's very easy to send one from PHP once you have it set up and learn the basics. For example, it can be as simple as this example from the PHP online manual:

    <?php// multiple recipients$to  = 'aidan@example.com' . ', '; // note the comma$to .= 'wez@example.com';// subject$subject = 'Birthday Reminders for August';// message$message = '<html><head>  <title>Birthday Reminders for August</title></head><body>  <p>Here are the birthdays upcoming in August!</p>  <table>	<tr>	  <th>Person</th><th>Day</th><th>Month</th><th>Year</th>	</tr>	<tr>	  <td>Joe</td><td>3rd</td><td>August</td><td>1970</td>	</tr>	<tr>	  <td>Sally</td><td>17th</td><td>August</td><td>1973</td>	</tr>  </table></body></html>';// To send HTML mail, the Content-type header must be set$headers  = 'MIME-Version: 1.0' . "\r\n";$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";// Additional headers$headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "\r\n";$headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n";$headers .= 'Cc: birthdayarchive@example.com' . "\r\n";$headers .= 'Bcc: birthdaycheck@example.com' . "\r\n";// Mail itmail($to, $subject, $message, $headers);?>

  2. Here is an example of extending a JavaScript prototype:

    String.prototype.explode = function() {  var exploded = new Array();  for(i=0;i<this.length;i++) {	exploded[i] = this.substr(i, 1);  }  return exploded;}

    This function splits a string into single characters, each one occupying the next space in an array. For example:if the variable testString = 'hi there', then testString.explode() would return:

    array { [0] => h [1] => i [2] =>  [3] => t [4] => h [5] => e [6] => r [7] => e}

    The syntax is very straightforward: ObjectName.prototype.methodName = function() { }So, if you want to extend the string object, then replace ObjectName with String, and replace methodName with whatever you want your new method to be called, and then define the function within the braces. I believe you always need to return from the function.

  3. SEO really seems to be a matter of following some basic principles and having patience.As wirehopper said, quality content and relevant inbound links are gold. If you have those, then you will get a good ranking. There are other factors, though it's hard to quantify how much impact each has.Avoid labouriously repeated content. Duplicate content will be punished by web crawlers. Poor sites often tend to have hundreds of instances of the important keywords. Make sure your code validates. Redirect using the proper status codes in order to retain any link value you have built up. For example, I am developing on sinaesthesia.co.uk but my site will be migrated to aromaclear.co.uk. I have been working on my site and posting links to problem pages on this forum for many months, so search engines know about sinaesthesia.co.uk. When I migrate the site, I will use apache's mod_rewrite to do a 301 permanent redirect to the new domain. This means that I don't lose the value of the links from this forum. The only possible downside is that search engine spiders may realise that this is a coding website and nothing to do with the products aromaclear.co.uk will be selling. Apparently the invisible keyword and description meta tags are becoming less important, as is any other invisible page content, because you can hide irrelevent content in there simply to try to broaden the range of search terms which will cause your site to appear in a search engine. Who wants to get a page selling psoriasis treatment when they were searching for how to grow cabbages, simply because I threw a whole dictionary into my keywords meta tag?There are some other pieces of advice that don't affect search engine ranking necessarily, but might make people more inclined to click once your page comes up in a search engine. Pretty URLs, for example, are more appealing than raw ones.By a raw URL, I mean something like:aromaclear.co.uk/product_details.php5?sessid=234234923050234923092349&category=psoriasis&productid=3A more appealing URL might look like:aromaclear.co.uk/products/psoriasis/conditioner/3People are more likely to be able to remember it and it's clear that this is what they were after. There are a lot of SEO companies offering better rankings, and I'm fairly sure it's all grey- or black-hat SEO, which can even involve spamming forums and groups with links to your site. Almost like an affiliate program, but where there isn't any real affiliation. Genuine links to your site from others that share subject matter are really the holy grail, and that takes a good website, honest content, advertising and patience to achieve.

  4. The problem with the apple logo appearing as a mess is that line breaks are not treated as such in HTML unless the parent tag has white-space: pre; declared in the CSS.

  5. This is a pretty common idea amongst new posters here - I remember starting a similar thread a while ago and getting little back. I started building an e-commerce site shortly after learning the basics and that was a really good learning experience. It encompassed HTML markup that validates, CSS that validates, JavaScript to make my menus click-through, jQuery to make managing account information cleaner looking, MySQL to store a product catalogue and PHP to fetch, order and display it, using a payment providor's API, automating e-mails, styling for printing, a registration/log-in system, a shopping cart.. There is a lot to it and I'm proud of it. But I would probably have given up if it had been a mock project. It helped that it's for someone else (it also helped that that someone else is my mother who knows nothing about web development and whose own work ethic when it comes to writing the website content is worse than my own). Building yourself a dynamic, database driven website with a server side language to manage the database, a login system and some flashy upgrades using JavaScript will give you a really good start, I think. Remember the number one rule with JavaScript though, which is that your site shouldn't depend on it to function - it should be extra gloss only, unless you can be assured that your audience won't turn it off or that in turning it off, users can't abuse your site. Something I found really useful was following the exercises in Sams Teach Yourself PHP, MySQL and Apache. They take you through a login system, a basic forum, a calendar, an address book, a very simple shopping cart/store. Really fundamental stuff.

  6. In fact, building the software is quite easy - there is a technique for turning HTML, CSS + JavaScript into native Cocoa apps using XCode on the mac. So learning a variant of C is entirely optional - the hardware is made available through JavaScript.Thanks, thescientist. It's, um, rather serious, and recovery is unlikely, but I appreciate the thought.

  7. I e-mailed the company in London, called canopycapital, and the director got back to me within a few hours saying that he thought it was an interesting idea for an app, and wanted to know if I had a prototype he could see. I don't, unfortunately. I have been having health problems for a couple of years and they've rather come to a head in the last few weeks, and it's unlikely that I'll be able to see the project through. If anyone wants the idea, they can have it.

  8. A where statement like 'where 1' is technically not needed as is adds nothing to the query. Quotes around table and field names aren't usually necessary. A blob is a field datatype. You should refer to the database manual to read about the different kinds as they each have specific size and type limits as well as an impact on table size efficiency and searchability. Do you understand where clauses in general?It is used to filter a select or update query. If we want to select all data about people whose surname is smith from the table 'people', we might have the following query:SELECT * FROM people WHERE surname = 'Smith';

  9. If you only want your descriptions to be on one line, you can stick it in a div or something and give it text-overflow: ellipsis and white-space: no-wrap. Then any text that runs too wide will be hidden and three dots will appear at the end, indicating that there is text missing.

  10. From checking on php.net, it seems that extract is a simplified way of unpacking an array into variables whose name is that of the array index. For example, if I have the array

    $pets = array("dog" => "Rover", "cat" => "Alan");

    If I want to be able to access the array values by the index, so that $dog returns 'Rover', I would normally do:

    for($pets as $k => $v) {$k = $v;}

    extract() does that for me, and allows me to control what happens in the event that there is already a variable with the name as a given index. It's a useful shortcut which I'm glad to discover.

  11. It could very well be a web based thing as well, but I want to use the show-off chic of smartphones, as well as piggy back the painless one-click-payment that iTunes (in particular) already has in place. I want those inclined to discuss any new apps they've DLed to show their friends and their friends to go 'oh, cool, I'm going to DL that!'. It's recommended that all iphone apps have a website with information on how to use it, how to contact the developer, etc., so I could easily build a web based version and host it there.The noble conservation app is the rainforest version which offers no return, but I figure that FSC approved sustainable forests are run as businesses, so why not help them while also offering an investment to customers? Perhaps people will buy one of each and two trees will get planted.

  12. I realised as soon as I sent this that there was an error with my function anyway, but I couldn't stay to fix it.It's actually simpler than I made it out to be and doesn't involve the AJAX class at all.This would be the function using jQuery's .load() method:

    function breakingNews() {$('#news_box').load('http://www.domain.com/breaking_news.html');timer;}var timer = setTimeout("breakingNews()", 180);

    Edit: As ShadowMage, thescientist and Synook said, it's better to learn this stuff too and not depend on other's code.

  13. The AJAX syntax can be indimidating because it's a little complicated. You can learn it (or copy it) from the examples in the W3Schools AJAX tutorial or you can cheat and use jQuery, which simplifies AJAX calls.I recommend learning it, so you understand what's going on, and you are also advised to learn a goodly amount of JavaScript before learning jQuery.My disclaimer out of the way, here's what a typical AJAX function would look like to do what you want.Say your breaking news page contains markup like this:

    <h1>OMG - Britney's socks don't match!</h1><p>In a sartorial tragedy of earth shattering proportions, Britney Spears was spotted out and about in LA.  Nothing surprising there but, on the fateful afternoon of April 29th, not only was she wearing socks with sandals, but her socks didn't even match!</p><p><a href="/britney_story.html">Click here for the full story + shocking images!</a></p>

    With jQuery included in your document (you can follow the very straightforward directions at jQuery.com), your breakingNews function might look like this:

    function breakingNews() {$.get("breaking_news.html", {}, function(data) {$('#news_box').html(data);timer;}var timer = setTimeout("breakingNews()", 180);

    I haven't tested that, but it's the general idea.

  14. Okay, so I have done the cheap copyright of detailing my app idea and sending it recorded signed for delivery, so now I can canvas for opinions on it.The idea is simple and comes in two flavours.

    1. iRainforest - you buy the app for say £5 and when you open it you are presented with a google map of the Amazon rainforest. Areas with existing forest are in green and areas which have been deforested are red. You have one tree which you can drop anywhere you like in the red area and the coordinates are stored on your phone and the remote server.Within a fortnight, someone will plant your tree and you can track it on Google Earth. This tree will be part of a protected conservation project and will remain there for as long as the project can sustain.
    2. My Tree - this time, instead of the Amazon rainforest, your tree is planted in an FSC managed sustainable forest and, when your tree comes to term (15-25 years) you will get a share of the profits. This app will cost slightly more.

    Both ideas sound a bit out there, but there are companies I feel sure I could get on board. For a start there is a company in London that sells shares in the Amazon rainforest to make it a more profitable business keeping it alive than cutting it down - no mean feat, given that a virgin tree can fetch up to £40,000. With more and more people concerned about the environment and keeping it habitable for humans and species found only in the rainforest, I think the apps would get a good reception, especially because they give you something real for your contribution. Often when you give to a charity, you feel that your small donation will have no impact. Now it will, and you can track and view your tree - even visit it, should you want to.Thoughts?

  15. I am a big fan of books to aid learning. I feel more confident in the instruction therein than on some random website (obviously the official sites are good, but it can be hard to gauge how reputable a website of tutorials is). My favourite books are:java script: The JavaScript Bible by Goodman & Morrison - Wiley's Bible rangejQuery: Learning jQuery 1.3 by Chaffer and Swedberg - PAKT publishingHTML & CSS: Mastering Integrated HTML and CSS by Virginia DeBolt - John Wiley & SonsPHP & MySQL: PHP, MySQL & Apache - SAMS Teach YourselfSEO: Search Engine Optimization with PHP by Sirovich & Darie - WroxI also enjoyed The Manga Guide To Databases. As a fan of both databases and manga, it was a very entertaining guide to the subject,

  16. I know, it can be soul destroying hunting for a problem - you tend to focus on problems with syntax and implementation and ignore a little typo, something in the wrong case, etc. The first time I tried jQuery I spent two hours trying to find the problem with my broken script. I had missed a quote around the opening script tag. Makes you feel pretty dumb.

  17. Notice that the first few lines of the script are the ones reading the mages and creating the output. You do that before you insert the new image. So the new image isn't being read.

  18. What do you mean 'there were errors'? What kind of errors? I notice an if statement which says (if con == false), which it will since it's never been declared.Instead of copying the same code 30 times in the first function, why not do:

    for(no=0; no < 30; no++) { alert("Pressing OK Number " + no);}

×
×
  • Create New...