Jump to content
Larry Ullman's Book Forums

Christopher Bergin

Members
  • Posts

    90
  • Joined

  • Last visited

Everything posted by Christopher Bergin

  1. thanks for responding. I think I speak for a few on this site and would like to express my appreciation for the help HartleySan, the others and yourself contribute to our development.
  2. I'm trying to understand the process of events taking place in Chapter 15. My first question applies to declaring a generic object: are the properties assigned to the object user-defined or are they available system-defined properties? options.data = data; options.dataType = 'text'; options.type = 'get'; options.success = function(response) My second question: when this instruction is executed in the login.js script, are all the property / value pairs that comprise the generic object appended to the GET URL and sent to login_ajax.php for processing? $.ajax(options);
  3. the bracket thing is non-conventional. I find code easier to focus on when it is condensed and composed more like a written language. Anyway, thanks for the response. I changed my loop to read... foreach ($_POST as $k => $v) $scrubbed[$k]= spam_scrubber($v); and it worked.
  4. In this lesson, Larry uses an elegant solution to populate the scrubbed array: $scrubbed= array_map ('spam_scrubber', $_POST); I thought I'd try a more traditional route just to see if I could and I'm having difficulty. Can anyone correct this logic for me? if ($_SERVER['REQUEST_METHOD'] == 'POST') //$scrubbed= array_map ('spam_scrubber', $_POST); {$scrubbed= array(); foreach ($_POST as $v) $scrubbed= spam_scrubber($v); if (!empty($scrubbed['name']) && !empty($scrubbed['email']) && !empty($scrubbed['comments'])) {$body= "Name: {$scrubbed['name']}\n\nComments:{$scrubbed['comments']}"; $body= wordwrap($body, 70); mail('postoffice@cjbergin.com', 'Contact Form Submission', $body); print "<p><em>Thank-you for contacting me. </em></p>"; $_POST= array();} else print "<p><b>Please fill out the form completely!</b></p>";} all the other sections of the script work according to plan. The output I'm receiving is just one character per field: Name: s Comments:s
  5. I tried to include the spam_scrubber function within the validation block of code and the parser didn't seem to like it.(PHP 5.2.17) I relocated it at the top of the script and it worked. Just wondering.
  6. I got it to work but only erratically. I suspect it might have something to do with the capricious nature of headers. For instance, the trace I inserted in the function would not generate output unless the script worked successfully and an image in it's own window displayed properly. I used the function provided by the author and it seemed to work. When I replaced (copy/paste) the function code I had written with that of the authors, it still failed to work. I'm done with this and moving on.
  7. I'm having difficulty getting my images to appear in their cute little windows. To enlighten those mildly familiar with the project, images.php scans the directory that .jpg images reside (already confirmed they are uploaded) and establishes the filename and dimensions of each image, creates a list of links that invoke a Javascript function that creates a pop-up window, which in turn calls show_image.php to display the image. When I click on the link, the page does nothing. I receive no errors from the scripts and I receive no error from the browser indicating that href resource does not exist. I tried including write statements in the Javascript function to see if it was in fact processing a request but I don't see that either. I've tested on Safari 5.0.6 and Firefox 3.0.7. Any ideas?
  8. that was my thinking as well. Why would I need to place the folder containing the library on a web server? Wouldn't it seem logical to add the library as an add-on feature to my web browser?
  9. In Chapter 15 , the author instructs the user to download the jquery-X.Y.Z.min.js and place it in it's own folder on the web server. If I'm using a hosting service does that mean that I'll need to test all HTML documents that include JQuery code on the web server during development and not locally in my browser?
  10. since I'm already discussing Chapter 12, I'll throw this out there. What would be the English translation of this statement? if ($r = mysql_query($query, $dbc)) It's obviously not a comparison because the statement doesn't include "==" operator. Also, in the following statement, does the variable $row only hold one record at a time? $row= mysql_fetch_array($r);
  11. The book mentions that this could happen but doesn't offer any advice. Successfully connected to MySQL! Could not create database because:Access denied for user 'cjbergin'@'10.%' to database 'myblog' Could not select database because:Access denied for user 'cjbergin'@'10.%' to database 'myblog' I seem to be able to manually create databases if I access MySQL from the control panel of the hosting site. When I attempted to manually create 'myblog', I was greeted with a MySQL message indicating that it was already created but yet I don't see it existing in the GUI .
  12. Thanks Paul. It works for me in Firefox as well. For some inexplicable reason, Safari has a difficult time processing cookies.
  13. I'm having trouble getting my cookie values created in customize.php to modify the text in view_settings.php. When I view the stored cookies on my Mac 10.5.8 (Safari 5.0.6), they appear in the list of cookies. In fact, when I make different selections for font_size and font_color, they are reflected in the browser list of cookies as intended. The problem appears when the view_settings.php page is not affected by the change in values. I tried to print out the values of font_size and font_color after the setcookie commands on the customize.php page but receive no values for each. setcookie('font_size', $_POST['font_size'], time()+1200); setcookie('font_color', $_POST['font_color'], time()+1200); print "<p> the font size is..." . $_COOKIE['font_size'] . "and the font color is..." . $_COOKIE['font_color'] . "</p>"; I get this result... the font size is...and the font color is... Your settings have been entered! Click here to see them in action. The values for $_POST['font_size'] and $_POST['font_color'] are available and correct when I print them out. I even tried to upload script_09_01.php and script_09_02.php directly to the web hosting server that I am using and those did not work either. Any ideas?
×
×
  • Create New...