Jump to content
Larry Ullman's Book Forums

nomadsoul

Members
  • Content Count

    29
  • Joined

  • Last visited

Everything posted by nomadsoul

  1. for anyone with this problem I commented out line 117 in register.php where the line is: //mail($_POST['email'], 'Registration Confirmation', $body, 'From: yourmail@whatever.com'); I also commented out the main stuff in php.ini and anywhere else but that didn't work ...moving on
  2. Hi everyone, I am getting this error Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" , I really don't care about connecting to the mailserver. I just want to stop seeing this error. Anyone know how to disable it? I'm using Xampp Windows 10. I don't use Mercury, its off at the Xampp control panel. My book is Effortless ecommerce edition 2 and I see the error after filling in the register.php page. Thanks
  3. I am now getting the 'no image available' default jpg, -a bit of progress,
  4. sorry two images uploaded. No need to hurry, I'm just going through your book at leisure and review
  5. Here is the part where it echos the prin from the while loop in the browse_prints file:: Also in the image file you can see that the uploaded files look incomplet without file extensions. The properties just say 'File' --weird // Display each record: echo "\t<tr> <td align=\"left\"><a href=\"browse_prints.php?aid={$row['artist_id']}\">{$row['artist']}</a></td> <td align=\"left\"><a href=\"view_print.php?pid={$row['print_id']}\">{$row['print_name']}</a></td> <td align=\"left\">{$row['description']}</td> <td align=\"right\">\${$row['price']}</td> </tr>\n";
  6. Hi, Everything is working ok the image upload and even the cart checkout. But getting the No image available message. Can anyone tell me how to make the image appear? it is only a jpg and very small. It does not upload to the uploads folder either.
  7. I tried to buy the ebook at the PP website. I guess they don't want me to buy it. First I had to create an account. Then the ask me for my mailing address -for an ebook download? I live overseas but in the drop down I can only choose from US states and zip codes (required fields) . Through the processes there is no indication that I'm ordering an ebook. I don't want a hard copy. The ordering process is certainly not effortless. Larry, Peach Pit is not serving you well.
  8. Hi Laurent, Thanks but I can only guess that I didn't have a closing php tag. But I have looked at the entire script and it still escapes me.
  9. Greetings and good day to all you Ullmanites, I'm getting this when I access index.php through the url: Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\htdocs\ecommerce\virtual\knowledge\html\includes\config.inc.php on line 67 here is the local code, nothing much before that except the define functions and the session variable: function my_error_handler ($e_number, $e_message, $e_file, $e_line, $e_vars) { // Need these two vars: global $live, $contact_email; // Build the error message: $message = "An error occurred in script '$e_file' on line $e_line:\n$e_message\n"; THIS IS LINE 67 it is empty // Add the backtrace: $message .= "<pre>" .print_r(debug_backtrace(), 1) . "</pre>\n"; // Or just append $e_vars to the message: // $message .= "<pre>" . print_r ($e_vars, 1) . "</pre>\n"; I'm not seeing any semicolon problems or missing syntax. Thanks
  10. Thanks Larry, I've fixed it. It was as you say in the dynamics
  11. also, I am accessing phpmyadmin successfully with the url: localhost:85/phpmyadmin. So I'm assuming I'll have to look through php.info to see whats up with ports and php.
  12. Larry, Yes, the non dynamic stuff is showing up . I will check out the index.php and the xamp config. Meanwhile any other suggestions are thankfully used
  13. I'm quite sure I've got the db connection working because when I navigate to mysql.inc.php I just get a blank browser with no errors. but when I navigate(through the browser url) to index.php, it hangs on connecting... I suspect its one of the path variables - when I installed xaamp 1.7.4 port 80 was busy so I changed it to 85. below are my path variables in config.inc.php: // Determine location of files and the URL of the site: define ('BASE_URI', 'C:\xampp\htdocs\ecommerce\virtual\knowledge\html'); define ('BASE_URL', 'localhost:85'); define ('PDFS_DIR', BASE_URI . 'pdfs/'); // Added in Chapter 5. define ('MYSQL', BASE_URI . 'C:\xampp\htdocs\ecommerce\virtual\knowledge'); for the BASE_URL constant I tried: localhost 127.0.0.1 127.0.0.1:85 and the current: localhost:85 -and still continues to hang I'm using the older xaamp because the new version wasn't working for me. And I also have the exact setup on another computer -with the same configs and paths etc... and all is fine. Im trying to put it on my laptop as well -using firefox -windows 7 -later I will port to a real unix box Hope you all can help.
  14. Thanks Hart, I will read the article and see if it helps. I do understand recursion and functions calling themselves. I have a couple more sources to check out too. So, let me ask you a question: Can anything that can be done with a recursion be done with a loop or are there circumstances where one must use a recursion and nothing else will work?
  15. Thanks for the reply. Here is the script I understand the table structure and the sql, I also understand all the multidimensional array scripts preceding this. If you ask me what don't I understand, I probably couldn't tell you. I did the google / tutorial thing. They always say these are "simple" and "basic". Those "tutorials" really shouldn't say that because then, if you can't figure it out, you feel like a total DA. -rant over <!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=iso-8859-1" /> <title>View Tasks</title> </head> <body> <h3>Current To-Do List</h3> <?php # Script 1.5 - view_tasks2.php /* This page shows all existing tasks. * A recursive function is used to show the * tasks as nested lists, as applicable. * Tasks can now be marked as completed. */ // Function for displaying a list. // Receives one argument: an array. function make_list ($parent) { // Need the main $tasks array: global $tasks; // Start an ordered list: echo '<ol>'; // Loop through each subarray: foreach ($parent as $task_id => $todo) { // Display the item: // Start with a checkbox! echo <<<EOT <li><input type="checkbox" name="tasks[$task_id]" value="done" /> $todo EOT; // Check for subtasks: if (isset($tasks[$task_id])) { // Call this function: make_list($tasks[$task_id]); } // Complete the list item: echo '</li>'; } // End of FOREACH loop. // Close the ordered list: echo '</ol>'; } // End of make_list() function. // Connect to the database: $dbc = @mysqli_connect ('localhost', 'root', '', 'test') OR die ('<p>Could not connect to the database!</p></body></html>'); // Check if the form has been submitted: if (isset($_POST['submitted']) && isset($_POST['tasks']) && is_array($_POST['tasks'])) { // Define the query: $q = 'UPDATE tasks SET date_completed=NOW() WHERE task_id IN ('; // Add each task ID: foreach ($_POST['tasks'] as $task_id => $v) { $q .= $task_id . ', '; } // Complete the query and execute: $q = substr($q, 0, -2) . ')'; $r = mysqli_query($dbc, $q); // Report on the results: if (mysqli_affected_rows($dbc) == count($_POST['tasks'])) { echo '<p>The task(s) have been marked as completed!</p>'; } else { echo '<p>Not all tasks could be marked as completed!</p>'; } } // End of submission IF. // Retrieve all the uncompleted tasks: $q = 'SELECT task_id, parent_id, task FROM tasks WHERE date_completed="0000-00-00 00:00:00" ORDER BY parent_id, date_added ASC'; $r = mysqli_query($dbc, $q); // Initialize the storage array: $tasks = array(); while (list($task_id, $parent_id, $task) = mysqli_fetch_array($r, MYSQLI_NUM)) { // Add to the array: $tasks[$parent_id][$task_id] = $task; } // For debugging: //echo '<pre>' . print_r($tasks,1) . '</pre>'; // Make a form: echo '<p>Check the box next to a task and click "Update" to mark a task as completed (it, and any subtasks, will no longer appear in this list).</p> <form action="view_tasks2.php" method="post"> '; // Send the first array element // to the make_list() function: make_list($tasks[0]); // Complete the form: echo '<input name="submitted" type="hidden" value="true" /> <input name="submit" type="submit" value="Update" /> </form> '; ?> </body> </html>
  16. I'm really struggling with the recursion function starting on page 18. Eventually I will get if figured out as I always do. But it is taking longer than I'd like. So I'd like to ask if I can skip this part for now and come back to it later because I'd really like to explore the rest of the book. Or must I absolutely understand this before moving on? I'd love to hear from someone who's finished the book
  17. Thanks, that clears it up quite a bit. My Linux host does have the public_html directory with all my coffee files and so does the www folder with the shortcut icon on it. I forgot the term in Unix when they do this. "Basically, there are a lot of possibilities." -seems to be. And can be a bit confusing in the Linux world.
  18. Hi all, would a relative or absolute path be better for security within the BASE_URI definition? (/coffee is my base folder) And the book says that I should put mysql.inc.php connection script outside the web root folder. So am I using the dot and slash correctly below (./mysql.inc.php) ? define ('BASE_URI', 'http://www.mysite.com/coffee'); define ('BASE_URL', 'localhost:8888/'); define ('MYSQL', BASE_URI . './mysql.inc.php'); Another question: I'm curious of why the use of port 8888
  19. Thanks Larry and Antonio, that cleared it up nicely. So I'm guessing that inner joins were used a lot before MySQL became relational? I heard that MySQL was not always relational.
  20. Hi, On page 166 it say the non_coffee_products table has a many-to-one relation with non_coffee_categories table. I'm guessing this is the FK in the non_coffee_products table: KEY `non_coffee_category_id` (`non_coffee_category_id`) ? But I see no relation to this table: CREATE TABLE `non_coffee_categories` ( `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, `category` varchar(40) NOT NULL, `description` tinytext NOT NULL, `image` varchar(45) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `category` (`category`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; Almost all my SQL experience is in T-SQL so maybe I just don't understand MySQL syntax. I'm probably missing the obvious (as usual with me) and pre-apologize if I am. Thanks in advance for your help.
  21. Thanks for your reply. Do you mean that if I change the order (put the echo before the function) it won't work? I've always had trouble understanding the syntax of functions.
×
×
  • Create New...