By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,027 Members | 1,111 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,027 IT Pros & Developers. It's quick & easy.

redirecting a login page to a url from server variable

P: 29
Hey everyone, hope all are fine ...

Dreamweaver uses a login_user server behavior to send the user to a specified page on a successful login. Normally you would provide a url, but I would like to use the server variable that holds the url of the last page visited so I can use the same login form for different sections of the website.

$MM_redirectLoginSuccess = $_SERVER['HTTP_REFERER'];
doesn't work. The command doesn't recognize it as a pathname.


Is there a way to do this successfully within a PHP command structure?

Thanks for any help ...

Robert
Jun 5 '08 #1
Share this Question
Share on Google+
6 Replies


Markus
Expert 5K+
P: 6,050
$_SERVER['HTTP_REFERER'] points to the page in which a viewer used a link that pointed to the new page.

$_SERVER['HTTP_REFERER'] can be faked!

Not reliable!

Anyways, is the page last visited going to be on your site?

If so, on every page you could have a SESSION that holds the uri of the page.

Also: dreamweaver is not a recommened dev tool!
Jun 5 '08 #2

Atli
Expert 5K+
P: 5,058
Also: dreamweaver is not a recommened dev tool!
Dreamweaver is a decent enough editor, but avoid using it's special tools and wizards to generate your code. You don't want to be dependent on a single tool to be able to "write" your code.

You could use sessions or cookies to save the last page a visitor was on. Just add code to the bottom of the code that sets a cookie or session value to the name of the current page. That way the entire code would be able to use the value set by the last page.
Jun 5 '08 #3

P: 29
Hey ... Thanks for the $_SESSION['variablename']; idea, that worked.

I am a graphic designer, trained in art and computer science beginning a long time ago (1968). In my business I am forced into painful deadlines and stress. I appreciate any tool that can help me do my job.

I have seen Photoshop go from v1.5 to today. I have been a beta site for Adobe, Macromedia, AutoCad and others through the years. The thing I like about Dreamweaver is that in most instances, it generates the code for you, and then by studying that code, you can learn to write your own. In the going on 2 years I have been doing web design, I have found this very helpful. I think that it is wrong to discourage anyone from using whatever tool they can to be more proficient and successful.

Thanks again for the help.

Robert
Jun 5 '08 #4

Markus
Expert 5K+
P: 6,050
I think that it is wrong to discourage anyone from using whatever tool they can to be more proficient and successful.
You're welcome, bro.

And I apologise. I should have stated this is just preference, to be honest. I have heard that DW produces inconsistent code.. and very ugly looking code, at that.

Whatever floats your boat! Water, I think?

See ya around!
Jun 5 '08 #5

dlite922
Expert 100+
P: 1,584
I am a graphic designer, trained in art and computer science beginning a long time ago (1968).
*jaw drops*

Use *whatever* tool you need sir. If i were you, i'd barely function, much less produce code.

Cheers to ya and good health for years to come!

Dan
Jun 6 '08 #6

Atli
Expert 5K+
P: 5,058
...
I think that it is wrong to discourage anyone from using whatever tool they can to be more proficient and successful.
...
I quite agree with you there. There are many excellent tools that can be very useful, and there is absolutely nothing wrong with taking advantage of that.

For those who are new to PHP, however, I would encourage learning how to write the code by hand first, before they start using such tools. Otherwise they can become dependent on proprietary tools, which is obviously not a good thing.
Jun 6 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.