vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   url store for redirection (https://vborg.vbsupport.ru/showthread.php?t=74343)

Tekton 01-14-2005 06:36 AM

url store for redirection
 
Scenario:

User clicks a link on the site and is taken to a new page, not the planned one, and is provided with a link to return to where he was planning on going.

Can I add something somewhere (like in global.php) to grab this? I tried HTTP something or other but it didn't seem to grab the place where I originally planned on going.

For example, a user is in forum 12 and clicks on a link to a thread but instead gets taken to this different page and then is given a link to go to the thread from the new page. I'm pretty set for the rest of the code I think, I just can't get the location for the place to redirect to~

Tekton 01-29-2005 03:39 AM

bump - anyone know? :)

Dean C 01-29-2005 10:00 AM

Umm is this vB or not?

Tekton 01-29-2005 10:19 AM

Well, er, yes. :)

Not that it'd have to be right, or is there something vB specific for it?

Dean C 01-29-2005 10:49 AM

Um well if you know how to get the user back to where they should be going use:

PHP Code:

header('Location: .......'); 

Putting where you want to redirect to, don't forget to escape single quotes for your variables. Also this is what you need to output at the top of your page before you output anything else.

miz 01-29-2005 11:52 PM

Quote:

Originally Posted by Dean C
Um well if you know how to get the user back to where they should be going use:

PHP Code:

header('Location: .......'); 

Putting where you want to redirect to, don't forget to escape singlequotes for your variables. Also this is what you need to output at thetop of your page before you output anything else.

on some servers,
header functions cuse error
(headers allready sent)

vb have a functions for header redirect that dosent couse and error
exec_header_redirect($url)

should work better.

Tekton 01-30-2005 10:47 AM

Nah, I actually need the url of where their comming FROM before I can send them there, which was my problem. ;)

I think I'm going to end up doing it a different way though -- instead of everywhere, only have this happen in the forumhome/index page(s). Thanks for the input though~

Dean C 01-30-2005 11:06 AM

You'll need to modify sessions.php to include a new sessionvar then :) $_SESSION['prevlocation'] = $_SERVER['REQUEST_URI']; I did this on my latest project :)


All times are GMT. The time now is 09:28 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01070 seconds
  • Memory Usage 1,727KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete