Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by SaranacLake

  1. @gizmola, You're alive?! (Was afraid COVID got you...) Well, I understand media queries, but it IS more than just that. One problem is that my code suffers from "DIV-itis" and is probably more complex than it needs to be, including too many nested DIVs, but 8 years ago that was necessary to get the effects I wanted and to cope with supporting IE6. My other issue is that it seems to be much easier to code HTML and CSS *after* your website is done. In other words, after your site is done, then it's easy to identify patterns and be smarter with styling. My website was something that took years to cobble together, and my HTML and CSS shows that. It was also build in the days of 15-inch/17-inch monitors being the standard. I have kicked this around since posting here, and I think it is best to do this.... First, I have created a "temporary" website so people have something to look at and that I can update like a mini blog and it is entirely mobile. Second, I need to just finish my main website as is regarding HTML/CSS. I will lose tons of people not having my main site done, so I better get it done ASAP! The issue isn't finishing the site, it is that my site is tied to the news, and I am drowning in keeping up with our ever-changing world, and I simply can't spend the time I need to do coding AND create content that keeps up with the 24/7 news-cycle. THAT is the real issue. I was aware of those project in 2008. I simply couldn't understand them, PLUS I wanted the challenge of coding my own site, not "configuring" some framework. Only a fool would screw with working code on a web application that is 90% done. (You'd never see that in any Fortune-500 company I have worked for.) Rather you ship what you have, then re-factor after you have a live site. I don't have a live site. So why risk breaking 100% of my finished code to support mobile? In my OP, I wasn't sure. But now I think it would take too much effort and take too much risk. I'm sure the right body shop could cut up a Hyundai (i.e. my site) and *try* to make it a Mercedes (i.e. mobile), but the end result would never be the same as a real Mercedes. Because it is another thing I need to learn but don't have timef ro at the moment. Well, I can do that in NetBeans manually by creating a new project, so that is an idea. But after coding a temporary mobile site, I think it's a fool's errand to try and "fix" my rigid desktop code for mobile. Also, as mentioned above, there are some key sections of my current website that simply won't work on mobile and need to be re-engineered. That isn't an HTML or CSS issue - rather a fact that what works on a 15-inch monitor won't work on an iPhone 6. (Think of things like a 3-column layout, or a fixed top menu) As always, valid points above, but I sorta painted myself into this corner and it is what it is. I am so far behind shipping my site, it really doesn't matter at this point. The best thing to do it finish my e-commerce module so I have a way to collect $$$, then publish my site, then fill it with content, then IMMEDIATELY strat re-engineering thigs for "Mobile First" and see if I can do it piece-meal and maybe convert a section of my legacy site at a time.
  2. Don't remind me! Okay. My dream for v2.0 is to FINALLY learn MVC and OOP and rewrite my entire website in somethng like Python. (Also making it "mobile first".) Maybe if the world - and my world by proxy - stop melting, I can achieve that?! After freaking out last night, I have calmed down a bit, plus I realize that a lot of how my front-end is designed makes it incompatible with mobile, so a simple rewrite isn't possible - I will need to re-architect the front end to be truly entirely mobile. And some of that means I will need to re-architect the backend as well. I don't know how these 20-somethings code something like Facebook or Twitter overnight and become billionaires by 30?! (I just hope to see my website go live - and prosper - before I die in say 20 years!!
  3. No. As mentioned, I code like a use-case where each script is a particular function from start to finish. (Would love to learn MVC for v2.0) I'm still kicking things around, but at the end of the day it probably makes most sense to finish my e-commerce module coding like I have, go live with my site, then start from scratch on v2.0 instead of trying to "fix" my un-mobile website. (Having worked in IT for my entire life, I have never seen a "fix it" project that ended well, because you can't fix crap!) Still, it makes me sick to think of all of the people (more likely 80%) I will lose because my website won't play well on mobile. ๐Ÿ˜‚
  4. Thanks, but if it was as easy as a few lines of CSS, then i wouldn't be here...
  5. I don't know OOP, so I code everything like a use-case, i.e. 1st do this, then do that, then do the next thing. All of my PHP scripts start off with the PHP at the top and then HTML at the bottom. So, in theory, things are fairly separate. I guess my larger fear is that I just can't seem to "get the football in the endzone". Speed has never been my strength, and while what i have is solid from an end-product, it also isn't mobile. If you landed on my home page or tried to read a basic article, you'd be scrolling to the right quite a bit since it is built for a 1028 X 768 world. I guess there is no harm in releasing things as coded, but if everyone is on mobile and they ditch after 5 seconds, then why release things as-is, right?
  6. I don't want to say my HTML/CSS is sh*t, but it IS very outdated - as in like from 8 years ago. Back then, mobile was an after-thought, and most people still browsed the web on laptops or PCs. As a for instance... For whatever stupid reason, all of my web pages either have a left margin/padding to center things, and/or use a min-width setting which pretty much trashes things on mobile, because you have a white "gutter" on the left and have to scroll right to see the whole page. I feel like that makes my website a "dead duck in the water". The problem is that my website has LOTS of functionality - and it isn't some cutesy WordPress blog or SquareSpace site. Right now my code-base is like 60,000 lines of code and hundreds of files. How did I get to this point? Death in the family, a medical condition, job loss, the pandemic, etc. I feel like I am in a lose-lose situation. I was supposed to finish the e-commerce module of my website last spring, and then go live by like April. The pandemic really screwed that up. I have a month or two of coding to do to finish the e-commerce module, and I am wondering now if my 1st priority should be making my website - or at least 80% of it - mobile instead?
  7. Sure, upload my entire code-base for you to review... Would you like a copy of my financials as well?
  8. I've got a monumental problem on my hands... ๐Ÿ˜‚ The website that I've been working on - for years - for my startup business is just about done, but because I have taken so long to code things, my HTML is very outdated, and is *not* mobile friendly. I was hoping to go live with my website in the next month or two, but considering that over half of Internet users are on mobile, it makes me wonder if I should release my rigid, un-responsive website as-is, or take months trying to re-tool things. That, in itself, will be a monumental task, BUT it also makes me wonder if I will break all of my tens of thousands of lines of PHP and MySQL? A very loaded question, for sure, but if you were me, what would you do? What I am really fearful of is FUBAR'ing my PHP code which I have spent thousands of hours testing and am hesitant to even blink at?!
  9. @kicken How does this look... # REWRITE TO WWW #------------------------------------------------------------------------------- # RewriteCond %{HTTP_HOST} !^www\. [NC] # RewriteRule ^(.*)$ https://www.%{HTTP_HOST}$1 [L,R=301] # REWRITE TO HTTPS #------------------------------------------------------------------------------- #RewriteCond %{HTTPS} !=on #RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  10. So do I need two rewrites? The first rewrite to make any non-www URLs to www ? And then a second rewrite to make all www URLs https://www ? Or do I approach things from converting all non-www to https://www ? And then convert any www or http://www to https://www ? The point being that there are lots of combinations here, and I'm not sure what is the best way to do rewrite and redirects using my .htaccess file on my VPS?
  11. So how do I redirect someone from "mysite.com" to "www.mysite.com"? And how do I force an HTTP url to HTTPS for security?
  12. Is it correct that Google considers these URLs as separate websites? phpfreaks.com www.phpfreaks.com http://www.phpfreaks.com https://www.phpfreaks.com I have a VPS with an SSL certificate, and I would like to know how to point everyone to this URL so I don't get dinged by Google in the search results and for SEO... https://www.MySite.com
  13. Actually, no, I'm just trying to be a good developer and checking twice! Yes, if a Member lands on the "Trial Offer" page, that script will prevent them from adding the "Trial Offer" to their shopping cart. But I figured it would be a good idea in my checkout.php script to do an inventory of things and make sure everything is legit before I move forward. (Bad data has a crazy way of sneaking in place you never expect?!) So back to my OP... I was looking at some old old code, and it looks like I could just use PHP to iterate through the user's shopping cart records, and then I can update each record that I come across - without necessarily needing an array - right?
  14. Hello. I'm trying to figure out the most logical way to update my shopping cart (table). When my checkout.php script loads, I need to run some checks on all cart items and take appropriate action. For example, a "Trial Offer" is only available to non-Members, so if a Member somehow has a "Trial Offer" in his/her shopping cart then I'd like my checkout.php script to remove that automatically from the Member's cart. So when checkout.php loads, one of the first things I do is to read the user's shopping cart items from the database. But what is the most logical way to update the shopping cart table? Do I load the shopping cart records into an array, then iterate through them, remove any non-applicable "Trial Offers" and then write things back to the shopping cart table? (If so, then how do I merge things? This is what is confusing me...) Or do I somehow iterate through the shopping cart records for the user and update each record at a time and avoid loading things into memory like using an array? Again, this seems like a simple enough task, but I'm not sure the smartest way to do things?!
  15. @requinix Thanks, as always, for the help!! ๐Ÿ‘
  16. True. Told you I was rusty on all of this stuff... Right, I meant Session "files". I think I figured it out... That 2nd Session file is not from my code, it is from phpMyAdmin!! (Just for reference, should I ever see a query stored in my $_SESSION variable unless I am doing something crazy?? I would so, "No!")
  17. I don't know, it just seems like the $_SESSION variable should know/have it's own name?! ๐Ÿคจ So I guess I need to do this... session_start(); $_SESSION['sessionID'] = session_id(); var_dump($_SESSION); $sessionID = (isset($_SESSION['sessionID']) ? $_SESSION['sessionID'] : ''); exit(); And then I can INSERT $sessionID into a new SHOPPING_CART record? Oh, one other thing... When I look under tmp > php I see two session variables. The first one is consistent with what I'd expect and contains... test|s:5:"hello"; However, the other session variable has tons of stuff in it, include a couple of SQL queries... (In fact, it includes the UNION query I was asking you guys about the other day in the MySQL forum!!) What is all of that about??
  18. I added an echo like this... session_start(); echo session_id(); //new var_dump($_SESSION); exit(); So that echos what appears to be my session_id, but... Why isn't session_id stored in the session when I create it?
  19. I finally found some useful info at php.net and found that PHP create a file for each new session and stores it here: session.save_path in the php.ini file. Questions: 1.) In my PHP code, what should I be storing in my shopping_cart table for the session_id? Is the file name that PHP create? 2.) And how can I capture that and store it in my table?
  20. Yeah, I looked at my login.php script and seems that, for logged in members, I store their "memberID" in the "$sessMemberID" variable. So let me back up and explain why I'm asking about all of this. Right now I am working on building code to add items to the user's shopping cart. In my SHOPPING_CART table, I have a column for "member_id" which works great is a user is also a member and logged in. But for members that are not logged in, OR for users who are not yet members, I want to use the Session "session_ID" who that I can store whatever a user put into his/her shopping cart. I just added this to my home page... session_start(); //existing var_dump($_SESSION); //new exit(); //new If a user isn't a member and thus not logged in, then the above code shows "empty" when I load the home page. So once I start the PHP session, how do I find the "session_ID" so that I can store it in the SHOPPING_CART table and associate it with that random user/visitor??
  21. I could use some help remembering how sessions and cookies work... (Looks like another thing I have forgotten about!) In one of my old scripts, I start a session using... session_start() And then I have... $sessMemberID = (isset($_SESSION['sessMemberID']) ? $_SESSION['sessMemberID'] : ''); It appears my old naming conventions aren't so clear after being away for several years... In my database I have a MEMBER.id (table/column) which is just an AutoNumber, and I thought that PHP create a "Session ID" but that it was some long hexadecimal number? So it's not clear to me what is in $sessMemberID. I tried to look in the cookies file under my Firefox profile, but when I open it in BBEdit all i see is gibberish in that file. Can someone please help me put these disparate parts together? Thanks!
  22. In one subtype I have a field called "title" and in another substype I have a field called "name". When I use a UNION, I am able to get them to appear in the same column, but it seems that the column name adopted is just the first query SELECT p.id, p.sku, mp.product_id, mp.name FROM product AS p INNER JOIN membership_plan AS mp on p.id = mp.product_id UNION SELECT p.id, p.sku, bk.product_id, bk.title FROM product AS p INNER JOIN book AS bk on p.id = bk.product_id How can I "shift" things so my final query shows the columns: id, sku, name, title where the first table would fill out "name" and have blank "title" rows, and the second query would have blank "name" rows but filled out "title" rows??
  23. You proposed EAV which is a whole other beast. It's also a different design that I'm not suing. Is a UNION the way to go with my current design?
  24. Here is a little more of what (I think) I'm trying to do... PRODUCT (parent) - id - product_type_code - sku BOOK (subtype) - id - product_type_code - title - thumbnail SHIRT (subtype) - id - product_type_code - name - thumbnail I am trying to build a query that can be used to display all items in a person's shopping cart. Because I have disparate subtypes, some things won't match up - which is why i decided to create subtypes in the first place - but things like a product's name, description, and thumbnail should be universal for any subtypes. My cart looks like this... SHOPPING_CART - id - member_id - product_id - cart_price - quantity But in the shopping cart I display to the user, I also need some fields from the subtype tables. (For example, a BOOK has a "title" whereas a SHIRT has a "name". So how can I create a query so I can get results like this... - id - product_type_code - sku - book_title OR shirt_name - book_description OR shirt_description - thumbnail - price - quantity Hopefully that makes sense!
  25. My database has parent Product table and multiple sub-type tables like Books, Tshirts, Gear, etc. I need a way to display everything in the Product catalog including details only found in the sub-type tables. How do I do that? When I tried multiple INNER JOINS my query didn't return any records. Maybe I need to use a UNION?
  • Create New...

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.