Jump to content

TomTees

Members
  • Posts

    187
  • Joined

  • Last visited

    Never

Everything posted by TomTees

  1. So how is that different than... include ('includes/header.html'); TomTees
  2. What does this code mean with respect to the file path?? include ('./includes/header.html'); TomTees
  3. What they are expecting was documented in my original post. I tried your idea above but it doesn't seem to work. config.inc.php define('BASE_URL', 'localhost'); index.php <?php include (BASE_URL . '/includes/footer.html'); ?> Yields this error... TomTees
  4. http://localhost/01_KnowledgeIsPower/index.php where "01_KnowledgeIsPower" is the name of my "project" in NetBeans. TomTees
  5. I don't type anything. I hit Shift+F6 in NetBeans. TomTees
  6. Again, I am developing locally on my laptop. There is no web URL... That is why I am asking how to set it up locally and point it to my Web Root. TomTees
  7. Yeah, I figured that out while you guys were responding. I placed the code in test.php and it ran/looks fine. The author is indeed making me create a header.html file that will ultimately be included in a php file but I'm not that far in my book yet! Thanks, TomTees P.S. Feel free to answer this post if you know the answer... http://www.phpfreaks.com/forums/php-coding-help/help-setting-up-path-constants/
  8. I am using NetBeans on my laptop. The author said to call the page "header.html" What is wrong with my formatting? TomTees
  9. I am trying to set the HTML Page Title dynamically, but this code from my book doesn't work... <title> <?php // Dynamically set Page Title. if (isset($page_title)){ echo $page_title; } else { // Default Page Title. echo 'Knowledge is Power: And It Pays To Know'; } ?> </title> What is wrong with it? (All I see is the code in the Webpage/Window Title...) TomTees
  10. I am following a book and need help setting up Path Constants. Here is the script I need to adjust... // Constants define('BASE_URI', '/path/to/Web/parent/folder/'); define('BASE_URL', 'www.example.com'); define('MYSQL', '/path/to/mysql.inc.php'); Since I am working in NetBeans, I do not have access above my Project Folder which serves as my "Web Root". So if my Project Folder is called "MyProjectFolder", and I want both BASE_URI and BASE_URL to point to that directory on my laptop, what should I put? I'm thinking something like this... // Constants define('BASE_URI', '/'); define('BASE_URL', '/'); define('MYSQL', '/includes/mysql.inc.php'); TomTees
  11. Your duplicating data this way. I would make it a simple numerically indexed array. I'm just working off a tutorial on MVC and trying to understand it. http://php-html.net/tutorials/model-view-controller-in-php/ Arrays don't have names. They can be stored in variables, but I'm not sure that is what you mean. I'm used to seeing array being assigned to a variable when they are created. TomTees
  12. Why not give the anonymous array a name like this... TomTees
  13. In this code... class Model { public function getBook($title) { $allBooks = $this->getBookList(); return $allBooks[$title]; } } Questions: --------------- 1.) What is the scope of $allBooks? Can it be seen outside the function and inside the class? 2.) Could I rewrite things like this... 3.) Sorta off-topic, but could I rewrite this code... like this... TomTees
  14. I have a question about the array in this code... Questions: -------------- 1.) Is it correct that in the array above, the KEY is a book name and the VALUE is an object? 2.) What is the name of the array above? TomTees
  15. Thanks for the link, but the reason I am here online is becasue books only go so far... TomTees
  16. Namespaces may not be a PHP concept, but they are certainly not just limited to .Net so I wouldn't say "they are a .Net concept". (Maybe you were just saying that in context?) I believe they are used also in C, C++, Java, and so on. TomTees
  17. Does the concept of a "Namespace" exist in PHP? If so, how do you use them? This is a snippet from ASP.NET that made me ask this question... TomTees
  18. I thought PHP didn't use variable typing and such? Am I supposed to include "void" in my PHP Constructors? TomTees
  19. void __construct ([ mixed $args [, $... ]] ) What is the "void" in the above code? (It looks like Java?!) TomTees
  20. What does this code do/mean? /* * @the vars array * @access private */ TomTees
  21. Can you use underscores in Class/Object names? This_Is_My_Class{ } this_is_my_object = new This_Is_My_Class(); TomTees
  22. When implementing MVC, should you create 3 abstract super-classes called Model, View, and Controller? TomTees
  23. Hey, don't make this even more complicated?! Can you give me a simple example of a 'View Script'? Can you give me an example 'View Helpers'? And what is this 'Response' thing?! Let's say I had a Log-In form with only an "Email" and a "Password" input field. How would what you are describing about be done? Why not? If a Log-In Form could be part of the "View", then why not a Log-In object? TomTees
  24. What is "SET"? Are we talking about assigning a "constant" a value? Is it a variable? Follow my confusion? TomTees
×
×
  • 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.