|
|
|
|
| View previous topic :: View next topic |
| Author |
Message |
Suspence
Daedalian Member
|
Posted: Wed May 09, 2012 9:10 pm Post subject: 1 |
|
|
So, I'd like to create a really simple web-form for feedback on a few web pages, and for the most part, I've accomplished that.
The bit I can't figure out is how to make the referrering URL to display on the page, so that the user can see that I've captured that information.
I'm using
<input type="hidden" name="derive_fields" value="ipaddr = REMOTE_ADDR, referrer = HTTP_REFERER" />
This is delivering the referring URL to me in the mail that is generated, which is great, but it also keeps it the referral URL hidden on the form page. I'd like the user to know that I have this information (so they don't duplicate effort by telling me what URL they are providing feedback on.)
I'm probably missing something dumb, and my HTML/PHP skills are virtually non-existent. Help? _________________ I hate people who try to write interesting things in their signature. |
|
| Back to top |
|
 |
Zag
Tired of his old title
|
Posted: Thu May 10, 2012 1:50 am Post subject: 2 |
|
|
Those values, REMOTE_ADDR and HTTP_REFERER, must be php built-in variables, because I know that they aren't anything special in HTML. I don't know php at all, but you just have to do whatever you do to display the value of any built-in variable in your page. I'm surprised that you don't have to prefix them with $ or something, which is the usual way to signify a variable in most HTML construction languages.
But try something like this: Does it replace the built-in variables with their values when not inside the value attribute?
| Quote: |
<input type="hidden" name="derive_fields" value="ipaddr = REMOTE_ADDR, referrer = HTTP_REFERER" />
<span>Your referring ip address is REMOTE_ADDR and the url you're coming from is HTTP_REFERER.</span>
|
Maybe you'll have to do something to tell the php processor to evaluate those rather then just include the text.
A quick Google of php syntax tells me that this will almost certainly do it, but it's probably overkill. Try the above, first and/or with curly braces around the variables.
| Quote: |
<?php
echo '<span>Your referring ip address is '. REMOTE_ADDR . ' and the url you're coming from is ' . HTTP_REFERER . '.</span>'
?> |
|
|
| Back to top |
|
 |
Suspence
Daedalian Member
|
Posted: Thu May 10, 2012 2:01 pm Post subject: 3 |
|
|
Doesn't seem to work, but maybe I'm not understanding your instructions.
I've replicated the page I'm trying to create here:
http://www.glpics.com/suspence13/compassfeedback2.html _________________ I hate people who try to write interesting things in their signature. |
|
| Back to top |
|
 |
Suspence
Daedalian Member
|
Posted: Thu May 10, 2012 3:56 pm Post subject: 4 |
|
|
Actually, I've figured out my dumb mistake. Zag, thanks for the push in the right direction. _________________ I hate people who try to write interesting things in their signature. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|