<?xml version="1.0"?>
<rss version="2.0"><channel><title>Application Design Latest Topics</title><link>https://forums.phpfreaks.com/forum/42-application-design/</link><description>Application Design Latest Topics</description><language>en</language><item><title>Mobile device PHP file caching</title><link>https://forums.phpfreaks.com/topic/327418-mobile-device-php-file-caching/</link><description><![CDATA[<p>
	Hello - sincerely hoping someone out there will be able to help with this, or at least have a good idea on what's going on.
</p>

<p>
	I have created a 'Single Page Application' (SPA) type website, and have used PHP on the server-side.  At present, nearly all my content files (XML, JPEGs, XSLT, CSS) are generated from PHP scripts.
</p>

<p>
	My design uses many source files, and some pages have many small images, so file caching by the client browser is very important.  I have set HTTP Cache-Control response headers on everything, to inform the browser that it can and should cache everything.  (Content changes get picked up when a version number changes in the URL.)  So far, so good - or so I thought.
</p>

<p>
	My problem is that both Safari and Chrome on iOS do fresh requests of EVERYTHING that's come from PHP, every time the user opens the phone from screen-lock.  So the site is fast and slick with everything loaded into cache, until a 20 second pause with the phone locked, and then everything is dog slow again the first time content is viewed.  For my use-case, this is a huge usability (and server load) problem.
</p>

<p>
	I've noticed that this refreshing of content DOESN'T happen for regular static files.  (I have a folder of static file PNG images, and these never get re-requested.)  How can I make all the PHP-generated content appear to the browser to be static files, so that the browser's heuristics don't mistrust them and assume they will be changing despite the HTTP headers?????!
</p>

<p>
	I can't believe I'm having this problem, honestly. Never seen anything like it before, with browsers ignoring these Cache-Control directives.  There's something really messed up with the logic on mobile devices....
</p>
]]></description><guid isPermaLink="false">327418</guid><pubDate>Fri, 18 Apr 2025 09:26:12 +0000</pubDate></item><item><title>Check sudoku solution (Java)</title><link>https://forums.phpfreaks.com/topic/324840-check-sudoku-solution-java/</link><description><![CDATA[<p>
	How'd you do it? Let's hear feedback.
</p>
]]></description><guid isPermaLink="false">324840</guid><pubDate>Mon, 14 Oct 2024 09:36:23 +0000</pubDate></item><item><title>Creating dynamic workflow</title><link>https://forums.phpfreaks.com/topic/320997-creating-dynamic-workflow/</link><description><![CDATA[<p>
	Hi All,
</p>

<p>
	I am building a system where users can apply to attend events.  When they do so they use a portal to make their application which is then submitted to the back end to be administered.
</p>

<p>
	I really need some help designing this from a functionality point of view and from a "how it looks" point of view.  I am using bootstrap.
</p>

<p>
	The idea is that the back end user can create a custom workflow allowing for as many approval stages as they require.
</p>

<p>
	A very basic example would be
</p>

<table border="1" cellpadding="1" cellspacing="1" style="width:500px;"><tbody><tr><td>
				Stage
			</td>
			<td>
				Comments
			</td>
		</tr><tr><td>
				Draft
			</td>
			<td>
				User savded without passing validation
			</td>
		</tr><tr><td>
				Submitted
			</td>
			<td>
				User passed validation and has done all that they needed to do
			</td>
		</tr><tr><td>
				Accepted/Approvded
			</td>
			<td>
				The back end user has OK'd the submission
			</td>
		</tr><tr><td>
				Rejected/Declined
			</td>
			<td>
				The back end user has said no to the application
			</td>
		</tr><tr><td>
				 
			</td>
			<td>
				 
			</td>
		</tr><tr><td>
				 
			</td>
			<td>
				 
			</td>
		</tr><tr><td>
				 
			</td>
			<td>
				 
			</td>
		</tr><tr><td>
				 
			</td>
			<td>
				 
			</td>
		</tr><tr><td>
				 
			</td>
			<td>
				 
			</td>
		</tr></tbody></table><p>
	All of these stages will eventually trigger actions such as sending emails.
</p>

<p>
	The complexity that i have is that i want the back end user to be able to add their own stages.
</p>

<p>
	An example of this could be a 2 stage approval process.  There could be another stage after approval such as security check, where someone else has a look at the data and approves it.<br /><br />
	i am struggling to build the interface where the journey is defined - the stages that will be used are defined elsewhere.
</p>

<p>
	There is a lot that i am not sure about and no doubt more and more will come up as we work throught it.  I will provide any code that is wanted here to help or even allow you to log into the application if i have worked with you before and you think that will help - of course i dont expect you to do that, this is not your job, but if it helps and youre interested.
</p>

<p>
	This may not be enough information but should give you an idea of what i am trying to achieve.  I will be more than happy to provide more context where required.
</p>

<p>
	 
</p>

