Jump to content

SaranacLake

Members
  • Content Count

    30
  • Joined

  • Last visited

Community Reputation

1 Neutral

About SaranacLake

  • Rank
    Member

Profile Information

  • Gender
    Male
  • Location
    New York
  • Age
    40

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. SaranacLake

    Save items to buy

    I'm rusty on PHP in general... When I worked with Session in the past, they were used for Customers with Customer record in the DB and that is not what I'd be doing here. As far as I know, when a user closes their browser the session ceases to exist, which relates to my questions above.
  2. SaranacLake

    Save items to buy

    This is one place where I am confused... If I log into my Smazon account, add items to my shopping cart, and a transformer goes out knocking me offline all weekend, when I go back into my Amazon account on Monday, my items will be there. If unknown-user adds items to their "shopping cart" and I store them in a PHP session, and a transformer goes out r they leave or whatever, then there is no way to link those shopping cart items back to unknown-user, right? So if they haven't registered and I'm not associating items chosen with a database record, I don't see how there is any permanancy? As far as the process flow, maybe this is where I am getting confused and where I need to tweak things... ********** - Unregistered user clicks on "Subscribe" - System takes them to a page showing: Plan-A, Plan-B, and Plan-C. (This is like a page in the product catalog.) - User chooses Plan-C and then is taken to another page in the product catalog to choose a free eBook. - After they do this, then they should have everything in their "shopping cart" that they need, and I could show them a "Checkout" button - User clicks on "Chekcout" and then I display a one page form asking for: Account Details Payment Details Does that sound better?
  3. SaranacLake

    Save items to buy

    This is where I am getting confused... In my original design, I had hoped to make people create and activate an account FIRST, and then when they were shopping or checking out, everything would be tied to a database record/user-account. But since I have been told not to do that, it's messed up how I envision things. When you say "shopping cart", isn't that going to be my Session or is it something else? Below is how I was going to design this new page...
  4. SaranacLake

    Save items to buy

    Well, to be clear, in the scenario above, a person would never have an account so they would never be logged in. (You would only see the "Subscribe" button if you aren't logged in, which is presumably people who don't have an account.) Now some follow up uestions... 1.) If a person chooses Plan- or Plan-B and thus never leaves my one-page checkout page, then would I even need to use a session? I mean if you are a single page that you could think of as both a Product Page and a Checout Page, couldn't I just grab whichever plan they choose as form data and leave it at that? 2.) If a person choose Plan-C where they get a free eBook, then they click on a "Choose my eBook" button adn I take them to the Product Catalog. They browse through the listing of eBook, and then would presumably choose "Add to Cart" for the free eBook they want. Now in that cae i guess I need the Session to capture which book they choose, so that when they return to the Checkout page, I have that info handy, right? 3.) Likewise, if a person did NOT imemdiately go to the product Catalog and choose their free eBook, and instead they started to fill out things like username, email, password, etc, then I guess i would want to store that in the Session so I dn't loose it when they leave to go pick out their free eBook? Hope that makes sense?
  5. SaranacLake

    Save items to buy

    So the user clicks on a member plan they want, and I stash it in the PHP session? Can you provide a simple code xample of how that is done? What I am not understanding - and why I explained more what I am doing - is that at this point there is no member record. So how does the session, or how do I, keep track of all of these random strangers on my site? Not to get to far ahead, but here is a related issue that I'm still not sure how to solve... So if a person chooses the first two subscription plans that is fairly straight-forward. However, with the thid plan they get a free book. And this necessitates them having to navigate off of my new once-stop-checkout-page and having to navigate to the "produc catalog" where they look through all of the books and pick one out. Because my new approach does not create an account first, it is unclear to me how I keep track of which subscription plan an unregistered user chooses, then which free book they choose from the catalog, and then how to piece all of that back together when they return to this one-stop-shop-checkout page. Does that make sense?
  6. SaranacLake

    Save items to buy

    @requinix, Please allow me t explain more what I'm trying to do... (Have been out of coding LAMP for years and this is like starting allow over?!) I am building an online newspaper/magazine where people can access mostly free content or buy a membership and get access to premium content. Originally I was going to use a registration process like you use here: Create account/Activate account/Log in/Use site. But after reading and speaking with people, they say that all of those steps will lead to cart abandonment, plus confuse most people. So here is what I was trying to do... You click on the "Subscribe" button in the menu. I launch a page which displays a couple of membership plans (e.g. Plan-A, Plan-B-, Plan-C). The user clicks on one of them, somehow I capture that choice, and then I take them to a "checkout" page where they would enter in there Account Details (i.e. username, email, password) and Payment Details (i.e. bank card info) and then they click "Process order". Does that make sense?
  7. SaranacLake

    Save items to buy

    What is the best way to capture items that someone wants to purchase when they don't have an account yet? And I prefer not using cookies.
  8. SaranacLake

    Update PHPMailer?

    First off, how do I post code here so it doesn't get garbled up? The code I spent a lot of time formatting last night ended up wrapping around in the [ code ] tags and probbaly made no sense?! Since I don't know OOP and thus namespaces, I would really prefer NOT to have to install the composer thing as I feel it will just further confuse me. In case you couldn't follow my last post, I have an fodler called "outside_webroot" that is at the same level as "public_html" and that is where I put the new PHPMailer v6 files. Then inside my "public_html" folder, I have a "utilities" folder which contains a "functions.php" script which has the function "callPHPMailer" which is how I send emails from other scripts (e.g. "reset_passord.php") I would *really* prefer to leave them there, and just do whatever is needed to make things work from there. Q1.) How can I manually tweak my code so this will work without having to install Composer and further mudding things up? Q2.) What is the "global namespace" and where is it located? Q3.) So if I simply move those lines of code outside of the function "callPHPMailer()" and to the top of my "functions.php" script, that would fix things?
  9. SaranacLake

    Update PHPMailer?

    I have a folder ouside my webroot called "outside_root" and I added the following... outside_root PHPMailer src Exception.php PHPMailer.php SMTP.php Then I have a function in my functions script like this... Function CallPHPMailer( ){ use PHPMailer\PHPMailer\Exception; use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\SMTP; require_once(HOME . 'outside_root/PHPMailer/src/Exception.php'); require_once(HOME . 'outside_root/PHPMailer/src/PHPMailer.php'); require_once(HOME . 'outside_root/PHPMailer/src/SMTP.php'); // And more code to instantiate a mail object and send the email... } My IDE is complaining aboout the USE statements... Not sure what is wrong?
  10. SaranacLake

    Update PHPMailer?

    I was able to download the latest PHPMailer as a .zip since I don't know Git. Now I'm not entirely sure what to do?! In my current set up, I have a directory outside of my web root where I have the following PHPMailer files... PHPMailerAutoload.php class.phpmailer.php class.smtp.php Then in my Webroot, I have a functions script which includes the PHPMailerAutoload script (and class) and then some code to create an object and send the email. Not sure what to do with this new version of PHOMailer...
  11. SaranacLake

    Update PHPMailer?

    P.S. So which version of PHPMailer should I choose - assuming there are diffeent versions?
  12. SaranacLake

    Update PHPMailer?

    Looks like I need to go figure out how to download and install the latest version of PHPMailer... I have no recollection of how to do this, and sure hope I don't get stuck r break my code. 😞 I just got an email saying you replied, but I didn't get one when you replied before. Nothing is in my spam folder, but I notice this happens sporadically.
  13. SaranacLake

    Update PHPMailer?

    After migrating my code to a new Mac with a newer version of MAMP, when I getting back into things, I go this error last night... Deprecated: ___autoload() is deprecated, use spl_autoload_register() instead in /path/to/PHPMailerAutoload.php on line 45 I guess that means the newer version of PHP that comes with the newer version of MAMP I am running on my new Mac broke things, huh? ******** P.S. How come I didn't get an email notifying me that you responded, when "Notify me of replies" was checked?
  14. SaranacLake

    Update PHPMailer?

    I have been away from a coding project for over 2 years. Trying to get things online, and not cause further delays. My site uses the PHP Mailer class to send out emails to users for things like password resets. How important is it that I have the latest version of this class - assuming it is even still around now? Thanks.
  15. SaranacLake

    Need help with MAMP

    @gizmola, You seem to be a drill-sergeant an loving father all in one?! I am very interested in learning how to do all of that, but I also stick to what I said (or implied) above... That being, I have a very large code-base I as working on a couple of years ago for a couple more years, and when I was 95% done, life happened and my work got tabled. My goal is to "finish what I started" and get my existing environment, tools, approach and code-base into prod so I can get my website up and try to make some $$$ while I regroup. (Starting to re-organize a Terabyte of crap on my old Macbook and laying it down in a way that I can actually find things on my new MacBook made total sense. But getting fancy with anything else is likely an unnecessary distraction...) And I am interested, but it was quicker to change a few lines of code in my httpd.conf file then do what you suggested. (For v2.0, I will check that and your other advice out.) There is nothing more than I want moving forward to learn how to code like a modern professional, and start being EFFICIENT, because that is what sunk me the first go around. (I have solid code that works, but it takes me 10 times longer to do and maintain things than it should for me to be successful. And, NO, that has nothing to do with tools, but has a s***load to do with architecture and coding styles!)) MAMP des what I need it to do for now. Took me an evening to research, and a few minutes to type the code to make it adapt to my new filing system. Now on trying to find all of my old code and notes and get my website working in my new dev environment on my new macBook. Thanks for the thoughts!
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.