0
Open an HTML file with PHP buttons
Let's say I have 3 files: home.html, q-a.html and contact.html How do I (I am on the home.html) go to the contact.html by pressing a button using php
7 odpowiedzi
+ 6
<?php
echo "<button><a href='contect.html'>Contact</a></button>";
?>
+ 6
As far as I know, you can’t add PHP function to events. Only JS.
+ 4
You cannot use directly html/js?
+ 4
Roel I dont know PHP very well. What i know is than PHP its used on SERVER side and you want do happens something on CLIENT side, then i dont think thats possible.
+ 2
And KrOW I mean I could use JS, but I want to practise a bit on php, so I'm trying to use very little to no JS where it's possible to replace it with php
+ 1
So in this case with php it's better to use an <a> element, but is it possible to it with just a button and a php function? And is it possible to use onclick for a php function instead of js function?