vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   CRSF - JavaScript Placement (https://vborg.vbsupport.ru/showthread.php?t=318917)

Mickie D 06-02-2015 07:26 AM

CRSF - JavaScript Placement
 
Hi there,

I need some help with the javascript placement for the security token...

this is the code
PHP Code:

<script>
        var 
= new Resumable({
            
target:'downloads.php',
            
chunkSize:1*1024*1024,
            
simultaneousUploads:4,
            
testChunks:false,
            
throttleProgressCallbacks:1
          
}); 

I think this is the code i need to put in...

PHP Code:

SESSIONURL 'securitytoken=' SECURITYTOKEN '&foo=' foo); 

not 100% though...

thanks all.

Mick

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

I tried this

PHP Code:

      <script>
        var 
= new Resumable({
sessionurl:SESSIONURL,
            
target:'downloads.php',
            
chunkSize:1*1024*1024,
            
simultaneousUploads:4,
            
testChunks:false,
securitytoken:SECURITYTOKEN,
            
throttleProgressCallbacks:1
          
}); 

But this does not work, When I turn on CRSF at the top of the file - nothing uploads.

Dave 06-02-2015 08:59 AM

Did you check the console/network tab in developers tools? It should show any errors and the parameters of the POST/GET request.

Mickie D 06-02-2015 09:09 AM

Sorry Dave, where do I check that my friend.

And thank you very much for your help.

Mick

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

Is that in chrome?

kh99 06-02-2015 09:49 AM

In the Chrome menu it's More Tools > Javascript Console, then the Network tab, then reload the page.

Mickie D 06-02-2015 10:14 AM

this is all I get

This browser is AJAX compatible
vbulletin-core.js?v=422:11 Fire vB_XHTML_Ready
vbulletin-core.js?v=422:11 Fetch Cookie :: vbulletin_collapse = ''
vbulletin-core.js?v=422:11 Firing System Init

no errors?

Mick

Dave 06-02-2015 10:59 AM

What if you check the network tab when it sends that request of your JavaScript example?


All times are GMT. The time now is 03:54 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.01195 seconds
  • Memory Usage 1,726KB
  • 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
  • (3)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