Jump to content
Larry Ullman's Book Forums


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About nomadsoul

  • Rank
  1. I am now getting the 'no image available' default jpg, -a bit of progress,
  2. btw the information does show up in the DB
  3. sorry two images uploaded. No need to hurry, I'm just going through your book at leisure and review
  4. 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";
  5. 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.
  6. So where can I download and buy the e book?? anyone?
  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 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>