ajetrumpet Posted September 6, 2020 Share Posted September 6, 2020 (edited) hey @requinix, I know you and I have talked about this before but I just want to clarify this issue. Sadly, I have produced very few websites that have made use of dynamics in the form of database querying. But, the next project that I'm looking at will require it. The last thing I did with a query string involved the recording of downloads of file on a website. and on the page, I had this code: The archive is located here: <a href="dl.php?f=archive.zip">archive.zip</a> and the ''dl'' page had this code: if(!$_GET['f']) error('Missing parameter!'); $stmt = $conn->prepare("INSERT INTO tblDownloads (ip, file, date, time) VALUES (?, ?, ?, ?)"); $stmt->bind_param("ssss", $ip, $file, $date, $time); $stmt->execute(); $stmt->close(); $conn->close(); header("Location: archive.zip"); exit; and all the variables in the above ''dl'' page are declared in a file that is required by it, called ""conn.php"". My question for anyone here is: I am going to be producing a website similar to the testing site called ""jsFiddle"": https://jsfiddle.net/ . And it is slated to have a huge amount of content on it. for example, a main page might have 100 links on it whereby, if a user clicks on any of them, it should take them to another page (or load async content) that illustrates and example of any given issue being asked about. So, I know we've talked about $_GET before Requinix, and how most websites use it to produce dynamic content. And we've also talked about the concept of markdown. But once again, can someone here remind me....what's the best way to go about doing this? Storing the actual ""answer to the issue"" content in a backend database and pulling/displaying it appropriately, kind of like what I am showing I did with the file in the above code? thanks. Adam Edited September 6, 2020 by ajetrumpet Quote Link to comment https://forums.phpfreaks.com/topic/311438-universal-query-string-for-every-page/ Share on other sites More sharing options...
requinix Posted September 6, 2020 Share Posted September 6, 2020 You'll have a database table that contains, at a minimum, (1) some identifier, (2) content, and apparently (3) some "answer to the issue". Right? Link to the page using the identifier, which could (and probably should) be a rewritten URL, then use the identifier to pull the content and whatever. I'm not really sure why there's a question here. Quote Link to comment https://forums.phpfreaks.com/topic/311438-universal-query-string-for-every-page/#findComment-1581190 Share on other sites More sharing options...
ajetrumpet Posted September 7, 2020 Author Share Posted September 7, 2020 14 hours ago, requinix said: I'm not really sure why there's a question here. probably because I'm a hesitant moron who, for some reason, doesn't just ""jump in and do it"". and you've answered the question just fine. thanks much. enjoy your day, Mr. Administrator. 😃 Quote Link to comment https://forums.phpfreaks.com/topic/311438-universal-query-string-for-every-page/#findComment-1581204 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.