Jump to content

ignace

Moderators
  • Posts

    6,457
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by ignace

  1. Option 5) Use the Two-Step View pattern of Martin Fowler (http://martinfowler.com/eaaCatalog/twoStepView.html)
  2. function insertbefore($stringtosearchin, $wordtofind, $stringtoinsert) { //Insert a string before a string. str_replace($wordtofind,$wordtofind.$stringtoinsert,$stringtosearchin); } This code does nothing until you add a return before str_replace. Equally doing nothing is: $fileedit1handle = "<?php insertbefore You may want to pick up some tutorial on how to properly write PHP code as your code is flawed in multiple sections of your code, a rewrite would be a good option in this case.
  3. Well certainly not here. Here your snapshot will be wrong section
  4. MERRY CHRISTMAS and a HAPPY NEW YEAR HO HO HO
  5. That free service would be Google. Maps in particular.
  6. Flash is the way to go here. You can use Ajax and then you get something like Travians. If you also want to know if the success will become a success you may want to do some marketing research to see if people are waiting for something like this.
  7. I have to disagree they don't. Tried them as a security measure but some still got passed them albeit losing a limb or two
  8. Do you mean that it doesn't show up in view source or on-screen?
  9. For example if your application has different sources that all may use sessions then at some point a source may rely on sessions and thus writing something like: $_SESSION['datakey'] = 'datavalue'; Now the line if (!isset($_SESSION)) { session_start(); } Evaluates false and session's does not get started the array _SESSION gets filled with data but is not persisted between requests.
  10. In some bad designed applications people use this technique to verify wether or not session has already been started. Normally you don't check _SESSION but session_id() instead as when session's hasn't yet been started session_id() will return ""
  11. CREATE TABLE users ( users_id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT, users_username VARCHAR(16) NULL, users_password VARCHAR(40) NULL, PRIMARY KEY (users_id) ); CREATE TABLE followers ( followers_followee SMALLINT UNSIGNED NOT NULL, followers_follower SMALLINT UNSIGNED NOT NULL, PRIMARY KEY (followers_followee, followers_follower) ); CREATE TABLE tweets ( tweets_id INT UNSIGNED NOT NULL AUTO_INCREMENT, tweets_users_id SMALLINT UNSIGNED NOT NULL, tweets_tweet VARCHAR(140) NULL, tweets_tweet_date TIMESTAMP NULL, PRIMARY KEY (tweets_id, tweets_users_id) ); SELECT tweets_tweet FROM followers, tweets WHERE tweets_users_id = followers_follower AND followers_followee = 1 This example features tweets but it can be modified to meet your needs (followers) in this example defines the relationship between two friends.
  12. You could use Zend_Db_Select from the Zend framework providing you also would use their database adapter classes you could do: $select = new Zend_Db_Select(new Zend_Db_Adapter_Mysqli(array('host' => 'localhost', 'username' => '', ..))); $select->from('table')->where('..')->where('..')->where('mid = ?', 1); print $select;// returns SELECT * FROM table WHERE .. AND .. AND mid = 1 If you are using PDO to connect to your database you can use one of the Zend_Db_Adapter_Pdo_* classes.
  13. Pages like msn.com are generally rendered by differing modules
  14. Euhm apparently I'm not the only one who solves problems during sleeptime
  15. My nickname is my firstname and I chose it for it's convenience. 1) I don't have to bother thinking of names and what they will represent or mean, I usally also start to dislike them after a while and changing one nickname is a hassle (not all websites allow it) 2) Everyone knows my name and they know my "nickname" (friends can easily spot me) and I have no problem them seeing when I screw up (or succeed) atleast I'm trying 3) Everyone calls me by my name like I do with them (I don't believe in hierarchy, in life there are no > and < operators)
  16. I had that same problem, ignorance everywhere delivering content way too late (for a content-heavy website) and still expecting to deliver on the agreed deadline. That all changed when I started to brief my client of what I expected from them and what they could expect from me on the very first meeting. I also provided them with a full detail report of all work and hours involved in an average project. In this report are contact details included of clients which were willing to answer prospects questions regarding work experience. Some prospects do contact these clients and become excited afterwards to start working with me. After the first meeting I start creating a contract that clearly defines what is expected of both parties. During the second meeting we discuss each point and sign it. From this point on my client is fully informed and knows exactly what I'm working on and what I'm expecting of him soon for being able to continue my work. The contract is a precaution to make sure I still get paid if the client fails to do what is expected of him. A website that has helped me alot is http://www.freelanceswitch.com and is a highly recommended resource for anyone seriously considering freelancing.
  17. Wanting and doing are two different things. Generally I'll avoid 3-some if one of them is my gf because if she gives you the pleasure of two women then you should equally give her the pleasure of two man.. (awfull thought)
  18. SELECT *, COUNT(*) as num_replies FROM forum_replies LEFT JOIN forum_topics ON ( forum_replies.tid = forum_topics.id ) WHERE `cid`= $id ORDER BY lastposttime DESC GROUP BY columnOnWhichYouWantToGroupAndThusCountForWillBeUsed
  19. et voila: http://remysharp.com/2007/09/18/auto-populate-multiple-select-boxes/ Told you someone already wrote it.
  20. Are you using any JS library like jQuery or YUI? If you don't I would highly recommend it especially jQuery, it has tons of plugins it's quite possible they have a plugin that does just that for you where you would pass the three id's (of your select) in sequence.
  21. No you can not use two WHERE keywords in your query statement. You need boolean operators like AND, XOR and OR thus: SELECT page_name FROM pages WHERE user_id = $user_ids AND page_visible = 1 ORDER BY page_position ASC But you would have already know that if you had read the mysql manual -> http://dev.mysql.com/doc/
  22. Well looking at your code you had a good start. Only one recommendation: create functions that do one thing only thus not read from a database and then output html instead create a function for both like so: define('URI_IMAGES', 'path/to/images/directory'); .. print htmlSelect(getImagesFromDirectory(URI_IMAGES, array('jpg', 'gif')), array('id' => 'img01', 'name' => 'img01', 'onchange' => 'updateImg(this, \'img01\')'));
  23. No I'm saying you create a new database, add the table structure(1) and copy all data from your current database to your newly created database. database (<- working database) database_archive_2009 (<- archive database, user-account(2) has read-only access) database_archive_2008 (<- archive database, user-account(2) has read-only access) Each database will share the same table names database -table1 database_archive_2009 -table1 Now if you add a dropdown to your application and query mysql (or some other engine) for all databases for your current user-account it will return: database database_archive_2009 database_archive_2008 You add these to your dropdown and when the user clicks submit you use something like: mysql_select_db($db/* $db = $_POST['db'] and validation */); All the rest of your application will remain the same. You may also add some constant or something to indicate that this is an archived version (grey out edit buttons). 1. table structure: CREATE TABLE .. ( id integer not null auto_increment, .. 2. user-account: the account you use to connect to your database mysql_connect(.., user-account, ..);
×
×
  • 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.