Jump to content

ignace

Moderators
  • Posts

    6,457
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by ignace

  1. Don't double post you already have a thread about this http://www.phpfreaks.com/forums/index.php/topic,282626.msg1339975.html#msg1339975
  2. How can we know if we even do not see your script?
  3. Snippet is a portion of a script. Next time your looking for answers on such things try Google: http://www.google.be/search?q=define%3Asnippet http://www.google.be/search?q=define%3Ascript The define: feature really rocks
  4. You could also have done: $num1 = floatval($_POST['num1']); $num2 = floatval($_POST['num2']); $op = $_POST['op']; $total = 0; switch ($op) { case '+': $total = $num1 + $num2; break; } print $total;
  5. In application development there is only one formula: practice and one constant: change. To write something like Drupal or WordPress you start off planning. How you start this planning process is up to you. You can use a methodology like OOA&D if you want to develop enterprise grade applications or start off drawing wireframes to embody your application structure (don't forget usability) once satisfied with all your wireframes you can turn those into photoshop mock-ups. If you like the look & feel of your website you can continue with the implementation. If you want to create an OO application you can create an UML class diagram to represent your models and they can look somewhat like this: interface PageInterface { public function publish(); public function unpublish(); public function isPublished(); public function lock(); // prevent multiple users editing the same page public function unlock(); // used both by editor as administrator in the event the editor forgets to unlock public function isLocked(); } interface UserInterface { public function ban(); public function unban(); public function isBanned(); public function logout(); // double purpose an admin can remotely logout a user (atleast if you store the sessionid in the user table and session's are kept in the database) } abstract class UserAbstract implements UserInterface { const GROUP_GUEST = 1; const GROUP_MEMBER = 2; const GROUP_AUTHOR = 4; const GROUP_EDITOR = 8; const GROUP_ADMINISTRATOR = 16; protected $group = self::GROUP_GUEST; public function isGuest() {} public function isMember() {} public function isAuthor() {} public function isEditor() {} public function isAdministrator() {} } Now I can easily do something like: $page->lock(); //or $page->publish(); //or $page->unpublish(); //or $user->ban();// or $user->logout(); // remote logout $user->isEditor(); // before trying to edit a page (much easier then $user->getPrivilege() & PRIVILEGE_PAGE_EDIT or an ACL) General idea here is that after a thoughtfull planning you can ease your application development alot then if you would have just started coding. You also may see problems and have time to solve them instead of running into them just before your about to release..
  6. Yes if they are primary keys in both previous tables.
  7. In the web industry you perform more jobs then the one you aspired (PHP developer) for that same reason you need to know more about your colleagues jobs then your own as you may sometimes be performing their job due to sick-leave instead of your own. So things you need to know: - Wireframes/Prototypes/Mock-Ups A website is not created first in Photoshop but instead they create a wireframe (single or multiple pages) drawn on a piece of paper how the website will look. They also incorporate dynamic effects like pop-ups (JS, Ajax). Of great importance in this process is thinking about the usability of your website. They may also be already looking into SEO strategies. - Photoshop design After discussing the wireframes with the client and an agreement on the structure (everything is present) 1 of 3 possible designs is created in Photoshop (after creating a design you mostly need to modify some elements: bigger, smaller, higher, lower, ..). In normal circumstances you now also possess the content of the website which has been re-written by a copywriter to make sure your website is search engine friendly. During implementation keywords are highlighted or deep-linked. - PHP/XHTML/CSS After the client agrees on a design it's time for the implementation. Some companies divide front- and back-end development others don't. In either case you will be performing regression testing to validate it works. - Staging/Quality Assurance During the development of the website is the client invited to test an implementation on a so called staging server. This can be a part of the website or the entire website. These are some of the topics you will need to get familiar with if you want to aspire a job in the web industry. This industry also doesn't ask after your degree but instead they ask after your portfolio. Also consider that some companies only give jobs to developers who really know their language very well. These questions may include something like: What does the following line output? print sizeof('hello'); Answering 5 will stop further interviewing. Also famous is that they give you a problem that tests your knowledge in general programming (mostly easy) or one that tests your knowledge of the PHP library (harder). Like I said in the web industry you are required to wear multiple hats sometimes so many that you'll have to crawl through the door to get in.
  8. You can use parse_url to retrieve the url query $query = parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY); Either way you'd have to check if there was a query: if ($query) { //or if ($keywords) {
  9. I believe to answer such questions manuals were created.
  10. You may want to try posting your code
  11. window.location.hash = 'gallery-id';
  12. Stop using the Hungarian Notation it doesn't work in a dynamic language and is misleading
  13. You can, once you stop wishing and start practicing.
  14. actually & is deprecated and you should use &
  15. I'm not sure we are on the same page especially when I look at: document.whatever.innerHTML = "<?php $page->DisplayPostTitle($row); ?>"; If my assumption is correct that $row is actually a row fetched from a database and that is wrong as it would need to be: document.whatever.innerHTML = "<?php $page->getTitle(); ?>"; $page then actually represents $row as an ActiveRecord or some other pattern. Plus like I said IMO something like: document.whatever.innerHTML = "<?php $page->getTitle(); ?>"; is wrong and you should in fact make an ajax call to retrieve the required information from PHP. var page = ajax.get('/a-slug-page-title'); alert(page.slug); // a-slug-page-title
  16. ignace

    Joins

    Can you post a db dump of the relevant tables? CREATE TABLE table ( column ... );
  17. Probably to late but yeah I would rewrite it interview or not IMO that's a bad approach and will not get you the job.
  18. First of this should have come into the freelance section. Second I'm willing to help you for the right price (which should not be excessively but I'm not working for a pound) PM me the amount you are willing to pay for this and I will make the required changes.
  19. IMO document.whatever.innerHTML = "<?php echo $SomeFunction(); ?>"; Is a bad idea as is: <?php echo $SomeVariable; ?> throughout your website. IMO that is the worst thing you can do. What I believe would be a good approach is thinking in functionalities for example: I'm building a forum so I may represent my forum through an object (Forum) A user can add topics to a forum class Forum { public function addTopic(ForumTopic $t) {} } An administrator may lock a forum topic class ForumTopic { public function lock() {} } Or move a topic to another forum class ForumTopic { public function move(Forum $f) {} } I want to be able to easily loop over a forum to display it class Forum implements Iterator The same applies for a forum topic to display all posts made to the topic including the OP's post class ForumTopic implements Iterator I usually design this in an UML class diagram afterwards I'd apply design patterns where they apply and implement the diagram
  20. I don't think their is a CMS written specificaly for theatres. Just best bet would be to find a CMS which has a great API and write the required functionalities yourself. Another option would look for a CMS with a great and rather big community chances are the required functionality has already been written and freely available.
  21. Have you checked the error_log? Always remind yourself that your laptop is not your server meaning that environment and their configuration do not always match which are likely causing the problem.
  22. Alternatively you could save yourself the horror and use pecl bbcode extension http://php.net/manual/en/book.bbcode.php or the PEAR extension http://pear.php.net/package/HTML_BBCodeParser
  23. ignace

    Joins

    Are you sure your lastuser column has a value for the second post?
  24. Actually that idea is not so bad but I would change it a bit: class SQLInsert { public function into($table) { return $this; // used for method chaining. } public function values($data) { return $this; } } $insert = new SQLInsert(); $insert->into('table')->values(array('id' => ..))->values(array('id' => ..))..
  25. http://lmgtfy.com/?q=e-commerce+that+does+not+suck
×
×
  • 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.