Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


hansford last won the day on November 29 2016

hansford had the most liked content!

Community Reputation

16 Neutral

About hansford

  • Rank
    Prolific Member

Profile Information

  • Gender

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. hansford


    For one thing...modern frameworks are constantly being updated and improved. Another thing is that is what companies want when looking to hire a developer. You should understand the MVC design pattern and how each part works, but then go learn a modern framework.
  2. This question is rather specific pertaining to a Wordpress plugin of which there are numerous. You might be better off trying to post your question to the plugin QA site. https://wordpress.org/support/plugin/advanced-custom-fields
  3. hansford


    I wrote a custom one when I was trying to wrap my head around it. This is what my index.php page looks like. <?php require($_SERVER['DOCUMENT_ROOT'] . '/config.php'); require_once(ROOT . '/common.php'); // set the path separator define('PS','/'); require_once(APP . '/common.php'); // load system files require_once(SYS . 'Model.php'); require_once(SYS . 'Load.php'); require_once(SYS . 'View.php'); require_once(SYS . 'Controller.php'); require_once(SYS . 'Router.php'); // load the database require(DB); // load routes configuration require(APP . '/config' . PS . 'routes.php'); // laun
  4. Hi guys and girls, A recruiter asked me to do this coding challenge and was wondering if you had a more elegant solution or your thoughts on it. EXERCISE FOR DEVELOPER CANDIDATES: Unit Number Sorting Exercise We often deal with unit number / resident name data. These two pieces of information are used by our users to identify a lease. Many of our screens and reports show a list of leases. The task is to sort lease data read from a file and to print the sorted data to STDOUT. The data looks as follows (sample also attached): #50 - Smith #8 - Johnson #100 - Sanders #1B - A
  5. You are over-thinking this whole thing. You can call whatever class/function you want in the PHP file that will be accessed by your Ajax call. in the data you pass to your PHP page, you can tell it what class should be called, what function etc. In this following example we have 'action' which tells your PHP page to call the "delItem" method on a known class and pass the method the "item" argument. $.ajax({ url: 'http://www.yourwebsite.com/file_name.php', type: 'POST', data: {action: 'delItem',item: item}, success: function (response) { if (response.status === 'success') { c
  6. JavaScript and PHP don't know the other even exists. In your Ajax call set the URL to call the PHP file which will create your object and call your class.
  7. PHP and JavaScript don't mix like that. You have PHP tags inside a JavaScript file. JavaScript has no idea what the hell that is and visa-versa. Explain what you are trying to do and we can help.
  8. Requinix, memory lane. Look here at this related post you made back in 2008. http://forums.devnetwork.net/viewtopic.php?f=1&t=113664
  9. If this mystery application can do that then why can it not change the file which holds links to the source. file_get_contents() can grab all the data from a file - yes. Then you can take that string, in memory, and put it wherever you want.
  10. The rules went out the window long ago when MVC stopped matching up to real world of computer use. "Business Rules" belong in the model. MVC is a pattern, not a rule. All of the frameworks around today break the rules. I know I'm not telling you anything you don't already know. I'm just arguing lol
  11. There is argument on both sides of this debate. Personally, I handle validation from within the controller. No need to clutter up your controller with validation statements though - create a validation class and let it handle all of that.
  12. Given your example: mypage.php <?php error_reporting(E_ALL); ini_set('display_errors',1); if (isset($_GET['number'])) { $number = $_GET['number']; } if (isset($_GET['word'])) { $word = $_GET['word']; }
  13. If everything is "ok" why not close the topic and mark it as "Answered".
  14. I'm not going to read a ton of code fragment and try to make sense of it. There are alternative ways of sending email using PHP, but the most reliable way is with PHPMailer. If you have issues getting it set up. Post another question. https://github.com/PHPMailer/PHPMailer
  15. You are going to have to use Ajax calls if you want to dynamically shift the questions up or down based on vote clicks. As far as initially displaying the page. <form action="feed.php" method="post"> <textarea required="" name="question" placeholder="Write Something..." id="text" cols="30" rows="10"></textarea> <input type="submit" name="submit" value="ask"> </form> feed.php if ( ! isset($_POST['question'])) { // give error or send them back to the page etc. exit; } // here is where your database will come in // based on the number of votes you
  • 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.