The Grey Labyrinth is a collection of puzzles, riddles, mind games, paradoxes and other intellectually challenging diversions. Related topics: puzzle games, logic puzzles, lateral thinking puzzles, philosophy, mind benders, brain teasers, word problems, conundrums, 3d puzzles, spatial reasoning, intelligence tests, mathematical diversions, paradoxes, physics problems, reasoning, math, science.

   
The Grey Labyrinth Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups    RegisterRegister  
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Dumb question on forms

 
Reply to topic    The Grey Labyrinth Forum Index -> Off-Topic
View previous topic :: View next topic  
Author Message
Suspence
Daedalian Member



PostPosted: Wed May 09, 2012 9:10 pm    Post subject: 1 Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Zag
Tired of his old title



PostPosted: Thu May 10, 2012 1:50 am    Post subject: 2 Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Suspence
Daedalian Member



PostPosted: Thu May 10, 2012 2:01 pm    Post subject: 3 Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Suspence
Daedalian Member



PostPosted: Thu May 10, 2012 3:56 pm    Post subject: 4 Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Display posts from previous: by   
Reply to topic    The Grey Labyrinth Forum Index -> Off-Topic All times are GMT
Page 1 of 1

 
Jump to:  
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
Site Design by Wx3