Jump to content

Quick Question


The Praetorian
 Share

Recommended Posts

Technically, you can do it two ways.a.) using a server side include language (asp, php, coldfusion) you could dynamically generate the link using the referral url (which is search engine friendly)b.) use javascript <a href="java script: void(0);" onclick="history.back();" title="[back]">back</a>

Link to comment
Share on other sites

change this line

echo "<h1>Please Enter a Valid Email Address<br />$ref</h1>";

to

echo "<h1>Please Enter a Valid Email Address<br />{$ref}</h1>";

or

echo "<h1>Please Enter a Valid Email Address<br />" . $ref . "</h1>";

Link to comment
Share on other sites

try

$ref = "Referrer: " . $_SERVER['HTTP_REFERER'];

I'm not sure but @$HTTP_REFERER; may be for an older version of PHP. Also by writing an extra part of the string you'll see if it works. If all you get is "Referrer:" then you know it is a problem with the server variable or there is no referrer.

Link to comment
Share on other sites

Thanks for stepping in aspnetguy - I'm no php guru, and I didn't want to convert him to ColdFusion until he is truly frustrated.:-D

Link to comment
Share on other sites

hm. Okay. It showed the url. Still not quite what I want it to do though. Can I use the variable in a link? (IE... <a href="$ref">Back</a> )? What I really want is just a link someone can click to send them back to the other page (so that all the info they entered into the form is still there.) But without having to press back on the browser.(On a side note, thanks for the help guys.)

Link to comment
Share on other sites

hm. Okay. It showed the url. Still not quite what I want it to do though. Can I use the variable in a link? (IE... <a href="$ref">Back</a> )?
That sounds right. If $ref stores the URL to the previous page, then using something like this should work:
echo '<a href="$ref">Back</a>';

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...