Hello,
I am currently trying to write a quick form that I want to appear on all my pages. What I basically do is create 3 files for each page.
The header and footer files stay the same site-wide and I just include them in 'file.php' in order to avoid retyping hundreds of lines of code. I am thinking about putting a form like this in the 'footer.php' file:
The only problem I have is that the name of 'file.php' changes depending on the page I have.
I was wondering if I used $_SERVER['PHP_SELF'] or $_SERVER['SCRIPT_NAME'] in 'footer.php' would it return the path to 'footer.php' or to 'file.php'.
I have also seen $_SERVER['REQUEST_URI'] around and that might be another option.
I am currently trying to write a quick form that I want to appear on all my pages. What I basically do is create 3 files for each page.
- header.php
- file.php
- footer.php
The header and footer files stay the same site-wide and I just include them in 'file.php' in order to avoid retyping hundreds of lines of code. I am thinking about putting a form like this in the 'footer.php' file:
Code:
<form name="login" action="file.php" method="post">
I was wondering if I used $_SERVER['PHP_SELF'] or $_SERVER['SCRIPT_NAME'] in 'footer.php' would it return the path to 'footer.php' or to 'file.php'.
I have also seen $_SERVER['REQUEST_URI'] around and that might be another option.
Comment