• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Php href link question

Tbol

Well-Known Member
Joined
Apr 7, 2019
Messages
526
Reaction score
54
Hi so im trying to create one function in website and im using href to link to a different php like this
href="..\quest\quest1.php">
so its inside www\quest\quest1.php it links just fine but it doesnt load template at all so i guess because this php have to be inside system folder but i cant understand those href if i want to link to \www\system\pages\quest\quest.php from \www\system\pages how href should look? Using myacc, im not sure about why it doesnt load template but i guess because it have to be inside system folder.
 
You should do this in JavaScript, not PHP; so you don't have to refresh the page on click.

Just style the <div> containing all the quest info hidden to begin with (with CSS), and make it visible on click (with JS).

Example:

HTML:
<button onclick="makeVisible()">Quest 1</button>
<div style="visibility:hidden;" id="quest_info">Your quest info goes here...</div>
<script>
function makeVisible()
{
    document.getElementById("quest_info").style.visibility = "visible";
}
</script>

Or if you're retrieving the quest info from a database/file, use AJAX.
 
You should do this in JavaScript, not PHP; so you don't have to refresh the page on click.

Just style the <div> containing all the quest info hidden to begin with (with CSS), and make it visible on click (with JS).

Example:
HTML:
<button onclick="makeVisible()">Quest 1</button>
<div style="visibility:hidden;" id="quest_info">Your quest info goes here...</div>
<script>
function makeVisible()
{
    document.getElementById("quest_info").style.visibility = "visible";
}
</script>

Or if you're retrieving the quest info from a database/file, use AJAX.
I prefer php more then js to be honest i know its better but i just like php more.
 
I prefer php more then js to be honest i know its better but i just like php more.
Everyone has a language they like above all others, but in your case it does not come down to your preference.
Events/clicks are handled by JS wherever your like it or not (that's just how your browser is implemented).

Front-end: HTML, CSS and JS
Back-end: PHP, Java, C++, Go, etc...
 
Back
Top