A page contains FEU protected contact form. To access such form, already registrated user must log in to site. Clicking on 'Log in' link opens up a new page with log-in form. That's one step away from desired contact form.
After entering proper username and password and clicking on 'Submit' button, a new page opens up containing two links by default: 'Change user settings' and 'Sign out'. That's second step away from desired contact form.
The Problem:
I needed another link called 'Back to form' and solution for taking an user two pages back while reloading the page where 'Log in' link was initially clicked.
The Solution:
With help of my friend who diggs php, we did the following...
1) create first UDT called "remember_form" with following code:
Code: Select all
session_start();
$page = $_SERVER["REQUEST_URI"];
$_SESSION['page'] = $page;
3) create second UDT called "back_to_form" with the following code:
Code: Select all
session_start();
echo "http://".$_SERVER['SERVER_NAME'].$_SESSION['page'];
Code: Select all
<a href="{back_to_form}">Back to form</a>
Now, I'm not security wizard so I don't know if this solution is 100% safe. If anyone suspects this two UDT's could cause some security issues, please, you're more than welcome to leave a post about it in reply!
Hope this was helpful and best regards to all!
Jakovbak