Jump to content

benanamen

Members
  • Content Count

    1,786
  • Joined

  • Last visited

  • Days Won

    32

Everything posted by benanamen

  1. benanamen

    JSON naming convention

    You pretty much covered it in the first sentence so I will just tell you what my standard is. snake_case = DB Columns, Variable Names & Function Names (same as Php. i.e: set_exemption_handler) camelCase = OOP methods, method calls, & OOP Properties PascalCase = Class Names. (i.e: class UserAccount) dash-seperator = Filenames (For SEO i.e: my-file.php)
  2. benanamen

    Extra characters in a image link string

    You have a malformed image tag. Forget the error prone escaping gymnastics. $image = "<img src='imgpg/$part_no.JPG'>";
  3. benanamen

    Hyperlink on email address from database element

    First off, I would suggest eliminating all the escaping gymnastics. It is harder to read, more prone to error and not as clean as not doing it. As to your problem, you are missing the basic syntax of a hyperlink, the closing </a>. Here is a cleaned up version. Take note of the single quotes on the elements. echo "<p>Name:{$item['first_name']} {$item['last_name']}<br> Email: <a href='mailto: {$item['email']}'>{$item['email']}</a></p>";
  4. benanamen

    refreshing page issue

    @gw1500se is correct, you would use PRG (Post/Redirect/Get). You would not need Sessions in this case.
  5. benanamen

    Taking the leap to MVC

    Is the Fowler book agnostic? The concepts are. Will it work for Python and Java as well as PHP? The concepts will Do I already need to understand MVC or OOP prior to reading it?  Not at all. When it says novice, it means it. Also, can you recommend some exceptional books (or online resources) for learning *proper* MVC? I already did.
  6. benanamen

    Taking the leap to MVC

    Novice to Ninja covers MVC and OOP. It's just like the name, you start out a Novice and end up a Ninja. I know the title can imply that the book is FOR novices to Ninja expertise level rather than starting as a novice and ending up a Ninja. I have also brought that up to the author, as my first impression was the latter.
  7. benanamen

    Taking the leap to MVC

    It's your code, your call. There is one other option, you could email a zip to me. There is nothing you have written that I could not do myself so you don't have to worry about me stealing it. I was just offering solutions that will get you on the fast track to where you want to go. So, if emailing to one person doesn't work for you either, then I would say take a break from your project and read a book. Actually, two books, the ones I mentioned previously. If you read and learn what is in them, you wont need us for much of anything, at least for a long time.
  8. benanamen

    Taking the leap to MVC

    LOL! I get it. Op would be in the copilots seat but there's no pilot! (Well, okay, the Laracasts are actually pretty good) Learning Laravel is just that, learning how to USE Laravel when what you really want to learn is how to write your own "Laravel". So sorry to hear you have to work with Laravel every day. I didn't realize things were that rough for you. I laugh when I see ads looking for "Laravel Ninja's". Some fun facts. A current install of Laravel before you even think about writing a lick of code is 7,445 Files and 1,445 Folders. Symphony is a whopping 9,855 Files and 1,843 Folders. I am coming in for a landing and waiting for the OP in the First Class Pilots Lounge.
  9. benanamen

    Taking the leap to MVC

    Jumping into a framework without even being able to do the basics of procedural code separation, de-duplication, logic, etc.. is not a good move IMO. I liken it to trying to fly a Jet Fighter when you haven't mastered the basics of flying a Cessna. Of course it wont hurt anything to snoop around and try out frameworks (I did as a noob) but the OP has some specific timing goals. If he just wanted to "get the job done" that may be one thing, but the OP has stated he wants to learn. It doesn't take MVC or a framework to "separate my website's PRESENTATION from its LOGIC" as the OP posted. Based on OP's posts across numerous forums, he is not ready for Controllers, Models and the like. A framework like Laravel has a whole ton of "magic" which is just going to confuse the OP. I go back to my previous post as a good approach for the OP to move forward swiftly. I for one would take some time to review OP's project as a whole if he should make it available on a repo. So OP, it's your move. You have at least one expert that will review your project and is willing to guide you towards higher level programming. Who better to teach you how to become a "Jedi" than other "Jedi's"? As you correctly stated, there is a lot of junk out there and you don't know enough to know what is a good tutorial.
  10. benanamen

    Taking the leap to MVC

    That's great you want to learn new things. I would encourage anyone to always keep learning. What I would suggest, instead of jumping into something completely new, especially based on your story, is to learn refactoring. There is probably quite a bit you can do with your current code base to refactor yourself towards an MVC/OOP application. I would recommend you put your entire project on GitHub so we can see what your working with and make recommendations. If you don't want the world to see the code you can make the repo private and PM access to those of us that would look it over. I very highly recommend the book "PHP & MySQL: Novice to Ninja, 6th Edition" by Tom Butler & Kevin Yank. I would also recommend the book "Refactoring - Improving the Design of Existing Code" by Martin Fowler. By the time you learn what is in those two books you will indeed be a master "Jedi".
  11. benanamen

    Securing 'hidden' form values

    The current coding standard is to use Prepared Statements. There is no "escaping" done.
  12. benanamen

    PHP Not connecting to SQL Server

    mssql_connect was removed from Php http://php.net/manual/en/function.mssql-connect.php PDO is how you will want to do it. http://php.net/manual/en/book.pdo.php
  13. benanamen

    Recursive Conditional Copy and Rename

    What are you doing in dev that is not going to be pushed to production? If you are serious about development you shouldn't be in a position where the web host is making changes to your server. A VPS is super super cheap these days and is the equivalent of a dedicated server as far as access and what runs on it. YOU have full control of the server. Of course that means you will need to have or get some server admin skills. There is also no reason you couldn't exactly mirror whatever production setup you have in dev between Vagrant, Containers such as Docker or Virtual Machines. You should also be using version control like Git if you are not already. That will allow you to have dev branches and not affect the master codebase until you are ready to merge the changes.
  14. benanamen

    Recursive Conditional Copy and Rename

    You probably should go into it. Experience says whatever you are doing, you are doing it the wrong way. You are asking how to solve your attempted solution which I would pretty much guarantee is not the right approach. If you tell us what the real problem is we can properly advise you.
  15. benanamen

    Adding

    `
  16. benanamen

    Submit large form created with select statement

    Start by posting your form. You are heading off in the wrong direction.
  17. benanamen

    Submit large form created with select statement

    I will give you a clue. When you submit a form you get an array. The array has keys and values. You can loop over an array and do something with the keys and values.
  18. benanamen

    Doctrine, Composer, and namespace

    @NotionCommotion, thanks, that explanation is exactly what I was getting at. It helps put everything in perspective. Glad you figured out the problem.
  19. benanamen

    Doctrine, Composer, and namespace

    I cant teach you anything correctly if I don't know you are really doing. Sure I get you are asking "how to implement Class Table Inheritance using Doctrine ", but from my position, I have no idea if that is actually the correct solution to your problem. By forcing me to focus on your attempt instead of the problem you are locking yourself out of any other potential or better solutions. If you just plain ol wanted to learn Class Table Inheritance using Doctrine, that is one thing, but it comes across as though you have deemed this to be the solution to a problem at hand. I know your not asking me to build you something. I was trying to get across an easy way for me to understand what I was asking of you. The very nature of all your posts being outside the realm of what many of us with numerous years experience have ever seen makes it even more important to know what the actual project is. Honestly, I have often wondered if PHP is even the right language for whatever it is you are doing. Since I, and others have no clue to what it is, who's to say.
  20. benanamen

    Doctrine, Composer, and namespace

    Seems to be a DB design problem but since I still have no idea what is going on so I cant really say. You keep replying about HOW you are trying to solve a problem. I have no idea what this is really about. Best I can tell it has something to do with cars, trains, rockets and airplanes. What is the overall project at hand? Forget that you know any programming at all and you are telling me about something you want me to build for you.
  21. benanamen

    PHP Include with Open ELSE

    If you include a footer before a header file, the footer is going to show up in source on top of the header and vice versa which clearly shows that an include is "inserted" where the include is called. Of course, the OP has some conditional thing going on, but the cut and paste I suggested will show how the code is not "syntactically valid " as you already mentioned. As for your example using a conditional, the first one is saying "if true is false, then include the file". Since true is not false, it doesn't include it. In the second example, you are not using curly braces, so only one statement is evaluated in the if, which is of the same effect as the first one, if true is false, then echo the first line". True is not false, so it doesn't echo the first line. Seems we might not be on the same page. Kindly explain what you wanted me to see about the example. FYI: You did get me to learn up on something. Since I always use curly braces I didn't know without them only one statement is evaluated.
  22. benanamen

    PHP Include with Open ELSE

    Perhaps I am misunderstanding you because you are referencing the OP's post. Include does in fact "insert" the code at the point you include the file. An included file may not have anything that "runs". It could just be some HTML. As the manual says, include "evaluates the specified file". It is the same as though you cut and pasted whatever is in the include into the place the include is called. So OP, to see what you are actually doing, cut and past the contents of the include as a replacement to the include line and you will see the code as PHP is seeing it.
  23. benanamen

    Doctrine, Composer, and namespace

    Not a knock on you @NotionCommotion, but I agree with @ginerjm. Everything you post about is outside the realm of anything I have ever encountered in 30 years of being in the industry. To this day, I still have no clue what you are up to. I would really be interested in what you are doing, you know, the Real problem, as I often say.
  24. benanamen

    PHP in CSS with SQL and Sessions

    Your post makes no sense to me. CSS has absolutely nothing to do with PHP, SQL or Sessions. "Progress into the css file"??? Makes no sense at all. How about telling us what the REAL problem is instead of asking about your attempted solution to the real problem.
  25. benanamen

    PHP picture name from sql not loading

    Ok, technically speaking yeah. What I meant was the OP broke free of the the single quotes with concatenation "escaping" from being within the single quotes.
×

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.