Jump to content
Larry Ullman's Book Forums

electric-fire

Members
  • Content Count

    9
  • Joined

  • Last visited

  • Days Won

    1

electric-fire last won the day on August 11 2014

electric-fire had the most liked content!

Community Reputation

1 Neutral

About electric-fire

  • Rank
    Newbie
  1. I've found that in order for the following line of code from script 13.1 - email.php to work $value = str_replace(array("\r", "\n", "%0a", "%0d"), ' ', $value); the \r and \n should be escaped like so: $value = str_replace(array("\\r", "\\n", "%0a", "%0d"), ' ', $value); Otherwise they won't be replaced.
  2. Sorry for the long delay, I haven't had an opportunity to try it on a live web hosting with the search engine yet, but I just managed to make a related task: Leaving the Cyrillic and Latin characters, numbers, dots, dashes, and spaces intact in a string, while replacing any other characters with an underscore. The 1st link: http://php.net//manual/en/regexp.reference.unicode.php was of help! Here is the code: $modified_filename = preg_replace("/[^\\s\\p{L}0-9 .-]/u", "_", $filename); Thanks again.
  3. Hi, I was learning the code on creating a search engine, that accompanies this book from here: http://www.peachpit.com/articles/article.aspx?p=1802754&seqNum=4 and encountered an issue in the se_index.php file. Everything worked fine until I tryed cyrillic characters, the preg_match_all('/\b\w+\b/', $content, $output) function didn't allow them to get through: After researching the net I fount the solution adding the u caracter for unicode like this: preg_match_all('/\b\w+\b/u', $content, $output); and it worked on the localhost with LAMPP. Rece
  4. Thank you for your help, here is the code: <?php // This file allows the administrator to view a specific order. // The administrator can also mark order items as shipped. // Require the configuration before any PHP code as configuration controls error reporting. require ('../includes/config.inc.php'); // Set the page title and include the header: $page_title = 'Просмотр заказа'; include ('./includes/header.html'); // The header file begins the session. // Validate the order ID: $order_id = false; if (isset($_GET['oid']) && (filter_var($_GET['oid'], FILTER_VALIDATE_IN
  5. Hi, I encountered a bug when using the 'view_order.php?oid=x' page (page #344 in the book), first time it loads, everything works fine and the $_SESSION['order_id'] is assigned the right value, after I click on the 'Ship This Order' button the page reloads itself and the URL becomes just the 'view_order.php' so the script should use 'elseif (isset($_SESSION['order_id'])' to assign '$order_id = $_SESSION['order_id'], but it doesn't, because for some reason the '($_SESSION['order_id'])' loses its value. I rechecked everything many times and there's no any mistake in my code here. And log
  6. Hello I was following all the instruction in the book and built the coffee shop website in english without too much trouble. But now when I decided to create a similar website and use Russian language to fill the content, I've got an issue error 404 message when opening a product page (the browse.php file). So here is the full explanation: First I go to the home page: http://localhost/stroymateriali/ And click on the list of categories: http://localhost/stroymateriali/shop/standalones/ Next when I try to open a list of products in this category http://
×
×
  • Create New...