Jump to content

JonnoTheDev

Staff Alumni
  • Posts

    3,584
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by JonnoTheDev

  1. All over the Internet. First sentence: http://en.wikipedia.org/wiki/Database_normalization
  2. You are not including all these libraries are you? You have clashing versions of the jQuery library. If you need to use 2 different versions of jQuery in the same document you must follow the instructions on the jQuery website. <link type="text/css" href="../js/css/themename/jquery-ui-1.8.11.custom.css" rel="Stylesheet" /> <script type="text/javascript" src="../js/js/jquery-1.5.1.min.js"></script> <script type="text/javascript" src="../js/js/jquery-ui-1.8.11.custom.min.js"></script> <script type="text/javascript" src="../js/js/jquery-1.5.2.js"></script> You are using 1.5.1 & 1.5.2 in the same document. Should be: <link type="text/css" href="../js/css/themename/jquery-ui-1.8.11.custom.css" rel="Stylesheet" /> <script type="text/javascript" src="../js/js/jquery-1.5.2.js"></script> <script type="text/javascript" src="../js/js/jquery-ui-1.8.11.custom.min.js"></script> Also, use absolute paths or relative to the document root as it is easier if you move files into folders for any reason: <link type="text/css" href="/js/css/themename/jquery-ui-1.8.11.custom.css" rel="Stylesheet" /> <script type="text/javascript" src="/js/js/jquery-1.5.2.js"></script> <script type="text/javascript" src="/js/js/jquery-ui-1.8.11.custom.min.js"></script>
  3. I suggest reading the following examples: http://php.net/manual/en/language.oop5.visibility.php Here are the correct access levels for your class methods: <?php class a { public function foo() { print "hello word"; } } class b { protected $obj; public function __construct($obj) { $this->obj = $obj; } } class c extends b { public function accessfoo(){ $this->obj->foo(); } } $a = new a(); $c = new c($a); $c->accessfoo(); ?>
  4. I would get a cheap PC with MS Windows. Install some free proxy software on it i.e http://www.softpedia.com/get/Internet/Servers/Proxy-Servers/FreeProxy.shtml On each of the PC's on your network point the gateway IP address at the IP address of the proxy machine. You can then whitelist the websites that you want to allow through the proxy software. Any more PC's you add to the network require no additional configuration.
  5. SELECT * FROM fiesta WHERE MONTH(sta_date) = MONTH(CURDATE()) AND YEAR(sta_date) = YEAR(CURDATE()) AND DAY(sta_date) >= DAY(DATE_ADD(CURDATE(),INTERVAL 7 DAY)) ORDER BY sta_date
  6. Forget all the php date functions. Use MYSQL functions! I hope that the sta_date field in your database is of DATE type SELECT * FROM fiesta WHERE MONTH(sta_date) = MONTH(CURDATE()) AND YEAR(sta_date) = YEAR(CURDATE()) AND DAY(sta_date) >= DAY(CURDATE()) ORDER BY sta_date The above will give you all records of the current month & year that are on or in future of todays date. Test the query out before using it in your php code.
  7. The only think that you will need to consider is your actual HTML. On the pages that require SSL (https://) i.e your checkout, payment pages. Make sure that these HTML pages do not use absolute links containing a non https:// url. i.e On the following URL https://www.yourwebsite.com/payment.php make sure the HTML contains nothing like: <img src="http://www.yourwebsite.com/images/credit-card.jpg" /> or <img src="http://www.paypal.com/images/paypal.jpg" /> or <link href="http://www.yourwebsite.com/style.css" type="text/css" media="screen" rel="stylesheet" /> If you do then the browser will throw warning popups as you are including non-encrypted elements on an encrypted page. You may have seen this before on other websites. To obtain and install a certificate for the first time is a bit daunting, however it really depends on the server and OS you are running. If you are on a Microsoft server then I cannot help. If you are running Linux on a WHM/cPanel server then there are screens in the control panel that will obtain and install a certificate on your domain. You can also speak to your web host, it's pretty easy really. However, if you have your own dedicated server running Apache with SSH access you will need to do the following. 1. Make sure you have a spare IP address on your server. If not get one. It must be uniquie and not used by any other website on your server. 2. Generate a Certificate Signing Request using OpenSSL. If you haven't got OpenSSL install it using: yum install openssl. Follow these instructions: http://www.geotrust.com/resources/csr/apache_mod_ssl.htm 3. Purchase a certificate. You can get a cert using the CSR you have generated from http://www.pecdomains.com/ or http://www.godaddy.com There are loads to choose from. 4. Download the issued certificate & modify your Apache httpd.conf. You will need to upload the CRT & KEY file that you get to the paths you put into your httpd.conf file (usually /etc/httpd/conf/ssl.crt & /etc/httpd/conf/ssl.key). An example is here http://www.flatmtn.com/article/setting-ssl-certificates-apache (see from point 4). The host entry for your domain must use the IP address you added to the server earlier. 5. Restart your Apache web server (/service/httpd restart) 6. Update the DNS A record on your domain with the IP address you added to your server earlier. Wait for your domain to resolve to this address before you continue. 7. Test your website using the https:// protocol. If it works you can change the links in your website to use the https:// url when secure pages are referenced. 8. Done It is a lot but your web host should also be able to help.
  8. Yes you can. Hello Solita.
  9. printer ======== printer_id (MI Primary) printer_name (VC) cartridge ======== cartridge_id (MI Primary) cartridge_name (VC) printer_to_cartridge ======== id (INT AI Primary) printer_id (MI Index) cartridge_id (MI Index) OK you can have 1 printer to many cartridges i.e printer ======== 1, HP Deskjet 2, HP Laserjet cartridge ======== 1, HP 301 Ink Black 2, HP 348 Inkjet Photo 3, 35A Black Toner printer_to_cartridge ======== 1, 1, 1 2, 1, 2 3, 2, 3 The above relates a HP Deskjet printer to both HP 301 Ink Black & HP 348 Inkjet Photo cartridges. The HP Laserjet can use the 35A Black Toner. A simple query to get the data would be: SELECT p.printer_id, p.printer_name, c.cartridge_id, c.cartridge_name FROM printer p INNER JOIN printer_to_cartridge ptc ON(p.printer_id=ptc.printer_id) INNER JOIN cartridge c ON(c.cartridge_id=ptc.cartridge_id) ORDER BY p.printer_name ASC
  10. It's easy to get defensive when criticised over a piece of work that you have spent a lot of time on. Hell, I still do it now with my boss when he gives me feedback. It is a skill that you develop over time that gives you the ability to take comments and suggestions on the chin, and sometimes after applying them you will realise that you arguments for not doing so were weak. After time when you have worked on a heck of a lot more projects, you will stop treating them as your babies (if you continue to be a designer / developer). This is because you will build up libraries of code, templates, graphics, etc, and you will start to plug sites together from others. Any improvements that you make will become part of your toolset for other projects. It becomes almost like a production line.
  11. I would check on http://phpclasses.org as there will be lots to try
  12. Just taken on a site that has a rewrite rule in place to remove & redirect .php extensions. i.e /about.php will become /about. However, there are other rules in place and I have just noticed that if the url parameter doesn't match the rewrite condition a 501 Internal Server Error is thrown as opposed to a 404. It is definately the rule that removes the .php that is causing the issue as commenting it out solves the issue, however this rule must be left in place. RewriteEngine On RewriteBase / RewriteRule ^archive/([A-Z]{1})$ archive.php?letter=$1 [L] RewriteRule ^page/([0-9]+)$ page.php?id=$1 [L] # Remove .php extension RewriteCond %{THE_REQUEST} ^GET\ (.*)\.php\ HTTP RewriteRule (.*)\.php$ $1 [R=301] RewriteCond %{REQUEST_FILENAME}.php -f RewriteCond %{REQUEST_URI} !/$ RewriteRule (.*) $1\.php [L] ErrorDocument 404 /missing ErrorDocument 403 http://www.disney.com Ok, so if the URL is http://www.foobar.com/page/1 then it works fine. Same for removing the .php extension http://www.foobar.com/about.php will become http://www.foobar.com/about. However if I try to use an invalid URL (on an existing mod rewrite rule) to test a 404 i.e http://www.foobar.com/archive/123 then I will get a 500 Internal server error. Any ideas? Mod Rewrite not really my strongest area for debugging.
  13. I'm not sure about reliability, maybe for old browsers http://api.jquery.com/unload/ You could certainly run a maintenance script that checks for inactivity over a period of time that destroys a user's session.
  14. Use jQuery's unload handler. http://api.jquery.com/unload/ Make an AJAX call to a script that writes to your database. If you have no JS knowledge then I would really recommend looking at jQuery. Start off with a few beginner videos on YouTube. Take a look at the use of AJAX with jQuery also. http://docs.jquery.com/Tutorials
  15. I would use a data feed if you have a lot of traffic. If not a simple API lookup will do the job. Forget maintaining your own lists. Try these guys http://www.hostip.info/use.html
  16. Are you familiar with jQuery? It would make your life a lot easier. Here's a quick guide:
  17. Probably is but without scouring the manual the method I suggest would be to create x number of images & layer them into 1. Lets say your captcha contains 5 characters. I would create 5 images of lets say 20 x 20 using a different blur level for each. Take the 5 images and layer them onto a new canvas of 100 x 20.
  18. Maybe similar to the one you are already trialing bu I sometimes use http://fabforce.net/dbdesigner4/
  19. Can you not manage the DNS through your GoDaddy account? Use GoDaddy's default nameservers and point the A record at your webserver IP. http://help.godaddy.com/article/680
  20. function cssfromdate($date) { $class = array('January' => 'red', 'March' => 'blue'); return $class[$date]; }
  21. OK, well you can see how I have done this. The date value that is passed into the function is in the format YYYY-MM-DD. It extracts the month and returns the class name for that month. You can either change the array keys in the function to the month name if you want to pass the likes of 'January' in or just reformat the date. It's really simple.
  22. How is the date formatted in $row['Class_Date']. Is it YYYY-MM-DD? If so you could use a simple function: <?php function cssfromdate($date) { $parts = explode('-',$date); $month = $parts[1]; $class = array('01' => 'red', '02' => 'green', '03' => 'blue', '04' => 'orange', '05' => 'white', '06' => 'black', '07' => 'blue', '08' => 'orange', '09' => 'white', '10' => 'black', '11' => 'black', '12' => 'black'); return $class[$month]; } while($row = mysql_fetch_array($result)) { echo "<tr>\n"; echo "<td>".$row['last_name']."</td>\n"; echo "<td>".ucwords($row['first_name'])."</td>\n"; echo "<td class=\"".cssfromdate($row['Class_Date'])."\">".$row['Class_Date']."</td>\n"; echo "</tr>\n"; } ?>
  23. Correct. I would boot the server and get into the RAID controller configuration (should see a prompt when the controller is detected). Format the drives within the setup area. Restart the server.
  24. Partner channel advertising, and it's bloody impressive. I was searching google for some tips on a plumbing job that I needed to do in the house. Later that day I was watching a few random videos on YouTube and I was getting adverts on the video preload for plumbing supplies, plumbers etc. They have the advertising working from your google searches to deliver targeted ads. In the same way as google's other advertising revenues, they get paid when you click.
×
×
  • 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.