vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Need javascript help with hack! (https://vborg.vbsupport.ru/showthread.php?t=43508)

blackice912 09-14-2002 02:53 AM

Need javascript help with hack!
 
Hello everyone!

I'm working on my first hack and I need some help with the javascript part of it.

I want to tell the script if the location in the browser does not equal a certain location that I specified, then to go to that location I specified and if it does equal that location specified, then to do nothing.

If you help, I will be most happy!

I also plan on releasing this nifty hack once it is done, as I think I don't think it's been released yet (or so it seems)

What is it? It's a template editing system so certain moderators can have access to their own style/templates for their forum so they may edit their forum to however they like.

Issvar 09-14-2002 09:16 AM

<script language=JavaScript>
if (document.location.href == "http://www.wrongsite.com/wrongfile.html") {
document.location.href = "http://www.rightsite.com/rightfile.html";
}
</script>

blackice912 09-14-2002 09:59 AM

Ok I re-wrote some of my code to ensure security and now I have another little problem...

PHP Code:

if ($expandset=$post[field7]) {
  echo 
"";
} else {
  echo 
"<script language=\"javascript\">
<!-- 

location.replace(\"http://www.stardust-one.net/forums/mod/\");

//-->

</script>"
;



Now, the problem is that it isn't reading $post[field7]...so I know I screwed up somewhere (hey, it's my first hack!). Any help with this little bit of code would be great.

$post[field7] is a custom profile field that will equal the expandset number

blackice912 09-14-2002 12:23 PM

Nevermind, I got it :)

TECK 09-19-2002 11:45 PM

<a href="http://www.stardust-one.net/forums" target="_blank">http://www.stardust-one.net/forums</a> = $bburl
just in case you didnt know...

filburt1 09-20-2002 01:00 AM

If you haven't sent headers yet (i.e., not written any HTML) then you can do this in PHP:
PHP Code:

if (strpos($_SERVER['PHP_SELF'], 'wrongfile.html'))
{
    
header('Location: rightfile.html');
    exit;




All times are GMT. The time now is 10:58 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.00930 seconds
  • Memory Usage 1,721KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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