Martynas Jakas Martynas Jakas - 1 year ago 79
MySQL Question

Need advice about making a forum with php

I am trying to create a forum on my page. I need some advice. I have MySQL database and I am able to to work with it. Yet as far as I can make is playing with POST. I mean on click submit a $_POST['submit']) becomes set and so on. Then connect to database, get info and display.This way of making a forum is bad, because it all happens on a single page. As far as I seen any other forum when entering one and so on has it's unique Uri (what comes after so you can simply send someone full url and they are in that thread (unlike if you play with $_POST['submit']).

Sorry if my question is not accurate and I am not asking to write me code. I just need someone to direct me to the right place and any advice would be helpful. Thanks !

Answer Source

Your question is difficult to understand, but I think you are confused about how data and pages are dynamic using GET/POST.

The URLS with different IDs are like an illusion. Really, its the same page, however the page is dynamically taking that ID from the URL, and using it to output certain data.

For example, say we habe the URL:

The php would look like

   $data = $db>query("SELECT thread_title,thread_text FROM threads WHERE thread_id = $_GET['thread']");



*Warning: do not use this exact code, it is an example, not secure, etc

Then the database would look like

thread_id     thread_title         thread_text
1               kngwihywoihwy      kngwihywoihwykngwihywoihwy
2            vyfngoieyoiehyon     ieonuwrtoi hunwrmt jirwyji
3           nuoaiefguneoihn        eoithneiotheo

and the page would show

nuoaiefguneoihn        eoithneiotheo

POSTing data is for sending it to the server, and doing something with it. Just like GET. However, GET is helpful for passing things around as they are accessible in links. Like this example.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download