<p>
	Thanks As Always
</p>
]]></description><guid isPermaLink="false">320997</guid><pubDate>Fri, 24 May 2024 15:48:58 +0000</pubDate></item><item><title>Feedback on Data model for Cinema ticket booking system</title><link>https://forums.phpfreaks.com/topic/317596-feedback-on-data-model-for-cinema-ticket-booking-system/</link><description><![CDATA[<p>
	Hey Guys,
</p>

<p>
	Just looking for some feedback/critique on this data model. It's for a cinema booking system. Main thing I'm concerned about is that (I think) I won't be able to reuse seats. So I'm worried I haven't got my data model correct in the sense that I can reuse seats across different movies/days/screenings. (But I may have, but I have a lingering doubt) So I got this feeling in the <strong>seat </strong>entity:
</p>

<p>
	Seat Id        ScreenID       Row      Number     Status
</p>

<p>
	1                    4                   A             1               booked
</p>

<p>
	So say ScreenId 4 relates to screen number 4, and seat A1 gets booked, is that it - has A1 gone forever or am I able to release the seat for the next showing in the same screen id
</p>

<p>
	Other options for Status are: Available and reserved.
</p>

<p>
	Or is it just a simple case of changing the status from booked to available after the movie finishes?<br />
	Any feedback would be welcome.
</p>

<p>
	Thanks
</p>

<p>
	<a class="ipsAttachLink ipsAttachLink_image" href="https://forums.phpfreaks.com/uploads/monthly_2024_01/movie.jpg.b1f6189a41229e660afe2568d96ed91a.jpg" data-fileid="8538" data-fileext="jpg" rel=""><img alt="movie.jpg" class="ipsImage ipsImage_thumbnailed" data-fileid="8538" data-ratio="78.34" width="831" src="https://forums.phpfreaks.com/uploads/monthly_2024_01/movie.jpg.b1f6189a41229e660afe2568d96ed91a.jpg" /></a>
</p>
]]></description><guid isPermaLink="false">317596</guid><pubDate>Tue, 02 Jan 2024 17:08:52 +0000</pubDate></item><item><title>Really confused and stuck on web application design of a random chat app (Help appreciated!)</title><link>https://forums.phpfreaks.com/topic/317406-really-confused-and-stuck-on-web-application-design-of-a-random-chat-app-help-appreciated/</link><description><![CDATA[<p>
	Hi Forum,
</p>

<p>
	I'm building a random chat application. So far, it works great. Here's the problem though. It only works for 2 simultaneously connected users.
</p>

<p>
	As soon as I have 3 users trying to connect to the "swarm" to get a random chat assignment, well, all calamity ensures. Essentially, the random room assignments then malfunction, creating a terrible user experience.
</p>

<p>
	Essentially, I'm struggling to manage state for multiple connected users in a LAMP environment. I'm using Ably websockets and the PHP SDK for messages, and a few other APIs for video/chat. In addition, I'm using AJAX callbacks in jQuery.
</p>

<p>
	I'm also (as an experiment) using PHP Memcached. I thought it would be simple enough to use it to manage the state of all users across the application using Memcached, but it's harder than I thought. I'm also using the standard php_sessions to manage whether the user is logged in (and authorized to chat) or not.
</p>

<p>
	I realize PHP is perhaps not the ideal language/stack for something like this, perhaps something asynchronous would be better. But it's what I got and am trying to make it work, I don't have time to refactor everything and learn something new.
</p>

<p>
	So my question is how the heck do I do this? Here's the crux of the issue. Suppose:
</p>

<ul><li>
		There's 3 users trying to connect simultaneously for a random chat.
	</li>
	<li>
		User 1 immediately gets paired with user 2, and user 3 should simply wait until patiently until there's another user that joins the swarm.
	</li>
	<li>
		The issue is user 1, 2, and 3 are currently all being assigned to a room, that can only hold 2 users at maximum.
	</li>
</ul><p>
	I know it sounds awfully simple to manage a swarm of users like this concurrently, but it's not in my experience in part because:
</p>

<ul><li>
		When users connect, they need to connect quickly in say 1-2 or 3 seconds maximum, otherwise people may leave the application or no longer be interested or no longer have internet connectivity. This means a way to check and re-check the user's internet connectivity. Currently I'm using an AJAX callback to the server to do this, which then responds with a RoomID to the users.
	</li>
	<li>
		The issue is the server can't tell whether the user doing the callback is user 1 or user 2, or even user 3. It all responds similarly. I've tried to solve this with Memcached by storing an array of all user's requests in the past 5 seconds, and referencing it with the current user. This might be a viable approach, but I'm seeking some guidance from the community before I continue down that rabbit hole. 
	</li>
</ul><p>
	I'm probably thinking about this wrongly in some way. But in your opinion, how would you most simply, and most robustly manage state for a swarm of connected users, using AJAX callbacks of a swarm of users? Websockets are a possibility as well, but only publicly broadcasting to all connected users via a REST API. I don't have access to private channels or connected user lists currently. 
