Jump to content

phppup

Members
  • Posts

    928
  • Joined

  • Last visited

  • Days Won

    1

phppup last won the day on September 13 2022

phppup had the most liked content!

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

7,297 profile views

phppup's Achievements

Prolific Member

Prolific Member (5/5)

3

Reputation

3

Community Answers

  1. @mac_gyver yes, I had discovered that, but it wasn't the actual fix. The real issue was that my test for is_file was flawed; it didn't drill down to actually test the specified file. if (is_file($subDir)) { //needed to become if (is_file($directory.'/'.$subDir)) { After both adjustments, everything is running better than expected!
  2. I thought this made sense, but it wouldn't work until I removed lines that I thought would provide extra validation: $dir = 'rootFolder'; $directories = scandir($dir); foreach($directories as $directory){ if($directory=='.' or $directory=='..' ){ echo 'dot'; }else{ if(is_dir($directory)) echo '<strong>'.$directory .'</strong> <br>'; $filePath = scandir($directory); foreach($filePath as $subDir){ if($subDir=='.' or $subDir=='..' ){ echo 'dot2 <br>'; }else { // if (is_file($subDir)) { //Only provided PHP files but NO IMAGES echo $subDir . "<br>"; } } // } } } } I'm just feeling down one level of a director to see what I've get. It seemed like a simple exercise until I tried to list the files. Obviously, of it's not a directory it MUST be a file, but why did quantifying it as a file not recognize my files as a file??
  3. @gizmola Yes, I had considered IP tracking for the types of instances that you mentioned. Thankfully, this isn't (as of yet) for users that would be ill-intentioned (but it's good to know the expansion potential). As a side note, recording the time of logout seems reasonable when the user clicks the button. But what is the process of the user simply shuts down the browser?
  4. I'm considering setting up a webpage and tracking logins. For simplicity, let's say an account is required with an email address. So, [email protected] cannot do anything until he created his account. Now I want to know how often he logs in. Is there a recommended or best practice to gathering and storing this data before it becomes cumbersome or unuseful? Or is it as simple as connecting a table that associates a timestamp with every login by a registered user and just letting it run? (I'm wondering if there's something more efficient and less storage reliant)
  5. I recently dabbled with some AI after a webinar that proclaimed its wonders. Luke everything else, some features were good, others not so much. I asked it for some code and immediately recognized the response was accepted from W3. LOL Are there any worthwhile AI applications that are especially helpful for PHP? Javascript? HTML or CSS? Curious, but still prefer finding my own answers and coming to phpfreaks when stumped.
  6. @gizmola Sorry for the delay in my return to comment (but had some personal situations), and yes, I did realize the similarity. I very much wanted to use Barand's method (to try something new and more brief) but it wouldn't operate (I think an extra parenthesis) and the FOREACH solution was more in line with my understanding and existing code. If I recall correctly, I adapted this method successfully. Thanks to all that helped.
  7. Correct. No database involved. The array is generated from other PHP coding.
  8. I have an array of first and last names joined by an underscore (eg: Sally_Smith). Ultimately, I want to count the number of people (elements) with the same last name. My thinking is to run through the array and explode each element to isolate the last names, then use array_unique to create an array of $lastNameOnly and eventually use this as a counting mechanism against the original array.. Am I over-complicating this?
  9. @gizmola I appreciate all your help. Now I think we've come full circle and returned to my initial conundrum. If the business already has a minimal web presence with a registered domain, how can I incorporate MY form without making ripples in the pond. If I host it myself, then users are being re-directed. And if I put my code on the business domain server, then I no longer have exclusive access to it. What is the best solution for me?
  10. @gizmola As stated, just starting with a simple form to register users and collect information (eg: name, address, email, phone) for an easy access point that might be used later for sales' campaigns. I guess the real question is: How do I optimize my earrings and ensure that I don't have my work ripped-off by unscrupulous sources?
  11. @gizmola it would seem that the Software as a Service model would be more in line with my thinking (since I fear my code being co-opted). How is this best implemented? In simple terms, if the customer wants users to complete a form, would I just re-direct them to a form on MY server? Wouldn't that seem a bit suspicious if detected?
  12. @Strider64 I think my intention (at first, anyway) was to increase upload speed (especially if a few images were involved) and avoid upload size maximum limits (that the server /hosting service enforces). Will this actually address the issue? Is there another reliable resolution?
  13. Some time ago I was playing with PHP code to minimize the size of images. My primary purpose was to reduce the file size so that uploading would be quicker and thereby encounter fewer instances of exceeding the upload limits of the hosting server. It recently occurred to me that this was a futile exercise because once PHP was involved, the files at full size had already engaged with the server. Am I correct in my assumption? Is there a reliable way to approach what I had initially intended?
  14. I was asked to create a form and database system for a local entrepreneur and need some business advice and acceptable practices input. From the technical side, I'm concerned about keeping my intellectual property secure and private. If I allow the 'customer' to have access to the files I create, I may not be needed long term. How can I maintain control over the code that I write? And the database that it populates? From a business standpoint, are there generally accepted guidelines for ownership of intellectual property? I also have questions regarding compensation. Is there a ballpark of generality based on hours invested or (USA) dollars for such an endeavor or it's pieces?
  15. Looks like requinix responded while I was considering my answer, which would be a YES. ITEM 1 is easy enough. ITEM 2 would require some research (for me, anyway) but should be do-able since PHP can go to a directory and find the file you want to use. ITEM 3 can also be done. I forget the methodology, but I did create a page that allowed me to download files from <a> links; a few modifications and your requirements would be met. As for wanting to NOT have the file on the server, did you want PHP to write the script and ZIP it every time it's needed? I suppose it could be done, but a cumbersome way of making sure nobody sees the script on the server, yet they can grab it through the browser.
×
×
  • 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.