nomadsoul
Members-
Posts
29 -
Joined
-
Last visited
Everything posted by nomadsoul
-
Mail Server Error
nomadsoul replied to nomadsoul's topic in PHP for the Web: Visual QuickStart Guide (5th Edition)
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 -
Mail Server Error
nomadsoul replied to nomadsoul's topic in PHP for the Web: Visual QuickStart Guide (5th Edition)
Thanks, sometimes I forget the obvious -
Mail Server Error
nomadsoul posted a topic in PHP for the Web: Visual QuickStart Guide (5th Edition)
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 -
No image available.
nomadsoul replied to nomadsoul's topic in Effortless E-Commerce with PHP and MySQL (2nd Edition)
I am now getting the 'no image available' default jpg, -a bit of progress, -
No image available.
nomadsoul replied to nomadsoul's topic in Effortless E-Commerce with PHP and MySQL (2nd Edition)
btw the information does show up in the DB -
No image available.
nomadsoul replied to nomadsoul's topic in Effortless E-Commerce with PHP and MySQL (2nd Edition)
sorry two images uploaded. No need to hurry, I'm just going through your book at leisure and review -
No image available.
nomadsoul replied to nomadsoul's topic in Effortless E-Commerce with PHP and MySQL (2nd Edition)
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"; -
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.
-
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
-
Db Connection Ok, Html Folder Hangup
nomadsoul replied to nomadsoul's topic in Effortless E-Commerce with PHP and MySQL
Thanks Larry, I've fixed it. It was as you say in the dynamics -
Db Connection Ok, Html Folder Hangup
nomadsoul replied to nomadsoul's topic in Effortless E-Commerce with PHP and MySQL
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. -
Db Connection Ok, Html Folder Hangup
nomadsoul replied to nomadsoul's topic in Effortless E-Commerce with PHP and MySQL
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 -
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.
-
The Recursion On Page 18
nomadsoul replied to nomadsoul's topic in PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
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? -
The Recursion On Page 18
nomadsoul replied to nomadsoul's topic in PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
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> -
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
-
Relative Or Absolute Path Better?
nomadsoul replied to nomadsoul's topic in Effortless E-Commerce with PHP and MySQL
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. -
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
-
Foreign Key Coffee Question
nomadsoul replied to nomadsoul's topic in Effortless E-Commerce with PHP and MySQL
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. -
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.