</p>

<p>
	Thanks for any help/suggestions!
</p>

<p>
	 
</p>

<p>
	 
</p>
]]></description><guid isPermaLink="false">317406</guid><pubDate>Wed, 01 Nov 2023 09:05:31 +0000</pubDate></item><item><title>Setting up an account on Web app</title><link>https://forums.phpfreaks.com/topic/317325-setting-up-an-account-on-web-app/</link><description><![CDATA[<p>
	Hello guys.
</p>

<p>
	I really don't know what to use as a topic and my question might no be clear enough cos I might lack adequate words to put it together but I will try by using examples anyhow.
</p>

<p>
	My question is
</p>

<p>
	Like during joomla or WordPress installation, the processes one has to undergo e.g filling the company/application name, database name, admin username and password, color scheme etc. 
</p>

<p>
	In like manner, one has a web app hosted. How to enable different user create their own account and setup their database etc
</p>

<p>
	For example I have a web app hosted at <a href="https://myapp.com" rel="external nofollow">https://myapp.com</a>
</p>

<p>
	A user can setup their shop on my app <a href="https://myapp.com/shop1" rel="external nofollow">https://myapp.com/shop1</a> or shop1.myapp.com
</p>

<p>
	Hope I tried to make it clear enough
</p>

<p>
	Thanks
</p>
]]></description><guid isPermaLink="false">317325</guid><pubDate>Wed, 27 Sep 2023 04:55:27 +0000</pubDate></item><item><title>Digital Certificate Validation</title><link>https://forums.phpfreaks.com/topic/317266-digital-certificate-validation/</link><description><![CDATA[<p>
	Hello:
</p>

<p>
	 
</p>

<p>
	I have to create a web page where users can access, by validation, using different types of digital certificate.
</p>

<p>
	The webpage must request which type of certificate user want to use.
</p>

<p>
	I need to create this validation system using php. Anyone knows how to build it?
</p>

<p>
	Is there any documentaion where it's detailed how to do it?
</p>

<p>
	 
</p>

<p>
	Thank you very much.
</p>

<p>
	 
</p>

<p>
	Francesc
</p>
]]></description><guid isPermaLink="false">317266</guid><pubDate>Fri, 08 Sep 2023 07:53:34 +0000</pubDate></item><item><title>Stuck on my next step for quiz app</title><link>https://forums.phpfreaks.com/topic/316159-stuck-on-my-next-step-for-quiz-app/</link><description><![CDATA[<p>
	Hey guys,
</p>

<p>
	I've been developing this app for over a month now and I just sort of built it as I went along with no real design or specifications (apart from an ERD). I knew what I wanted but sort of used an ad-hoc manner in development. Now I have got to a stage where I'm not sure what my next step is.
</p>

<p>
	The app I am building is a quiz, loosely based on this quiz: <a href="https://www.bbc.co.uk/news/world-64825206" rel="external nofollow">https://www.bbc.co.uk/news/world-64825206</a>
</p>

<p>
	What I want is when the URL is loaded, to show the quiz Container with a "Start" Button. So a blank grey box with a "Start" Button. When the start button is pressed, then the first question comes up. Then if you visit the link above you will understand the next part. 
</p>

<p>
	You see there is 3 choices, but mine will be 4 and you get the DOM scripting effect when You choose the correct answer and it goes green. Then you get green tick with a "Correct!". But I don't want the extra text underneath  to explain why the answer was right (or wrong) 
</p>

<p>
	But if you choose the wrong answer, you get a red X with "Wrong!" and then the correct answer goes green. But I don't want the percentages of how many people chose the choice. And then if you get the answer right or wrong, it will display a "Next" button to move onto the next question. I want the Next button done in AJAX so it loads in the quiz container without reloading the page. 
</p>

<p>
	Then you get 1 point for one correct answer and at the end of the quiz you get your total amount based on how many you got right. 
</p>

<p>
	That's about it. 
</p>

<p>
	My home page looks like this at the moment: (e.g www.domain.com/index.php) 
</p>

<p>
	<a class="ipsAttachLink ipsAttachLink_image" href="https://forums.phpfreaks.com/uploads/monthly_2023_04/homepage.png.6ec5c3aecbdd57e9c657cbccf34ca11c.png" data-fileid="8019" data-fileext="png" rel=""><img class="ipsImage ipsImage_thumbnailed" data-fileid="8019" data-ratio="49.70" width="1000" alt="homepage.thumb.png.32c74813d1dd00215eb82130fe14ff5b.png" src="https://forums.phpfreaks.com/uploads/monthly_2023_04/homepage.thumb.png.32c74813d1dd00215eb82130fe14ff5b.png" /></a>
</p>

<p>
	Now obviously it says "Question does not exist" because I changed the quiz to use GET to scroll through the questions. obviously if I add 
</p>

<pre class="ipsCode prettyprint lang-html prettyprinted"><span class="pln">?question=1</span></pre>

<p>
	to the end of the URL it will display question 1.
</p>

<p>
	Here is what the questions look like:
</p>

<p>
	<a class="ipsAttachLink ipsAttachLink_image" href="https://forums.phpfreaks.com/uploads/monthly_2023_04/quiz_ss.jpg.3a61d31b68a7f6074361fc9eab0e413c.jpg" data-fileid="8020" data-fileext="jpg" rel=""><img class="ipsImage ipsImage_thumbnailed" data-fileid="8020" data-ratio="64.80" width="1000" alt="quiz_ss.thumb.jpg.cc3e05287545476d67540e898027702e.jpg" src="https://forums.phpfreaks.com/uploads/monthly_2023_04/quiz_ss.thumb.jpg.cc3e05287545476d67540e898027702e.jpg" /></a>
</p>

<p>
	 
</p>

<p>
	Sorry for the long post but I'm really stuck on my next move. I have a bad feeling I've been developing the app the wrong way round.
</p>

<p>
	Many thanks
</p>
]]></description><guid isPermaLink="false">316159</guid><pubDate>Wed, 19 Apr 2023 16:49:54 +0000</pubDate></item><item><title>Creating a Quiz in PHP/PDO - help with ERD</title><link>https://forums.phpfreaks.com/topic/316098-creating-a-quiz-in-phppdo-help-with-erd/</link><description><![CDATA[<p>
	Hey guys,
</p>

<p>
	Just a quick one. I would like some advice. I am making a quiz in PHP. I have the following db design and the <strong>image </strong>attribute is inside the <strong>questions </strong>table. This attribute will hold the file name of an image (e.g movie_poster.jpg). But later on I thought to take out that attribute from that table and have a new entity called <strong>pictures </strong>and hold the filenames in there. Surely that would be a better idea? If I don't, I don't think it will conform to Normalisation. 
</p>

<p>
	Here is the ERD:
</p>

<p>
	Many thanks
</p>

<p><a href="https://forums.phpfreaks.com/uploads/monthly_2023_04/erd.jpg.23c1213a6e021ce11700083fd7d6c347.jpg" class="ipsAttachLink ipsAttachLink_image" ><img data-fileid="7980" src="https://forums.phpfreaks.com/uploads/monthly_2023_04/erd.thumb.jpg.96af4f3fb5895dee3907d0ea507fff93.jpg" data-ratio="46.6" width="1000" class="ipsImage ipsImage_thumbnailed" alt="erd.jpg"></a></p>]]></description><guid isPermaLink="false">316098</guid><pubDate>Fri, 07 Apr 2023 11:53:33 +0000</pubDate></item><item><title>numbers and math driven websites</title><link>https://forums.phpfreaks.com/topic/315974-numbers-and-math-driven-websites/</link><description><![CDATA[<p>
	Hello everyone,
</p>

<p>
	i recently played with some code which uses a number delimited hyperlink reference to traverse the weeks of a year. Please see this thread to follow along with my question. Honestly, run my code in xampp to make the picture clearer if it isn't clear enough.
</p>

<p>
	link to my code example: 
</p>
<iframe allowfullscreen="" data-controller="core.front.core.autosizeiframe" data-embedauthorid="208559" data-embedcontent="" data-embedid="embed573597845" src="https://forums.phpfreaks.com/topic/315939-previous-and-next-button-based-on-week-id/?do=embed&amp;comment=1606193&amp;embedComment=1606193&amp;embedDo=findComment#comment-1606193" style="height:298px;max-width:502px;"></iframe>

<p>
	imagine that clicking through the numbers 1 to 52 loaded 52 different webpages from a site. One could traverse the content of an entire website with one navigation system. Then i realize that we already play this numbers game: zipcode, street address (also has a string name). So when i imagine php pages named using numbers instead of words, such as 110 for index page of the domain, i realize how easily we could use math formulas and statistics to quickly add power to our web apps. I started jotting down some ideas but i wonder if this concept is already being used behind the scenes. I really wonder if it is the engine to sites like Google. The url string names are just string representations of the actual number system used to design the app and its pages. As it stands, i've always been influenced to name my pages with language strings (index.php, news.php, shinynewproducts.php, et cetera)
</p>

<p>
	i hate the idea of trying to develop my own system when one may already exist. I just cannot find examples of such a system. I imagine that math could be used to traverse a category by range with previous and next buttons et cetera. random pages would be easier to load. The ideas are endless when we switch from language and strings to numbers.
</p>

<p>
	I wonder if anyone has some links to material covering this subject? i cannot find the right search words in Google...
</p>

<p>
	 
