I have this link, and when you click on it, theres a GET variable lets say domain.php?page=

$_GET['page'];

and if page equals a variable, I can echo out a form. So what if that form has a link to edit, but its under domain.php?page=form

oh and I have set this form in another page so I can just include("php_file.php") it and echo it out. I wanted to use GET variable because I can all other contents within the page and just echo out this form in a certain area.

Okay my question is, how do I pass another variable? like domain.php?page=form/edit or like would it be something like ?page=form?edit= so a new page will pop up so I can edit the form? And I want this to be able to keep in the same page with all the contents still

Or would I need to use a POST method?

I dont understand how some sites, they have a lot random strings after the domain name? and how would you be able to do something like that?

you can show the page content based on your query string like:
lets say if page url is like: mypage.php?show=form then:

if($_GET['page']=="form")
{
// showing form
}

if page url is like: mypage.php?show=edit then:

if($_GET['page']=="form")
{
// showing form data
}
else if($_GET['page']=="edit")
{
// showing edit data
}
else
{
// something else
}

if you want to pass two variables at a time,then
url would be : mypage.php?show=edit&editid=9 then you can do like this:

if($_GET['page']=="form")
{
// showing form data
}
else if($_GET['page']=="edit")
{
  $id=$_GET['editid'];
you can use $id to retrieve query or something

}
else
{
// something else
}

and also check this link:
http://www.phpknowhow.com/get-and-post/understanding-get-and-post/

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.