Fins Up
Fins Up

Reputation: 39

How to use $_GET method values into a separate PHP document

Say I have an index.php page with a form with the action to another PHP document that submits the form data into a database.

In this PHP document, I am uploading some user information to a database, but I also want to upload a subject that is in the browser's URL. my URL is index.php?subject=test

I understand that I can use $_GET['subect'] to grab the information in the URL, but I can only use this in my main index.php page.

When I try to use this get method in my linked PHP page, It doesn't recognize it. What are some ways I can get this method to work? Or what are some other ways I can upload the subject located in the url to my database?

Upvotes: 0

Views: 122

Answers (1)

TheFurkan
TheFurkan

Reputation: 38

session and cookies keep the message in memory so you can move the content you want between pages

session_start();
$_SESSION['value'] = 'Hello World ';

Upvotes: 2

Related Questions