</p>
]]></description><guid isPermaLink="false">315974</guid><pubDate>Fri, 03 Mar 2023 21:52:31 +0000</pubDate></item><item><title>API/function to read number of words in .doc, .xlsx, .pptx and PDF files</title><link>https://forums.phpfreaks.com/topic/315900-apifunction-to-read-number-of-words-in-doc-xlsx-pptx-and-pdf-files/</link><description><![CDATA[<p>
	Hi, have you heard of any APIs or modules/libraries/functions that would allow me to easily count the total number of words in a bunch of Microsoft Office files uploaded to the server? Word, Excel and PowerPoint.<br />
	Plus PDFs, if possible.
</p>
]]></description><guid isPermaLink="false">315900</guid><pubDate>Wed, 08 Feb 2023 19:36:32 +0000</pubDate></item><item><title>I want to simulate social network activity. How to approach the problem?</title><link>https://forums.phpfreaks.com/topic/315430-i-want-to-simulate-social-network-activity-how-to-approach-the-problem/</link><description><![CDATA[<p>
	I'm a PHP dev, and I have been doing that for 10 years. I want to challenge myself and simulate social network activity, for example, something simple: liking posts and following people. For this example let's take a case where I have 100 generated ("fake") users and 1 real user (me).
</p>

<p>
	I was thinking about 2 possible approaches:
</p>

<p>
	<strong>1st approach</strong>
</p>

<p>
	I act on behalf of generated users. For example real user posts a picture:
</p>

<p>
	- Event is dispatched
</p>

<p>
	- code takes random 80 users and assigns them as followers
</p>

<p>
	- code takes random 50 users and assign them as they like the picture
</p>

<p>
	That is a pretty straightforward approach, where code takes actions based on events (pic posted, user registered) and assign fake users to certain actions. I could use queues and workers on the server to approach this.
</p>

<p>
	<strong>2nd approach</strong>
</p>

<p>
	Each fake user acts as a real user. So in my case it would be 100 users but each user programmatically acts as a real user. That would mean that I would need to have 1 worker for each fake user, and then trigger user on every event that happens, like: user registered, user posted a pic and so on.
</p>

<p>
	<strong>My thoughts</strong>
</p>

<p>
	For example event is "user registered" and that event is distributed:
</p>

<p>
	1st approach: I assign X number of users to be followers<br />
	2nd approach: each fake user "decides" (it can be random decision true/false) to follow a user or not
</p>

<p>
	2nd approach seems more natural and more user based vs 1st approach where I just manipulate with fake users and assign them actions. I know AI would be great for it, I'm opened for that suggestions also. RIght now I'm just trying to figure out how to approach the problem and what would be possible solutions.
</p>

<p>
	What worries me is how do I make each fake user to react to events, that means each user needs to be ran as a new process?
</p>
]]></description><guid isPermaLink="false">315430</guid><pubDate>Mon, 17 Oct 2022 09:22:30 +0000</pubDate></item><item><title>Avoid multi directory structure for userbase</title><link>https://forums.phpfreaks.com/topic/315291-avoid-multi-directory-structure-for-userbase/</link><description><![CDATA[<p>
	So, right now, I'm working with a project that can potentially have thousands of users logging into it.  At this time, it is simply in development, maybe 3 users at the moment.  Regardless, the goal is to give users access to an online file editor, and in this editor, they can only see and edit their own files and folders.  No one else's.
</p>

<p>
	The issue at hand, is I'm trying to (I want to) avoid having to create a subdirectory for every user registered.  However, I'm having a hard time wrapping my head around an idea and infrastructure for organizing something like this.  My first thought was to use a virtual host, but that would still entail have a directory for every single user, and having that many subfolders to maintain would be a nightmare.  What if the configuration files' structure has to be changed?  Then, a script would need to run to loop through each and every user's subdirectory to update that configuration file.  Of course, I suppose there could be a single config file that all user's are tied to.
</p>

<p>
	I realize there isn't a one shoe fits all for this design, but I know this isn't the first project in the world to have this problem.  I'm making every effort possible to keep scalability in mind.
</p>

<p>
	**These will not be Linux users or even Windows users, they will be entries in a users table in a MySQL database; just your run-of-the-mill CMS.  Surely Wordpress/Github/Blogpost/etc don't create a new subfolder for every user registered?
</p>

<p>
	Ideally, at the surface, it would appear that each user has their own directory, but behind the scenes there would be a system in place that is only rewriting the URL to appear that way.
</p>

<pre class="ipsCode" id="ips_uid_3820_9">www.website.com/user1
www.website.com/user2
and so on.
</pre>

<p>
	 
</p>

<p>
	When in reality, the actual URLs before being rewritten might be
</p>

<pre class="ipsCode" id="ips_uid_3820_7">www.website.com?uid=123
www.website.com?uid=4833
and so on...</pre>

<p>
	 
</p>

