Jump to content
Larry Ullman's Book Forums


  • Posts

  • Joined

  • Last visited

Recent Profile Visitors

928 profile views

dmx1's Achievements


Newbie (1/14)



  1. Qu 1: What I mean, is zend mail secure and efficient enough to be used as a professional email sender in a fully functional ecommerce website? Qu 2: if zend mail is not meant for a professional environment or not secure enough, what professional email sender would you recommend? regards
  2. Ok, that's fine. So would I be able to use the zend mail in a production environment? Meaning, if I upload the whole application to my hosting provider, will i be able to use their smtp/email settings along with the zend mail code you wrote, to implement sending emails using zend mail?
  3. Hi Larry, Happy New Year! I'm having problems sending and receiving emails via the zend-mail procedure. The code on page 434 runs fine without any errors, but I am just not receiving any emails. I used the exact code on page 434, but that wasn't working, so I tried to configure smtp settings, thinking that may be the missing solution, which is: // Create a new mail: use Zend\Mail; use Zend\Mime\Message as MimeMessage; use Zend\Mime\Part as MimePart; use Zend\Mail\Transport\Smtp as SmtpTransport; use Zend\Mail\Transport\SmtpOptions; // Create the parts: $html = new MimePart($body_html); $html->type = "text/html"; $plain = new MimePart($body_plain); $plain->type = "text/plain"; // Create the message: $body = new MimeMessage(); $body->setParts(array($plain, $html)); // Establish the email parameters: $mail = new Mail\Message(); $mail->setFrom('myemaill@aol.com', 'Dmx'); $mail->addTo($_SESSION['email'], 'Tom'); $mail->setSubject("Order #{$_SESSION['order_id']} at the Coffee Site"); $mail->setEncoding("UTF-8"); $mail->setBody($body); $mail->getHeaders()->get('content-type')->setType('multipart/alternative'); // Setup SMTP transport using LOGIN authentication $transport = new SmtpTransport(); $options = new SmtpOptions(array( 'name' => 'localhost', 'host' => 'localhost', 'connection_class' => 'login', 'connection_config' => array( 'username' => 'myusername', 'password' => 'mypassword', ), )); $transport->setOptions($options); $transport->send($mail); The above code then gave me the following error: 'An error occurred in script '/Applications/MAMP/htdocs/vendor/zendframework/zend-mail/src/Protocol/AbstractProtocol.php' on line 223: stream_socket_client(): unable to connect to tcp://localhost:25 (Connection refused)' So I'm at a loss as to what to do now. I know the zend-mail code has changed a lot since you wrote the book, but I just can't seem to find any success in finding the correct code needed to send and receive emails. Qu: Please could you help, by giving me the correct code needed to send emails using zend-email. I'm using a mac and mamp. Thank you regards
  4. Hi Larry, On page 344, in the 'tip' section, you wrote that in the forum there is a way on how to add general coffee and goodie types. I searched the forum, but cannot find the solution. Qu 1: Could you possibly send me the scripts for both solutions or direct me exactly to where I can the solution please. Thank you. regards
  5. Hi Larry, Seasons greetings to you. Hope you had a good one. Problem 1 Regarding the site administration section with the following url: localhost/admin/ When I click on the 'customers' link on the horizontal menu in the admin section, the 'customers.php' page doesn't exist. It just goes to the following url: localhost/admin/# I have looked and I can't find the 'customers.php' page. Qu 1: Can you let me know where I can find the 'customers.php' and script, in order to make the above link work and produce the correct results. Problem 2 When I click on the 'orders' link in the horizontal menu, in the admin section, in order to view the orders, and then click on the 'customer name' link to view the customer who made the order, I am sent to the following link, and then presented with the following error message: localhost/admin/view_customer.php?cid=58 'Not found. The requested URL was not found on this server.' Again, there is no 'view_customer.php' in any of the folders. Qu 2: Can you let me know where I can find the 'views_customers.php' in order to make the above link work, and produce the correct results. Thank you. regards
  6. Looking at it again, I think it's the same version that you are using, but just a different link. It's version 1.1.8
  7. Hi Larry, I am using the following version which can be found at: https://github.com/objco/anet_php_sdk It's called anet_php_sdk-master The reason I am using this version is because the link developer.authorize.net/downloads where you said we could download the version you are using on page 325, is obsolete, so I had no choice but to find another link where there was another version. I believe I am using a slightly different version from the one you are using. regards
  8. Upon further research, the problem happens in the billing.php page, specifically at the line: $response = $aim->authorizeOnly(); All my entered values are entered correctly, but when the following class is called in the 'anet_php_sdk' folder: class AuthorizeNetAIM extends AuthorizeNetRequest() and then the following method inside the class is called: public function authorizeOnly($amount = false, $card_num = false, $exp_date = false) { ($amount ? $this->amount = $amount : null); ($card_num ? $this->card_num = $card_num : null); ($exp_date ? $this->exp_date = $exp_date : null); $this->type = "AUTH_ONLY"; return $this->_sendRequest(); } The following variable parameters: '$amount', '$card_num', and '$exp_date' all return null values Up until then, all the variables '$amount', '$card_num', and '$exp_date' all have valid values, but for some reason, they are not being passed into the parameters inside the above 'authorizeOnly($amount = false, $card_num = false, $exp_date = false)' function So the values that have been entered for the credit card details, are never passed into the above method because the boolean 'false' is assigned to these values. I tried to take away all the 'false' values in the parameter in the 'authorizeOnly()' function, but all I got back was a blank 'billing.php' page. So because all 'null' values are returned in the above 'authorizeOnly()' method, the following method in the 'billing.php' page, returns false, and the payment is never processed. if ($response->approved) {) Can you help me solve this problem please. Thank you. regards
  9. Hi Larry, Hope you are well. I have hit a brick wall on page 336 on Effortless Ecommerce 2nd edition. I have written all the code up to this point. The only modification I have made is changing the urls beginning with 'https' to 'http' in the billing.php page eg: $location = 'https://' . BASE_URL . 'checkout.php'; to $location = 'http://' . BASE_URL . 'checkout.php'; and $location = 'http://' . BASE_URL . 'final.php'; to $location = '/final.php'; These are temporary adjustments because I don't have a ssl certificate installed yet. When I get to the billing.php page and fill out all the form details which are all correct. I then click the 'place order' button to process the payment, and absolutely nothing happens. My 'API_LOGIN_ID' id and 'TRANSACTION_KEY' are both correct. The billing.php page just refreshes with the same values in the fields, and not going to the 'final.php' page. I debugged the program and when I got to the billing.php page, when I got to the 'Process payment section' // Process the payment! if (isset($order_id, $order_total)) { I encountered an error at the following line: '$response = $aim->authorizeOnly();' all the values contained in the '$response' variable came back as null, ie: _response_array = null approved = (bool) false declined = null error = (bool)true response_code = null transaction_id = null invoice_number = null description = null customer_id = null first_name = null last_name = null etc so the following line: $r = mysqli_query($dbc, "CALL add_transaction($order_id, '{$response->transaction_type}', $order_total, {$response->response_code}, '$reason', {$response->transaction_id}, '$full_response')"); came back as false so if ($response->approved) returned false I don't understand what happened because all the entered fields in the 'billing.php' page were correct, but for some reason, when passed to Authorize.net, the values are failing and returning null values. I have tried for 3 full days to work this out but no luck. Can you please help Thank you regards
  10. Hi Larry, Hope you are well. I am having serious problems trying to implement a ssl certificate in order to test the https://localhost/checkout.php page in chapter 10. I am using a macbook pro, and using mamp. I tried created all the necessary files needed to to generate the certificate, but my problem starts when i try and edit the httpd.conf and http-ssl.conf files. In the httpd.conf file i have the following settings: Listen 8888 ServerName localhost:8888 Include /Applications/MAMP/conf/apache/extra/httpd-ssl.conf In my httpd-ssl.conf file I have: Listen 443 <VirtualHost *:443> ServerName localhost:8888 SSLCertificateFile "/mypath/server.crt" SSLCertificateKeyFile "/mypath/server.key" I then try and restart the apache server, but it states that apache cannot be started with those settings. I then changed the port to 80, and apache started, but i encountered other problems when trying to load the ecommerce site from localhost. Can you tell me a way I can run ssl on localhost so i can navigate to the https://localhost/checkout.php page and thus throughout the site please. Thank you. regards
  • Create New...