close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Custom Redirect

Thread began 1/20/2011 4:00 pm by Bottega23 | Last modified 1/21/2011 6:42 am by Jason Byrnes | 997 views | 2 replies |

Bottega23

Custom Redirect

Hello,

I am attempting to do a custom redirect based on a session variable. I have followed the tutorial here:

showthread.php?t=17723&highlight=redirect

I make it to the redirect.php page but nothing happens. Am I missing something?

This is what my redirect.php page looks like:

<?php
if(isset($_SESSION['type']) && $_SESSION['type'] != "") {
header("Location: ".$_SESSION['type']."php");
}
?>



What am I missing?

Thanks!

Garry

Sign in to reply to this post

Bottega23

NM... I got it.

You didn't mention that it was necessary for the helper file to be called in the redirect.php file. That did the trick.

Sign in to reply to this post

Jason ByrnesWebAssist

It's not so much that the helper needs to be called, that only fixes the problem because it contains code to initialize the session.


if you had just added a line to check the session, it would have fixed the issue without needing to include the helper:

php:
<?php
if(!session_id()) session_start();
if(isset(
$_SESSION['type']) && $_SESSION['type'] != "") {
 
header("Location: ".$_SESSION['type']."php");
}
?>




9 times out of 10 though, this is done on a page that has security assist access restriction applied to it, so the session check is not needed.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...