Jump to content
Larry Ullman's Book Forums


  • Posts

  • Joined

  • Last visited

BillByrd's Achievements


Newbie (1/14)



  1. But shouldn't <?php ini_set (' display_errors', 1); ?> trigger an error report rather than blank page when one parenthesis missing in the phpinfo?
  2. 1. I understand that error in "catch-device" would produce blank page. I pasted this from book: <?php ini_set (' display_errors', 1); ?> Deliberate errors produce blank page. 2. phpinfo(); displays the info; phpinfo(): [colon instead of semicolon] displays the info with no error report; phpinfo( displays blank page Any ideas?
  3. From the book: Create two different name variables, using the existing first- and last-name variables: $ name1 = '$ first_name $ last_name'; $ name2 = "$ first_name $ last_name"; Technically speaking-- why aren't $name1 and $name2 arrays? I keep telling myself that arrays are variables with two or more values.
  4. Just can't leave it alone. Please ck to see if this is a correct interpretation of your efforts to help me: <?php $_POST = array('comments' => 'now is the time for all good men to come to the aid of their country.'); $comments = $_POST; // above: $_POST is used as a variable. $dog would have worked just as well. $_POST was assigned to the contents of the array. // 'comments' is used as a key because it came over with the html form. // $comments gets assigned to the contents of the array formerly known as $_POST // to print or echo $comments, we must specify an indexed part of the array (below) print "<p>If we hope to win this war-- {$comments['comments']} Who's with me?</p>"; // above: $comments is the array being referenced in curly braces // 'comments' is key being reference in the array. key is aka "0". // the value of the 'comments' key is "now is the ...." $_POST = array('comments' => 'now is the time for all good men to come to the aid of their country.'); $comments = $_POST; print "<p>If we hope to win this war-- {$comments['comments']} Who's with me?</p>"; // php knows to insert the value* of the key** of the array*** // * now is the time.... // ** 'comments' // *** $comments ?>
  5. I think I sabotaged my own thread by entering some code AND entering a link for something else in the same reply box. But, basically, I feel that I have it thanks to your hanging in there with me. I knew that you couldn't print out an array without doing something you wouldn't do a simple variable/value pair. I also knew about the need for a semi-colon. Newbie mistake. And so your point #1 really explains things. I just need to really study it so that it eventually becomes very clear. I've always been my worst enemy for wanting to take the clock apart instead of just reading the time. It's too early in the game for that. I need to just learn how to do things and come back to the why later. Thank you so much. I'll be back with more questions, Hopefully they will be more typical.
  6. Okay. Letting that soak in. Feel another pic coming on. Yep. http://chattanoogacentral1964.com/drawing.php What a minute. Maybe it just clicked. text area goes over as "now is the time for all good men to come to the aid of their country" so that ... $comments = $_POST['comments' => 'now is the time for all good men to come to the aid of their country.']; print "<p>If we hope to win this war-- $comments Who's with me?</p>" Nope -- it produces parser error. Doesn't like the double arrow. Is the concept right at least?
  7. I probably have some kind of visual/spacial related learning disability. I know that a form sends data to the server where php processes it and outputs it to the browser. Words alone don't always work for me. I have to draw things as if I were trying to explain it to someone else. Some times that helps me to see that my logic simply doesn't compute. Thought I was good to go with arrays... $var = array('dog', 'cat', '2', 'blue'); $var now contains all the values in the array. But, in the book, the syntax (using post) is: $title = $_POST['title']; $name= $_POST['name']; $email= $_POST['email']; To this newb it appears that the array concept has been abandoned for a multi-variable "device". I realize it's my inability to grasp it. (Tried to post the drawing but got "that extension not allowed" with png, gif, jpg. Finally gave up and put in a link instead) My drawing shows what I think happens. (I like to think I--at least-- have that much right.) But it still seems clunky. Would like to get a grip on this and share with other seniors (dob: 12-7-45). http://chattanoogacentral1964.com/drawing.php
  8. I wish to be respectful of the segregation of issues in the various forums. But I could not decide for sure which forum would be appropriate for this post. Hopefully my question will not be inappropriate for this one. I reached a point with PHP the Web: Visual QuickStart Guide (4th Edition) and then became unable to follow it. That's typical for me: quit on something and then give it another go later. So I'm ready to try again with PHP. But I notice that there seem to be many more developers encouraging the mastering of JavaScript than PHP. And that leads me to wonder if they are competing languages so that it's merely a personal preference, or do they do entirely different things so that one needs to learn both if he hopes to be a full-service website builder. I'm 68 y/o and need an explanation on that level, or maybe, for a ten year-old (about the same thing). Thank you
  9. It was some days before I realized your response was in my junk mail. Sorry. I tried again tonight and everything worked fine. Apparently just one of those things where one little tiny mistake on my part made it fail. Thanks
  10. Sorry about the syntax error in my question. In chapter 3 we learn that inserting the ini_set ('display_errors' , 1); just below the php tag will trigger an error message when submitting an incomplete form. Larry only types in his name, omits email address, This produces an error message. When I submit only a name-- I do not get the error message. I'm no good at explaining things. Maybe you can figure out what I'm asking. Sorry.
  11. Using downloaded scripts for chapter 3. ini_set ('display errors' , 1); does not display an error when submitting incomplete form. It simply displays whatever part of the form I did fill in. Help!
  12. I'm probably the only one in the world who has to have this kind of break-down to fully understand something. But maybe there's another old fart out there who can use it. (from chapter 2) <?php $blue_with_yellow /*the variable*/ = "green" /*the value*/; print '<h1> Mixing blue with yellow yields $blue_with_yellow</h1>' //single quotes ?> <?php $blue_with_yellow /*the variable*/ = "green!" /*the value*/; print "<h1> Mixing blue with yellow yields $blue_with_yellow</h1>" //double quotes ?>
  13. 67 years old. A little slow on the uptake. Only just now realized I could have a reader on my PC. Using three monitors. I have Notepad++ on one, PHP for the Web on another, my website for testing on the third. What a great set up.
  • Create New...