<p>
	Although I'm aware of how to setup something like that, I'm just not convinced is the most efficient solution.  As it is, users will have their how row in the users table in the MySQL database, and there would most likely a be a table for files and folders with a foreign key for the user_id found in the user table.  (I haven't taken into account the possibility of groups yet, that would be down the road). 
</p>

<p>
	Anyway, I'm just curious as to what kind of solutions people may or may have not  designed into their current systems that address the ability to avoid thousands of subfolders for thousands of users..   Please let me know if I need to provide more details.  As I have posted this in the Application Design forum, this is mostly a theory based question.  I'm not expecting a concrete copy and paste solution.  I just need to warp my head around a potential solution and how I could make it work.
</p>
]]></description><guid isPermaLink="false">315291</guid><pubDate>Wed, 07 Sep 2022 13:52:24 +0000</pubDate></item><item><title>Can search engines crawl content of .php files?</title><link>https://forums.phpfreaks.com/topic/315065-can-search-engines-crawl-content-of-php-files/</link><description><![CDATA[<p>
	In my site, I used build my own content management system and all menus and related files created by php. All of my pages have .php extension. I used queries to get them(i.e. index.php?page=...&amp;blog=...subblog=... etc.) When user clicked the related blog/subblog page from the menu, I use <strong>include function for </strong>page and put it in <strong>index.php</strong>. So all of them shown in index.php, not their seperate links. I created correct sitemap.xml showing each page correctly.
</p>

<p>
	So does such structure prevents search engines to crawl their content? Thanks.
</p>
]]></description><guid isPermaLink="false">315065</guid><pubDate>Wed, 20 Jul 2022 16:45:47 +0000</pubDate></item><item><title>ERD for a php function that generates a invoice</title><link>https://forums.phpfreaks.com/topic/314790-erd-for-a-php-function-that-generates-a-invoice/</link><description><![CDATA[<p>
	Hi,
</p>

<p>
	I've created a database design and I would like some input from other members on it. I don't think I've done it correctly as <strong>pType </strong>is stored twice, once in <strong>Products </strong>&amp; again in <strong>productType. </strong>I'm also not sure if I have the multiplicity correct. This ERD is intentionally simple. I did not want to have different model numbers, colours etc. Having said that, any feedback is welcome. I just wanted to keep it simple as the ultimate goal was to generate an invoice , within a function , in PHP. The invoice is similar to the invoices generated by ebay. Any feedback is welcome.
</p>

<p>
	Thanks
</p>

<p>
	 
</p>

<p>
	 
</p>

<p>
	<a class="ipsAttachLink ipsAttachLink_image" href="https://forums.phpfreaks.com/uploads/monthly_2022_05/edi-with-relationships.jpg.505183f27d9228176b80417f792c16fb.jpg" data-fileid="7158" data-fileext="jpg" rel=""><img alt="edi-with-relationships.jpg" class="ipsImage ipsImage_thumbnailed" data-fileid="7158" data-ratio="61.6" width="1000" src="https://forums.phpfreaks.com/uploads/monthly_2022_05/edi-with-relationships.thumb.jpg.ab51bf3985a234a87b6e5e24593cc82f.jpg" /></a>
</p>
]]></description><guid isPermaLink="false">314790</guid><pubDate>Sat, 14 May 2022 17:05:33 +0000</pubDate></item><item><title>changelog example</title><link>https://forums.phpfreaks.com/topic/314784-changelog-example/</link><description><![CDATA[<p>
	<a href="https://www.freecodecamp.org/news/content/images/2020/07/generate-changelog-example.png" rel="external nofollow">https://www.freecodecamp.org/news/content/images/2020/07/generate-changelog-example.png</a><br /><br />
	What do those strings mean at the end of each line (68701efb, be6a6d80, c8d985a0, etc)?
</p>
]]></description><guid isPermaLink="false">314784</guid><pubDate>Thu, 12 May 2022 14:48:06 +0000</pubDate></item><item><title><![CDATA[MySQL -> MySQLi or -> PDO]]></title><link>https://forums.phpfreaks.com/topic/314093-mysql-mysqli-or-pdo/</link><description><![CDATA[<p>
	I have a large app that I need to change over.  At first I was thinking MySQLi, but now I'm thinking PDO.  PHP has been evolving into a real programming language.  I'm starting to think that MySQLi has been the stepping stone to OOP database access, and PDO with OOP and its universal database access methods as the destination to implement a single code base for all DBMS access, and MySQLi being discouraged.  Why would you want to change code to change a database, and why as a developer would you want to remain proficient in multiple code bases to access data?  I haven't worked with PDO in PHP.  Can anyone think of a reason why I wouldn't want to go PDO?
</p>
]]></description><guid isPermaLink="false">314093</guid><pubDate>Sat, 23 Oct 2021 22:23:48 +0000</pubDate></item><item><title>Hello World</title><link>https://forums.phpfreaks.com/topic/313629-hello-world/</link><description><![CDATA[
<p>
	Hello guys,
</p>

<p>
	 
</p>

<p>
	I am building a streaming site.
