Jump to content

Strider64

Members
  • Posts

    364
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Strider64

  1. I developed a calendar in PHP that uses namespaces here that you could use -> https://github.com/Strider64/Website-Development/tree/master/src/Calendar or you could use Google Calendar (I think) that I hear is pretty good. The rest is just manipulating the calendar with Javascript.
  2. This link might help you out -> http://phpenthusiast.com/blog/how-to-autoload-with-composer HTH John - I know it did me, for before this I was using my own crazy autoloader and it should make my GitHub repositories more standardized.
  3. Google's reCaptcha is pretty nice and easy to use -> https://www.pepster.com/contact.php I like using it for it save me from coming with my own and I can move onto other PHP scripts.
  4. I like this link https://phpdelusions.net/pdo, but I don't agree with everything they write. However, for the most part it's very informative and won't steer you wrong. (In my opinion)
  5. On points number 1 & 2 .....why not just have security levels for the admins? It would be easier and make people happier than blocking users by country? Heck, you could only have a only member site that way you can control who has access or not to certain pages. Think of it as having a green jacket at Augusta's Country Club (The Masters in case people don't know golf).
  6. I agree with ginerjm. I just wanted to add Radio Buttons can have only one value in the first place, so I don't even know why you are using an array? Unless all of the $id is going to be the same? An if that was the case there would be no need for an array for you are using Radio Buttons. <div class="radioBlock"> <input type="radio" id="radio1" name="reason" value="support" checked> <label class="radioStyle" for="radio1">support</label> <input type="radio" id="radio2" name="reason" value="advertise"> <label class="radioStyle" for="radio2">advertise</label> <input type="radio" id="radio3" name="reason" value="error"> <label class="radioStyle" for="radio3">Report a Bug</label> </div> However, I really don't understand what you are trying to do, so onward..... An to use an array you would in a form you wouldn't use $id, you would do something like: <input id="example" type="radio" name="use_item[id]" value=""> and this is how I retrieve it using php: $data = filter_input(INPUT_POST, 'use_item', FILTER_SANITIZE_FULL_SPECIAL_CHARS, FILTER_REQUIRE_ARRAY);
  7. I personally would concentrate on getting PHP with PDO acting right, before moving on to JavaScript/jQuery. It's relatively easy to add client-side script later and at the same time you'll have graceful degradation with the scripts. Myself I find if I have too many layers (I'm talking about coding) going on at the same time I get easily confused, but it could just be my old age creeping up on me. Just my .02 cents. BTW JQuery is easy to implement Ajax but plain vanilla JavaScript isn't that much harder. For example this is a little bit of the coding of a trivia game that I'm developing.. function insertNew() { var addform = document.getElementById('addTrivia'); var action = 'add_trivia.php'; var fdata = new FormData(addform); // for ([key, value] of fdata.entries()) { // console.log(key + ': ' + value); // } var xhr = new XMLHttpRequest(); xhr.open('POST', action, true); xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); xhr.onreadystatechange = function () { if (xhr.readyState == 4 && xhr.status == 200) { var result = xhr.responseText; console.log(result); var info = JSON.parse(result); console.log('info', info); if (info.result) { document.getElementById("addTrivia").reset(); function closeit() { document.getElementById("shadow").style.display = "none"; } if (info.result) { document.getElementById('shadow').style.display = 'block'; setTimeout(closeit, 2000); } } } } xhr.send(fdata); } done in vanilla javascript. Though I agree jQuery is easier to use for Ajax.
  8. I personally don't like protecting code to begin with and here my reasoning. I used to work for auto paint manufacturer that bought this really expensive software package from a company that heavily protected their code (though they did have tech support that they paid for), if the people in charge (the IT department) running the software even had to make a simple change to the software package they had to had the company do it. To make a long story short, the company that sold us the software package went bankrupt and left us up a creek without a paddle. Even though they were going out-of-business they still wouldn't unprotect the software claiming they still had held the rights to to software. So here we are with an expensive digital paperweight and having to fork over more $$$ to another company. My memory is a little fuzzy but it was so specialized piece of software that the competitors would have to write it from the ground up thus costing us money for the downtime and/or praying the software that we would currently using would hold up until the replacement could be up and running. Anyway, my point is that you being a small company (while you probably won't go out-of-business) are probably specializing in developing software that for most part isn't going to be freely distributed to other companies unless it's a game or a general application then like someone stated you don't have to give them the php file though that presents a minor problem (that also stated). I know from personal experience being held hostage on a software package is a negative experience. Besides the company went to you to write the software for they didn't want to take the time to develop themselves for they have other priorities. Like in my case we were making paint for the automotive industry and my specific job was matching the color to customer's (auto companies) OEM color standards. The last thing I wanted to do is figure out how that software work.
  9. I would just like to add never store a password in a session ($_SESSION)!
×
×
  • 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.