Jump to content
Larry Ullman's Book Forums

Edward

Members
  • Posts

    1115
  • Joined

  • Last visited

  • Days Won

    27

Everything posted by Edward

  1. Friday, 26 October 2012, 11:14:05 JST Description: Passing clouds. Mild. Temperature: 20 °C Comfort Level: 20 °C Wind: 11 km/h from 10° North Last update: Fri 10:00 JST Yes i got the same error message coming up even with your suggestion, Object not found! The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again. If you think this is a server error, please contact the webmaster. Error 404 localhost Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7
  2. Yes it worked after the change i stated this point was mentioned in the errata.
  3. Lol so funny the script is actually 5 vertical scrolls on my galaxy note. Lol this script will be burning up some serious weight on larrys host. Okay when i get back home ill trim it. I'll try your suggestion this is what i was thinking that htaccess may be completely being ignored.
  4. Here are the partial contents of my httpd.conf file: LoadModule rewrite_module modules/mod_rewrite.so DocumentRoot "C:/xampp/htdocs" <Directory /> AllowOverride none Require all denied </Directory> <Directory "C:/xampp/htdocs"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.2/mod/core.html#options # for more information. # Options Indexes FollowSymLinks Includes ExecCGI # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride All # # Controls who can get stuff from this server. # Require all granted </Directory> Tried moving files into the localhost root directory with the .htaccess file but still no luck. Checked online and can't figure it out, I already have AllowOverride All set and that was the common solution to the problem.
  5. Yes you are right. But even when i put the link http://localhost/php...nced/ch02/about into the browser i got an error message back Object not found! The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again. If you think this is a server error, please contact the webmaster. Error 404 localhost Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7 I also tried changing the link within the HTML to "about" and it still didn't work. It looks like the rewrite is not enabled but i don't know!
  6. I have added the following line from the book to httpd.conf <Directory "C:/xampp/htdocs/php_advanced/ch02"> AllowOverride All </Directory> In the httpd.conf my modrewrite line is as follows: LoadModule rewrite_module modules/mod_rewrite.so In the book it showed mod_rewrite.so as mod_rewrite.c, well mine has an extension of ".so" not ".c", so i changed the .htaccess file to be: # Script 2.7 - .htaccess <IfModule mod_rewrite.so> # Turn on the engine: RewriteEngine on # Set the base to this directory: RewriteBase /php_advanced/ch02/ # Redirect certain paths to index.php: RewriteRule ^(about|contact|this|that|search)/?$ index.php?p=$1 </IfModule> However when i run the script and clink on the link going to the about.php script http://localhost/php...dex.php?p=about the URL is not rewritten to http://localhost/php...ced/ch02/about. Does anyone have any suggestions on why this may not be working?
  7. This is going to be awesome, 4 chapters is enough to keep us going for a while.
  8. Well after what Larry's says in his other comment and knowing his experience i will just go with the YiiFramework, i have the kind of site that is going to never finish being built so i might as well have a strong base without the repercussions. I am like you though in when i do have time i do like to experiment to know how things work. But when you do think about building a whole framework alone, yeah there is definitely room for margin of error in that, I will leave the problems for the Chinese guy to sort out.
  9. Why not just round it off to a nice $1000. I hate to ask but i am gonna, how close is the YiiFramework ebook launch?
  10. Thanks Larry, that answers my question. Eagerly awaiting your Yii ebook, as soon as that's out i will be onto it. How much do you charge for a 1 hour consultation chat?
  11. Talking about Bootstraps imagine Larry you had your own project you would be working on for the next 10 years and no others, with your current knowledge would you just build up your own bootstrap and framework for this project or would you use someone else's, that is considering you had a lot of time on your hands? My guess is you would build your own, am i correct?
  12. If you look at the sessions script below the HTML tag is this <html lang="en">, its just got a language attribute in it. Body open tag just appears after the head. Doesn't matter if you have php code written inside html tags before or after, so you can open up the session and close it anywhere you like as its server side code. Because the PHP code will be interpreted by the server and the HTML will be interpreted client side by the browser. You can use session_write_close() so long as you you current session manipulations are complete. <?php # Script 3.2 - sessions.php /* This page does some silly things with sessions. * It includes the db_sessions.inc.php script * so that the session data will be stored in a database. */ // Include the sessions file: // The file already starts the session. require('db_sessions.inc.php'); ?><!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>DB Session Test</title> <link rel="stylesheet" href="style.css"> </head> <body> <?php // Store some dummy data in the session, if no data is present: if (empty($_SESSION)) { $_SESSION['blah'] = 'umlaut'; $_SESSION['this'] = 3615684.45; $_SESSION['that'] = 'blue'; // Print a message indicating what's going on: echo '<p>Session data stored.</p>'; } else { // Print the already-stored data: echo '<p>Session Data Exists:<pre>' . print_r($_SESSION, 1) . '</pre></p>'; } // Log the user out, if applicable: if (isset($_GET['logout'])) { session_destroy(); echo '<p>Session destroyed.</p>'; } else { // Otherwise, print the "Log Out" link: echo '<a href="sessions.php?logout=true">Log Out</a>'; } // Reprint the session data: echo '<p>Session Data:<pre>' . print_r($_SESSION, 1) . '</pre></p>'; // Complete the page: echo '</body> </html>'; // Write and close the session: session_write_close(); ?>
  13. Okay I'll contact them tomorrow. Love that Bootstrap modular site you put in the book that was really creative and I like the modal window in the Js book it's always something I wanted to do.
  14. Hi Larry, today i put the digital voucher number in the book into the PeachPit website but the code is not working. Is the site updated with these codes for download of the eBook. I wanted to download the book for my mobile device.
  15. If you check the framework code closely you will see its pretty much identical to the stuff we do there are no magic methods as i can see? Even with the JS book we have, its just so good that we wouldn't really need jquery anymore, but for our own safety we could use it if we wanted. Well i am going to still give Yii and try when it comes out, possibly just learn it to use ideas from the framework to implement into my own. But from what i can gather here it seems to be best to make it your own way, since it will be the only web site i will work on. I appreciate your time in answering this question well Hartley. Thanks for you Help.
  16. "While I don't want to put words into Antonio's mouth, he seems to more or less agree with me, and my opinion is that frameworks, when possible, should be avoided." It was in the database tips and tricks page 2nd page. Anyway there is no harm in saying that, its just got me thinking over the weekend and had me taking a close look at things again. Well i don't know what Larry has to say here but from what you are saying if you have a personal project you will always be working on, it seems then that frameworks are not suited, a custom model would be better. I understand what you are saying about the abstract classes and extra layers, Ive seen that, and to be honest there is no point in them, other than trying to be fancy. Well may be Larry likes to use one as once you learn it you can just make a new project with the same framework quickly without having to build up all the base. So for projects to projects it is okay. May be the person who recommended me to use frameworks has underestimated the knowledge and ability we have after learning from Larry's books.
  17. This question is for Hartley San but if anyone else wishes to get involved that would be fine. Hartley San, you stated the other day that Frameworks should be avoided, i myself have been wondering whether or not i should use one for my project. I tried to pull YiiFramework further apart the other day and it seems to be working in almost the same way as my own MVC oop framework which i built. So now i think probably the best option for me is to build a practice site with both methods to see how each turns out and decide whether to use Yii or not because once i go ahead there will be no turning back. But i wanted to ask you about your own experience with your own projects. It doesn't matter what your website does but i am wondering about what underlying structure you used to create your website and what experience you have gained from such coding? Did you use a standard procedural approach or did you build a modular MVC object orientated system? Please tell me about your experience so it can help me decide on which route to take?
  18. Well basically Javascript client side could do that job you don't need Ajax for that. Ajax is making things too complicated for this situation.
  19. Hartely you asleep? Are we on the same scripts here? If you only do this with ajax explain why, if i am wrong i am wrong but i want to know a reason why? From what i can see here i could do this with basic js client side code?
  20. Here are the form scripts: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Simple HTML Form</title> <style type="text/css" title="text/css" media="all"> label { font-weight: bold; color: #300ACC; } </style> </head> <body> <!-- Script 2.1 - form.html --> <form action="handle_form.php" method="post"> <fieldset><legend>Enter your information in the form below:</legend> <p><label>Name: <input type="text" name="name" size="20" maxlength="40" /></label></p> <p><label>Email Address: <input type="text" name="email" size="40" maxlength="60" /></label></p> <p><label for="gender">Gender: </label><input type="radio" name="gender" value="M" /> Male <input type="radio" name="gender" value="F" /> Female</p> <p><label>Age: <select name="age"> <option value="0-29">Under 30</option> <option value="30-60">Between 30 and 60</option> <option value="60+">Over 60</option> </select></label></p> <p><label>Comments: <textarea name="comments" rows="3" cols="40"></textarea></label></p> </fieldset> <p align="center"><input type="submit" name="submit" value="Submit My Information" /></p> </form> </body> </html> And here is the form for server side validation: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Form Feedback</title> </head> <body> <?php # Script 2.5 - handle_form.php #4 // Print the submitted information: if ( !empty($_POST['name']) && !empty($_POST['comments']) && !empty($_POST['email']) ) { echo "<p>Thank you, <b>{$_POST['name']}</b>, for the following comments:<br /> <tt>{$_POST['comments']}</tt></p> <p>We will reply to you at <i>{$_POST['email']}</i>.</p>\n"; } else { // Missing form value. echo '<p>Please go back and fill out the form again.</p>'; } ?> </body> </html>
  21. I could do that just with basic JS, i don't understand why you need ajax to check for errors, you can make code the error checking on the client side, that's just a basic form. May be one of us is looking at the wrong page.
  22. Yeah well i am glad you have learned something here, the only thing i have learned here is that i shouldn't have got involved. When you start to learn more about object orientated programming Hartley you will see yourself that Yii or those MVC oop frameworks aren't such a bad base to work of. They can be changed manipulated and have those inherited inefficiencies as you say can be removed once you get to know them a little better. Anyway i will be doing you to a favor from now on and just keeping out of this. Look at that survery it going to be years before technologies can slidge over. For now what i think we have is just great, many people are making millions from this basic SQL and so called inefficient table joins.
×
×
  • Create New...