</p>

<p>
	I would need an algo to have the films I want on my site.
</p>

<p>
	How do the sites manage to have +5000 thousand films?
</p>

<p>
	Ideally I would like to make a profit with advertising, but not only. There are host services that pay based on X views.
</p>

<p>
	Do you have an algorithm that allows you to decuperate the torrent or others?
</p>
]]></description><guid isPermaLink="false">313629</guid><pubDate>Tue, 31 Aug 2021 06:31:39 +0000</pubDate></item><item><title>Beatport like Audioplayer, need help!</title><link>https://forums.phpfreaks.com/topic/313592-beatport-like-audioplayer-need-help/</link><description><![CDATA[
<p>
	Inspired by beatport.com i built an audio player with waveform illustration using wavesurfer-js.org<br />
	Check it out here: <a href="http://gearscript.de/wavesurfer" rel="external nofollow">http://gearscript.de/wavesurfer</a><br />
	Just click "Load into Player" and surf the website for a bit, it pretty much explains itself.
</p>

<p>
	<strong>The Problem:</strong>
</p>

<p>
	My cms works like this
</p>

<pre class="ipsCode">site1.php
site2.php
site3.php
global.php (included in all siteX.php, contains site header and other global code)
</pre>

<p>
	The Problem is, if the user jumps from site1.php to site2.php i do not want the player to interrupt but keep playing the music. Just like on beatport.<br />
	In my example i did that by using an iframe.<br />
	But i cant use an iframe in my cms application because i want the player to interact with the cms and its just a lousy solution overall.<br />
	I do not want to use a popup also because that would negatively impact the "user experience".
</p>

<p>
	So what do i do?<br />
	I never did something like this before and i just dont know what to do.
</p>

<p>
	 
</p>
]]></description><guid isPermaLink="false">313592</guid><pubDate>Tue, 24 Aug 2021 01:00:53 +0000</pubDate></item><item><title>Delivery App like foodpanda technology</title><link>https://forums.phpfreaks.com/topic/313566-delivery-app-like-foodpanda-technology/</link><description><![CDATA[
<p>
	I am planing to develop a Delivery App like foodpanda, from starting I think the customer not too much but I want to know the technology for it that we can upgrade it after the customer increase
</p>
]]></description><guid isPermaLink="false">313566</guid><pubDate>Tue, 17 Aug 2021 15:12:25 +0000</pubDate></item><item><title>One POS software for many customers, design database</title><link>https://forums.phpfreaks.com/topic/313529-one-pos-software-for-many-customers-design-database/</link><description><![CDATA[
<p>
	Dear friends.
</p>

<p>
	As I would like to create a software like POS on web application.
</p>

<p>
	my question is:
</p>

<p>
	1. Should I create only one Database for all customers?
</p>

<p>
	2. in case I have only one Database, How can I saperate the customer information? by field or table name?
</p>

<p>
	3. if I have new customer. I need to create new table or information for them?
</p>
]]></description><guid isPermaLink="false">313529</guid><pubDate>Wed, 11 Aug 2021 06:47:41 +0000</pubDate></item><item><title>Password authentication</title><link>https://forums.phpfreaks.com/topic/312292-password-authentication/</link><description><![CDATA[
<p>
	Hey everyone,
</p>

<p>
	 
</p>

<p>
	I’m working on an app for my local intranet sever. My security needs are almost non existent, because it’s only accessible on my local network. Even if someone wanted to mess with it, the only thing this app controls is my fish tank! Yup, it just shows me some information about my water, and let’s me turn on and off devices. So I’m not too worried about it.
</p>

<p>
	That being said, I want to add a password just to keep my coding skills sharp, as I haven’t done anything with php in a while. That being said, I would like some help understanding something...
</p>

<p>
	while looking up the best practices for working with passwords, I found password_hash and password_verify...
</p>

<p>
	 
</p>

<p>
	don’t these two function completely negate the advantages of salting a password?
</p>

<p>
	my understanding is that salting a password makes using a rainbow table impossible. However, what’s stopping someone from just doing a dictionary attack with the password_verify function?
</p>

<p>
	as I said above, my application doesn’t require a lot of security, I’m asking for educational reasons
</p>
]]></description><guid isPermaLink="false">312292</guid><pubDate>Sat, 13 Mar 2021 18:55:18 +0000</pubDate></item><item><title>database design help</title><link>https://forums.phpfreaks.com/topic/310607-database-design-help/</link><description><![CDATA[
<p>
	I want to create a database for my person use. I am the treasurer for an HOA. I collect money for 14 units monthly. I currently use a spreadsheet but I figured it would be a great learning experience to try creating a database. ( very little skill ). I want to be able to select a unit and see how much is owed, when the last payment was made and any other notes needed. I can't decide how I should make it. Should I just make a plain database with simple records like a spreadsheet or make it more complicated? by simple, I was thinking one table.
</p>

