Jumping to a new php file

No swearing, link posting, adult oriented, or illegal posts.
Post Reply
Site Admin
Posts: 237
Joined: Sat Jan 11, 2020 12:44 am

Jumping to a new php file

Post by Chris »

When you get down to needing to load a new page, or passing information to itself, you will need a link.

For this, simplicity of a simple line pulls a connection between parts of files come together. To accomplish this:

echo "<a href='file.php'> Location name </a>";

<a> starts the line while </a> stops the line. The information you put with the <a> builds the information that will be used for that section.
href is the information that a html command uses to load a new page.
Location name is a description of what you want the user to click.

For example:

echo "<a href='logout.php'>Exit Game</a>";

When you run the program that has this line, the line will show to the user: Exit Game
At the moment, Exit Game will be underlined. Pages underline links so that users know what to click.
When the user clicks on Exit Game, they are jumping from one page to another, code to another code.

Another way to put that line would be:

echo "<a href='http://arkane-angel.net/index.php'>Arkane Angel Home Page</a>";

This will point the browser to the file index.php in the website of arkane-angel.net.

The line for Exit Game, the link would be using the php in that directory that you are currently in. The line using http goes to the website after ://
Support these areas by allowing Advertisements! :geek:
Post Reply