1.

Solve : URL in Form Results?

Answer»

I have the same form on numerous URLs. I need to know which URL was used when a person enters information in the form. Can the URL be included in the form results? If so how would you do that?yes you can, with PHP.

What I would do is add the following code to each page:

Code: [SELECT]<?
$url = $_SERVER['SERVER_NAME'];
$page = $_SERVER['php_SELF'];
?>

Than add a hidden field to each form (so the user won't see it):
Code: [Select]<input type="hidden" name="page_url" value=""http://".$url.$page">

That way you know from what URL each form was submitted.I TRIED your solution but I can't get it to work. The hidden field WORKS fine if I replace the value=""http://".$url.$page" with something LIKE value="test" so it has to be something in the code.try:

Code: [Select]
<input type="hidden" name="page_url" value=\"http://.$url.$page\">That doesn't work either. The results information ALWAYS shows " \"http://.$url.$page\" ".



Discussion

No Comment Found