<p>
	ID, name, address ( a four digit number ) , paid ( bool ), amount_paid, date, notes
</p>

<p>
	I have toyed with the idea of making it more tables but I don't know if it is needed.
</p>

<p>
	The idea is that I want the ability to select a unit number ( address ) and see what is owed up to the current date. If I have a unit that hasn't paid in a year, I want to be able to see that and the months owed. if they pay half of the amount, I want to be able to do the math on that and see that.
</p>

<p>
	I am trying to figure out if a one table database will work just fine.
</p>
]]></description><guid isPermaLink="false">310607</guid><pubDate>Sat, 18 Apr 2020 01:04:23 +0000</pubDate></item><item><title>Wrapping external class</title><link>https://forums.phpfreaks.com/topic/310428-wrapping-external-class/</link><description><![CDATA[
<p>
	Hi guys! I have a specific requirement and need some help
</p>

<p>
	Say i have an external api library with Client class looking like this:
</p>

<pre class="ipsCode prettyprint lang-php prettyprinted">
<span class="kwd">class</span><span class="pln"> </span><span class="typ">Client</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
	some constants</span><span class="pun">..</span><span class="pln">
	</span><span class="kwd">private</span><span class="pln"> props</span><span class="pun">..,</span><span class="pln">

	__construct

	</span><span class="kwd">public</span><span class="pln"> </span><span class="kwd">function</span><span class="pln"> create</span><span class="pun">(</span><span class="pln">$url</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
		some code
	</span><span class="pun">}</span><span class="pln">

	</span><span class="kwd">public</span><span class="pln"> </span><span class="kwd">function</span><span class="pln"> authenticate</span><span class="pun">(</span><span class="pln">$token</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
		some code
	</span><span class="pun">}</span><span class="pln">

	</span><span class="pun">...</span><span class="pln">dozen other methods
</span><span class="pun">}</span></pre>

<p>
	Current way of instantiating in every single other class where i need the client:
</p>

<pre class="ipsCode prettyprint lang-php prettyprinted">
<span class="kwd">use</span><span class="pln"> </span><span class="typ">Client</span><span class="pun">;</span><span class="pln">

</span><span class="typ">MyFetchController</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
  </span><span class="kwd">private</span><span class="pln"> $client</span><span class="pun">;</span><span class="pln">

  </span><span class="kwd">public</span><span class="pln"> </span><span class="kwd">function</span><span class="pln"> __construct</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
      $this</span><span class="pun">-&gt;</span><span class="pln">client </span><span class="pun">=</span><span class="pln"> </span><span class="typ">Client</span><span class="pun">::</span><span class="pln">create</span><span class="pun">(</span><span class="pln">getenv</span><span class="pun">(</span><span class="str">'URL'</span><span class="pun">))-&gt;</span><span class="pln">authenticate</span><span class="pun">(</span><span class="pln">getenv</span><span class="pun">(</span><span class="str">'TOKEN'</span><span class="pun">))</span><span class="pln">
  </span><span class="pun">}</span><span class="pln">

	$this</span><span class="pun">-&gt;</span><span class="pln">client</span><span class="pun">-&gt;</span><span class="kwd">use</span><span class="pln"> other methods </span><span class="kwd">in</span><span class="pln"> </span><span class="typ">Client</span><span class="pln"> </span><span class="kwd">class</span><span class="pln">
</span><span class="pun">}</span></pre>

<p>
	Is there a way to wrap that class so i have external parameters loaded through .env file automaticaly available on new wrapper class intialization with something like this:
</p>

<pre class="ipsCode prettyprint lang-html prettyprinted">
<span class="pln">MyFetchController
{
	private $client;

	public function __construct(WrappedClient $client) {
		$this-&gt;client = $client
	}

	public function getData() {
		$data = $this-&gt;client-&gt;parse(...)
	}
}</span></pre>

<p>
	Basically what i need is a class ready for DI in all other classes without inserting required auth and other parameters in constructor every single time
</p>
]]></description><guid isPermaLink="false">310428</guid><pubDate>Tue, 31 Mar 2020 10:18:49 +0000</pubDate></item><item><title>Exam results website script and idea</title><link>https://forums.phpfreaks.com/topic/309565-exam-results-website-script-and-idea/</link><description><![CDATA[
<p>
	Hii frnds,
</p>

<p>
	I am new in website development and really very excitement to learn.
</p>

<p>
	I tried to develop a exam result website for some small schools on charity basis.
</p>

<p>
	Please help me how I create the exam result website
</p>

<p>
	 
</p>

<p>
	I already have domain and I hosted that also
</p>

<p>
	 
</p>

<p>
	need step by step procedure
</p>

<p>
	 
</p>

<p>
	please help...…………………………..
</p>
]]></description><guid isPermaLink="false">309565</guid><pubDate>Thu, 21 Nov 2019 17:42:08 +0000</pubDate></item></channel></rss>
