-
Posts
922 -
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
6,968 profile views
phppup's Achievements
-
Correct. No database involved. The array is generated from other PHP coding.
-
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?
-
@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?
-
@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?
-
@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?
-
@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?
-
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?
-
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?
-
Download a dynamically made file as part of ajax
phppup replied to M.O.S. Studios's topic in PHP Coding Help
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. -
I agree with @gizmola Additionally though, a 404 error refers to a "resource requested could not be found on this server," so I would question whether you have the correct path to the data you are trying to upload. if you do, then I might suggest attempting to upload in smaller segments based on file size and see if any success occurs.
-
I'm assuming some of this is a bit of shorthand for IF clauses. It offers a new logic approach, so I'll give it a shot. Thanks.
-
Envision this: IVs can be used to replace pills, but are more expensive than pills. Pills can be used to replace syrup, but are more expensive than syrup. Ideally, each room has a supply of 2 IVs, 4 pills, and 8 syrup. However, if an item falls below a threshold, it may indicate a supply shortage and therefore triggers a bulk-up of the higher teir item for an overstocking response (with a ceiling for the next cycle). Due to budget, only one overstock event of 10 units per room is allowed per cycle. Given these parameters, room 1 with 2 IVs and 4 pills would order no IVs or pills. However, once the syrup deficit is realized, the pill order needs to shift to 10 for overstock. No syrup is ordered due to budget, but a notification is sent to the procurement team. Hence, pills is reliant on "looking ahead" at syrup. Room 0 has one of 2 IVs. With that assessment, an order of 1 would be expected. But bc pills is below 4, an overstock is triggered for 10 IVs for room 0. Nothing else will be ordered for room 0 in this cycle. This is why there is a need to "see forward" in the array.
-
I'm trying to "see ahead" in my associative array This hypothetical is the simplest way to describe what I'm trying to accomplish. I have an array that looks like this $arr = [ 0 => ["meds" => [ "IV" => 1, "pill" => 2, "syrup" = 3] ], 1 => ["meds" => [ "IV" => 2, "pill" => 4, "syrup" = 6] ], 2 => ["meds" => [ "IV" => 5, "pill" => 5, "syrup" = 5] ] ]; We have 3 rooms for patients that each contain the designated medication types. Using foreach() I can successfully run through the array. Example: if IV quantity is less than 3, create a message to order the amount that will bring inventory up to 3. Obviously this can be done uniformly. My problem: I want to "reach ahead" to affect a current element. Ex: while processing the order for IVs, if pills are less than 10 then do something (double the order, print in red) to IVs. Likewise, if pills are needed, do something, but do something more based on syrup. I've fumbled the idea of creating a new array and flipping the contents around, but nothing seems to be resolving my issue.
-
@requinix i stubbornly gave the DOM some research. I got some strange responses so first, but then discovered how (hate to admit it) easy and effective it is. Some insight into is workings might be helpful now. I initially engaged DOM with some "broken" HTML that had already been a little mangled by stripos and offset cuts. When I re-oriented it by <p> it "repaired" my chopped-up <h2> lines. Is this a built-in benefit? How? Eventually I ran the DOM code properly and can see it's effectiveness. I guess at this point it's just a matter of signing the correct loops to gather and distribute the data as I desire. Right? So, are the ole days of stripos and string contents now antiquated? Thanks for the help.
-
Late night and lacking sleep is no time to mingle with stripos. I was playing with some sloppy code and I could use a hand to get it of my mind. Here are the essentials of what I have //a string of HTML to throw into a variable $page ="<h2> item 1 </h2> <p> day </p> <p> time </p> <h2> item 2 </h2> <p> day </p> <p> time </p> <h2> item 3 </h2> <p> day </p> <p> time </p>"; $start = stripos($page, 'h2'); $end = stripos($page, '/h2'); $len = $end - $srart$html_section = $find = substr($page, $start, $len); This worked to get me item 1 However, I'd like to loop through and get the other items too, and eventually the <p> elements also. I am trying to stay within the PHP structure. I was considering a while loop that would increase the pos of the next progressive $start by adding the $len of the previous effort, but I couldn't remember the correct methodology. Guidance and input please.