473,378 Members | 1,142 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

redirecting a login page to a url from server variable

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
6 1777
Markus
6,050 Expert 4TB
$_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
5,058 Expert 4TB
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
rlm51
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
6,050 Expert 4TB
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
1,584 Expert 1GB
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
5,058 Expert 4TB
...
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

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

Similar topics

4
by: TG | last post by:
Hi, I have a question concerning redirecting users who have logged in using our login page. Once they have properly filled out the form they should be redirected back to the last page they were...
1
by: Stu | last post by:
Hi All, I have an ASP.NET application to which I have implemented forms authentication to handle security. It is a relatively straight forward solution with all aspx pages residing in the root...
1
by: Ankur Jain | last post by:
Hi, I am facing a very weird problem while redirecting to another page. The problem is as follows: I have a website. I build the solution and run the application. The first page is the login...
4
by: jjjooooohhnnn | last post by:
Greetings, I have encountered what appears to be a fairly common problem: RedirectFromLoginPage is not redirecting to RedirectUrl. I have tried all the advice that I could on the 'net, and...
1
by: Jeremy Chapman | last post by:
I have built a web app. While testing I have found that if I browse to a page in the app, then get redirected to the login page and enter my credentials. The...
41
by: amygdala | last post by:
Hello all, I have posted a similar question in comp.lang.php in the past, but haven't had any response to it then. I kinda swept the problem under the rug since then. But I would really like to...
9
by: Jonathan Wood | last post by:
I've spent days trying to come up with a solution. I'd appreciate it if anyone can help. My site requires all users to log on. There are three different roles of users, and each user type will...
0
by: Anup Daware | last post by:
Hi All, I am facing this very weird issue, for every server request my control is redirecting to the login page and again coming back to the actual page from where the request was initiated when I...
6
by: rpcchandu | last post by:
Hi Coders, I have to redirect from my server to the different server page by simulating the POST method submit from the Controller file, I tried using post_via_redirect, but could not succeed......
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.