Jump to content

JonnoTheDev

Staff Alumni
  • Posts

    3,584
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by JonnoTheDev

  1. You need to group the results into an associative array that will make it easier to loop over and add a break i.e array('oct 2010' => array(array('05 October','Calvert Smith','6.45pm',Roko'), array('12 October','Thermal Pigs','7.45pm','Roko')) 'nov 2010' => array(array('02 November','FC Not A Clue','6.45pm','Roko'), array('09 November','Inter York','5.45pm','Roko')));
  2. If working with PHP you should opt for MySQL as your storage engine. Here is a complete tutorial. http://articles.sitepoint.com/article/php-gallery-system-minutes
  3. What I meant was not to use the mail() function within a loop i.e foreach($addresses as $email) { mail($email, 'subject', 'body', $headers); } Quote from php.net http://uk.php.net/manual/en/function.mail.php PHPMailer is suitable. Also PEAR Mail http://pear.php.net/package/Mail
  4. Usually local computer shops will do a refurbed PC. I've seen P4's with about 1g of RAM for about £50. Easily enough to run a local server for a test bed. You could also try eBay. http://cgi.ebay.co.uk/Pentium4-Fujitsu-Siemens-Esprimo-P2510-Desktop-Computer-/140486967387?pt=UK_Computing_DesktopPCs&hash=item20b5ad005b http://cgi.ebay.co.uk/Dell-dimension-3000-pentium-4-2-8-GHz-512-MB-RAM-/290505947272?pt=UK_Computing_DesktopPCs&hash=item43a380f888
  5. Use a SMTP mail server to do the sending. Do not use the php mail() function in a huge loop. Look at the following library: http://swiftmailer.org/
  6. No. A good DVD-RW will support dual layer discs and can write to both sides.
  7. Design 1. Documentation: Specification 2. Create layout images in photoshop to show to client & get signed off 3. Create basic templates from design, construct images, css, etc. This is not a full website nor functional. Usually created on local machine or test domain. Development 1. Documentation: Specification, system flow diagrams, UML (if required), design notes, database design 2. Create database 3. Construct CMS 4. Build front end using the templates created in design phase and add functionality 5. Test
  8. That is client side not server side. If you have doc files on a web server and want to serve them as PDFs to a user you require server side conversion tools.
  9. First result on Google http://www.phplivedocx.org/2009/02/06/convert-doc-to-pdf-in-php/
  10. Isn't that just for sending mail, like swiftmailer? The user wants the ability to open pop3 mailboxes and display the messages on his website for the user that is logged in sort of like a webmail client.
  11. You can connect to any pop3 mailbox and issue commands using PHP with the following functions: fsockopen fgets fputs Using fputs() you can issue the following commands: LIST - list all messages RETR x - get message number x DELE x - delete message number x QUIT - close mailbox Try the following: http://www.phpclasses.org/package/2-PHP-Access-to-e-mail-mailboxes-using-the-POP3-protocol.html
  12. Wordpress. It has a massive community & endless plugins.
  13. What template engine does punbb use. Is it smarty? If it does just enclose the code as follows in the template file: {php} $dayOfWeek = date("w"); switch($dayOfWeek) { case 2: {/php} <script language='JavaScript' src="http://a.admaxserver.com/servlet/ajrotator/414071/0/vj?z=admaxasia2&dim=280733&pid=7127b37b-3892-4347-8bae-3c9cccf05f6c&asid=1d4556ac-49ee-4004-a196-986327e519ee"></script><noscript><a href="http://a.admaxserver.com/servlet/ajrotator/414071/0/cc?z=admaxasia2&pid=7127b37b-3892-4347-8bae-3c9cccf05f6c&asid=1d4556ac-49ee-4004-a196-986327e519ee"><img src="http://a.admaxserver.com/servlet/ajrotator/414071/0/vc?z=admaxasia2&dim=280733&pid=7127b37b-3892-4347-8bae-3c9cccf05f6c&asid=1d4556ac-49ee-4004-a196-986327e519ee&abr=$imginiframe" width="300" height="250" border="0"></a></noscript> {php} break; case 5: print "<b>Good Friday morning</b>\n"; break; default: print "<b>Good morning</b>\n"; break; } {/php} http://www.smarty.net/docs/en/language.function.php.tpl
  14. <?php /* test module 1 */ if($_SESSION['authdata']['modules'][1]) { print "link to module"; } /* test module 2 */ if($_SESSION['authdata']['modules'][2]) { print "link to module"; } ?> The above could easily be done in a loop. <?php /* module1.php */ if(!$_SESSION['authdata']['modules'][1]) { /* redirect user - access to this module not permitted */ header("Location:/index"); exit(); } ?> I wouldn't do this. I would definately prefer an array of boolean values that are set after initial login into a session and used as above. This will reduce the number of queries running on the page if you are checking access levels on each page load via a database query. However you would do it with something like: <?php function checkAccess($module, $userId) { $result = mysql_query("SELECT access FROM modules WHERE userId='".$userId."' AND module='".$module."'"); /* if result return true */ if(mysql_num_rows($result)) { return true; } return false; } /* test module 1 (userId stored in session) */ if(checkAccess(1,$_SESSION['authdata']['userId'])) { print "link to module"; } ?>
  15. That's the logical step for a programming language that does not enforce OOP such as Java, especially if you are a beginner.
  16. yes it is done using ffmpeg, read my previous posts the links are there
  17. It shows 4 tables at a time and then moves onto the next 4 every 5 seconds.
  18. Any book on PHP will teach you enough to get going. The php manual http://php.net lists every function and its usage. When the term Advanced Programming is used it does not mean that you will be using functions any differently to that of a junior, it is more to do with the structure & layout of the code. Advanced programming techniques usually refer to Object Oriented Programming in which parts of a program are defined as objects mimicking real world entities such as a car, a ball, or a house. In OOP there are design patterns used that solve common problems, also you may have heard of Frameworks. These are OOP libraries of code that can be used to make application features using much less client code and time. These are things you shouldn't worry about right now. Stick with your book, get used to the PHP syntax and see what you can achieve. When you are happy with what you have learnt, move onto a book aimed at the intermediate level. There are loads in the carousel at the bottom of this page. I have around 15 books scattered around the office, however I mostly just use them for reference. My main source of information is definately the php website.
  19. Heres a quick & dirty one I have made for you. If there are other tables on your page as opposed to the ones you propose to cycle through this will hide them as I have just referenced all tables in the document (I do not know what the rest of the document looks like). This can be easily changed by adding a class to your table within the loop. Make sure you change the script src attribute to wherever you have the jquery library saved. I would suggest you run as test.html first to see it working <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Cycle</title> <!-- change src to path of jquery --> <script type="text/javascript" src="jquery-1.4.js"></script> <script type="text/javascript"> $(document).ready(function() { var counter = 0; var numitems = $('table').size(); function displayItems() { $('table').hide(); var items = $('table').slice(counter,counter+4); $(items).each(function(n) { if($(this).is(':hidden')) { $(this).slideDown('slow'); } counter++; if(counter == numitems) { counter = 0; } }); setTimeout(displayItems,5000); } displayItems(); }); </script> </head> <body> <table> <tr> <td>table 1</td> </tr> </table> <table> <tr> <td>table 2</td> </tr> </table> <table> <tr> <td>table 3</td> </tr> </table> <table> <tr> <td>table 4</td> </tr> </table> <table> <tr> <td>table 5</td> </tr> </table> <table> <tr> <td>table 6</td> </tr> </table> <table> <tr> <td>table 7</td> </tr> </table> <table> <tr> <td>table 8</td> </tr> </table> <table> <tr> <td>table 9</td> </tr> </table> <table> <tr> <td>table 10</td> </tr> </table> </body> </html>
  20. It is a PHP file not a HTML document! You must save the file as .php i.e index.php You must test on a server running php or have php running on your computer. I thought you said you have an index.php file?
  21. So you basically want to show 4 tables at a time from your database query rather than the complete result set in one go?
  22. It doesn't. Most websites are database driven. As long as your pages are accessible via internal links, not all behind forms, etc, there are no issues. Make sure your urls are friendly i.e bad: /foobar.php?p=cars&x=1&y=2&z=3 good: /foobar/cars/1/2/3 If you are constantly having to make changes to the content it would be a good idea to make those sections content managed such as adding / editing vehicles, changing prices, adding manufacturers categories, modifying page content, etc. Then modifications to content can be made by anyone who has access to the CMS, and you just stick to developing the website as opposed to menial tasks such as changing content.
  23. The problem is that the image is 500k. That is far too large. Also it looks terrible. I would use a standard web safe font, arial, verdana, helvetica, etc. What you have to say to your boss is: Does he want the website to be found on Google? If not then do what you like. If you complete this as it is currently is you will find that after a few months you will have little or no traffic from any search engines. Another thing is that your page titles are the same on every page. Google will immediately penalise you for this. From what I have seen you are not familiar with basic SEO. If this is not an issue with your site, no worries. However seeing that it is a business, then search engine results are key for traffic and conversions to sales. This site fails on all levels of SEO. I suggest you download http://www.seobook.com/ and read on site architecture. I'm not having a go or being personal, I just know that somewhere down the line after you have made this website your boss will turn round and say why have we not had any sales from our website. So, really it's just a warning.
  24. The IN clause should not be in quotes. It should be as follows: IN(08002,08003,08004) No, wouldn't you retrieve the array key value from the results of the query. After all you will be looping through the query results which contain the zipcode, so you essentially just obtain the value from the initial array i.e <?php while($row = mysql_fetch_assoc($result)) { print "Distance: ".$arr[$row['zip']]; } ?> On another note this query is terrible. Using LIKE on so many table fields is bad. If you are storing lots of text content you will find that this query takes a long time. If you are experienced enough you should be using a FULL TEXT search engine such as Sphinx to do this sort of querying. You would use Sphinx to retrieve records matching the text search and then filter down to those only containing the desired zip codes. However, before jumping into this, see how you get on using MySQL.
  25. You need the content in order to get your pages indexed on search engines. How will you get any traffic if you do not have pages containing content describing what you are offering to the customer? What are your main keyphrases that you want people to find your website under? Users will not land on your homepage from a search engine, you cannot target all searchphrases on one single page. If a user was to search on Google for 'Buying a Honda Civic', you will want your Honda page to appear in the search results. This is where you must use targeted content. Also a search engine cannot fill in your search box on your website. You need to make these pages accessible to a search engine from a sitemap. http://www.bikescarsandvans.co.uk/about_us.php You should not use images to display text. The step1,2 etc content should be text. The cogs can still be graphics and positioned with CSS. Remember, text content is king. Content within images is useless! http://www.bikescarsandvans.co.uk/details.php This page should be split up. There are far too many results to display and the load time is horrendous. Also some of the images are skewed. You should resize to the correct aspect ratio. Your additional features CSS is poor. It does not work. I would place this on a detail page for the actual vehicle. Again the images are poor and when clicked they just return the user to the top of the page. This site could be massively improved. I think it is more of the navigation and the actual page content that needs work. The design is not that bad.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.