vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Adding "noscript" before any db connection (https://vborg.vbsupport.ru/showthread.php?t=322047)

yahsuah 03-07-2016 06:27 PM

Adding "noscript" before any db connection
 
I need to add these codes
HTML Code:

<noscript><meta http-equiv="refresh" content="0; url=whatyouwant.html" /></noscript>
to all of my pages, before any db connection.

I added it into top of my global.php but I get headers are already sent error. Same error for forumdisplay.php, showthread.php too.

Dave 03-07-2016 06:31 PM

That's not possible due to how PHP works.

Browser > HTTP(S) request to the server > PHP script executed > DB connection > complete PHP script result returned to browser.

yahsuah 03-07-2016 07:11 PM

Quote:

Originally Posted by Dave (Post 2566718)
That's not possible due to how PHP works.

Browser > HTTP(S) request to the server > PHP script executed > DB connection > complete PHP script result returned to browser.

Thank you for your explanation Dave. I don't have experience/knowledge about PHP.

I have been using this php script via include method in php: https://sourceforge.net/projects/iosec/

It is protecting us against DOS attacks. It is working in global.php (before all codes) It is checking/filtering the traffic before global.php codes.

I have been also using http://www.php-firewall.info via include method in php.

HTML Code:

<?php

include('iosec.php'); //DOS FIREWALL

define('PHP_FIREWALL_REQUEST_URI', strip_tags( $_SERVER['REQUEST_URI'] ) );
define('PHP_FIREWALL_ACTIVATION', true );
if ( is_file( @dirname(__FILE__).'/xxxxxx/firewall.php' ) )
        include_once( @dirname(__FILE__).'/xxxxxx/firewall.php' );  //HACK FIREWALL

...

I wonder how I can add a prevention for non-js bot traffic.

Dave 03-07-2016 07:14 PM

You can add it to the headinclude template, but that's when PHP reaches the part where it fetches the templates in vBulletin, long after the initial database connection.

yahsuah 03-07-2016 07:38 PM

Quote:

Originally Posted by Dave (Post 2566724)
You can add it to the headinclude template, but that's when PHP reaches the part where it fetches the templates in vBulletin, long after the initial database connection.

Yeah, this is where I reached...

I am following this script: https://github.com/JoeCurrie/PHP_BrowserValidation (for anti-ddos)

He may be successful...

--------------- Added [DATE]1457409995[/DATE] at [TIME]1457409995[/TIME] ---------------

I tried this: http://www.inspirationbit.com/php-js...wser-settings/ but it didn't work, cause of security token problem.


All times are GMT. The time now is 06:59 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.00947 seconds
  • Memory Usage 1,725KB
  • 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_html_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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