Jump to content
Larry Ullman's Book Forums

Christopher Bergin

Members
  • Posts

    90
  • Joined

  • Last visited

Posts posted by Christopher Bergin

  1. ok, I understand now. I guess if I were to click on the iframe that hosted the third-party advertisement, the URL path would change to another host.

  2. Perhaps someone could answer this question for me. How do marketers know what commerce sites you have recently visited in order to place specific advertisements on the sidebar of websites that you subsequently visit? I'm guessing it has something to do with cookies but if I'm not mistaken, it's my understanding that vendors do not have access to cookies other than their own.

  3. I'm just getting started on Example 2 and was in the process of setting up a filesystem and creating an .htaccess file. I planned to copy the rewrite code from the downloaded example files but when I attempted to open the file in my editor, it was grayed out. I can't seem to get to it. Any idea what the problem could be?

  4. It appears that my problem with PayPal is with the generated code for the subscribe button. The form action is directed to the Production site.

    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">

    Manually changing the code to read <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post"> doesn't effect the desired results. I would probably need to go through the process of creating the accounts again from the beginning, if I'm so enthused. Thanks for the help just the same.

  5. I was able to resolve my issue. I noticed on the first screen of the phpinfo file that the correct path to the php.ini file is listed in plain sight.

    The file that I was editing was located at /Applications/MAMP/conf/php.ini.

    The file that I needed to be editing is /Applications/MAMP/bin/php/php5.4.10/conf/php.ini.

     

    All set for now.

  6. I don't think I'll resolve this issue with PayPal so I went ahead and read the remainder of the chapter. Just a few quick questions...

     

    Once the IPN is initiated on the PayPal side, it's my understanding that whatever variables that were sent to PayPal to complete the registration process are returned as $_POST variables for validation. When constructing the $req variable, their inclusion is required, is that correct?

     

    When the response variable $res is being assigned a value, does the fgets function read just 1 line of text? Does $fp consist of numerous lines of text that include the values for 'payment_status', 'receiver_email', 'mc_gross' etc?

     

    Which leads me to my last question, are the $_POST entries such as 'payment_status' specific to PayPal responses and are not arbitrary?

  7. yes, a view of my Sandbox accounts are displayed and my name is visible in the top right corner of the page as being actively logged in.

    https://developer.paypal.com/webapps/developer/applications/accounts.

     

    The 'log in to complete your checkout' page is where my problem occurs. I continue to receive an error message.

    Please check your email address and password and try again

     

    The email and passwords I'm entering at this point are valid because I can log into each Sandbox account using them. I'll submit this on the PayPal forum as well. 

  8. yes, I created a script and placed in htdocs with the rest of the scripts and ran it but I saw no results. 

     

     

    <?php
    ini_set('display_errors', '1');
    echo 'the setting has been set!';
    ?>
     
    the version of PHP is 5.4.10 in the preferences tab on the MAMP widget and also reflected in the phpinfo document. The php.ini file I'm modifying is 5.4.10 in the config folder and the permissions setting reads admin and Christopher Bergin with read/write capabilities.
  9. The whole Paypal integration is painful. After setting up 1 merchant account and 3 buyer accounts, I can't get Paypal to recognize any of the accounts when a user is redirected after registering. Has anyone else experienced this? Prior to even testing Knowledge Is Power, I make sure that I'm logged into Paypal.

  10. Since I wasn't receiving error messages from my error handler, I went about commenting out certain conditions such as the script that redirects unauthorized users. What I did find was that a syntax error could prevent the page from rendering. A couple of times in other parts of the project, I just used the author's  script and it cleared up problems. I'll report back if I still get stuck. 

  11. I'm trying to understand the flow of execution in the parser script (expat.php script 13.8)

    Does the parse function xml_parse($p, $data, feof($fp)) automatically call the element_handler function xml_set_element_handler($p, 'handle_open_element', 'handle_close_element') and if so, do the arguments in the parse function correspond to the parameters of the handler function? Is the handler function a recursive routine because I don't understand how the open and close functions can simultaneously be invoked.

     

     

     

    // Function for handling the open tag:
    function handle_open_element($p, $element, $attributes) {
     
        // Do different things based upon the element:
        switch ($element) {
        
            // Need to address: book, title, author, year, chapter, and pages!
        
            case 'BOOK': // Books are DIV's:
                echo '<div>';
                break;
     
    // Function for handling the closing tag:
    function handle_close_element($p, $element) {
     
        // Do different things based upon the element:
        switch ($element) {
            
            // Close up HTML tags...
            
            case 'BOOK': // Books are DIV's:
                echo '</div>';
                break;
     

     

    // Create the parser:
    $p = xml_parser_create();
     
    // Set the handling functions:
    xml_set_element_handler($p, 'handle_open_element', 'handle_close_element');
    xml_set_character_data_handler($p, 'handle_character_data');
     
    // Read the file:
    $file = 'books2.xml';
    $fp = @fopen($file, 'r') or die("<p>Could not open a file called '$file'.</p></body></html>");
    while ($data = fread($fp, 4096)) {
        xml_parse($p, $data, feof($fp));
    }
     
    // Free up the parser:
    xml_parser_free($p);
    ?>
    </body>
    </html>
×
×
  • Create New...