Jump to content

BrainPill

Members
  • Posts

    123
  • Joined

  • Last visited

Everything posted by BrainPill

  1. Not sure in which sub forum this should be, but its about running a php script from a batch file. I addes PHP to the environment variables and tested it with: php -? I made a batch file like this: rem @echo off START /B php -f "X:\wamp\www\test-batch\hello-world.php" I made a new dir called: C:\batch here is the script hello-world.php located when I make the task in task scheduler it pop ups a command line shell saying \Windows\System32. Nothing is executed. BUT .... when I type cd\ in this command line it , the php script gives output on the screen. How can I make the php file execute instantly without going to the wrong directory ?
  2. this really helped me out thanks
  3. Hi there I made a function for getting the location of an error. The script where the error is, is done with $_SERVER['SCRIPT_FILENAME'] but when using __LINE__ I get the location of the script where the function code is placed, not where the function is executed. How can I solve this? example: <?php function find_file_linenum() { echo '<br><br>'; echo $_SERVER['SCRIPT_FILENAME']; echo '<br><br>login/condition error at line : .... '; echo __LINE__; echo '<br><br>'; } ?>
  4. Does anyone know how to change the settings of Notepad ++ ? I want to start all new files with <?php ?>, and if possible add some comment line above it. I have been going through the docs but I don't really get clear in what way the code should be added. in Notepad++ I have this file: contextMenu.xml but I need help to add these changes. I found this code in the docs: NewDocDefaultSettings lang:1 This are links to the docs: http://docs.notepad-plus-plus.org/index.php/Editing_Configuration_Files#NewDocDefaultSettings http:// http://docs.notepad-plus-plus.org/index.php/Context_Menu
  5. hello, I have an issue with getting the $_COOKIE value of a just set cookie. In the example the cookie is set with header. Immediately after having it set, I want to fetch the value of the browser cookie with $_COOKIE, but then the cookie is not there yet. Executing the script again shows the old cookie value and the new value is dumped on screen. I have the idea it takes time before the cookie is placed in the browser. questions: How can I check the time it takes before the cookie (headers?) are in the browser? And how can you 'wait' before the $_COOKIE part is executed ? <?php // test example $dt_tm = gmdate('r',strtotime('+2 hours')); session_start(); $sid = session_id(); var_dump($sid); $cknm = 'your_cookie_name'; header("Set-Cookie: $cknm=$sid; expires=$dt_tm; path=/testpath/; domain= www.yourvirtualhost.localhost; HttpOnly; SameSite=strict"); var_dump($_COOKIE); echo $_COOKIE['your_cookie_name']; ?>
  6. I see that now. I have version 7.1.9 so it couldn't work.
  7. okay I fixed that now. But I the array to string error is still there. How to solve this?
  8. I tried this: <?php $options = array('lifetime => 3600','samesite=>strict'); session_set_cookie_params($options); ?> but I get the following error: ( ! ) Notice: Array to string conversion in does this indicate that you have to read them out with foreach? The reason I ask this, is because all the other params could just be put into the session_set_cookie_params() function but this specific one not. This makes it an exception to the rule.
  9. I want to set a cookie in a proper way. So I want to add samesite strict. When I try to add it with : session_set_cookie_params() at the last parameter (6th) it says : Warning: session_set_cookie_params() expects at most 5 parameters, 6 given in example: <?php session_set_cookie_params(3600,'','',FALSE, TRUE,'strict'); ?> How can I add samesite in session_set_cookie_params() ?
  10. I checked the console error message. It was related to cross domain scripting . I solved it by moving the repository.
  11. I want to run a piece of *.js like this: name: index1.html <html> <head> <script type="text/javascript" src="example.js"</script> </head> test </html> I can run it as a separate script. But when I call the script when placed under a virtual domain it is not working all other scripts I made work normal under the virtual domain example: this works : X:\wamp\www\index1.html this does not work: http://www.my-virtual-domain.loc/index1.html The text: test is executed on the screen in both scripts, meaning that the js script in one situation does not work. Does anybody know what causes this?
  12. Its still not working the way I want it to work. I run the script this way ( I repeat: I installed it localhost) After clicking the Allow Cookies button actually the page should refresh but that doesn't happen. This the script: <html> <?php if (isset($_COOKIE['cookiebar'])){ if ($_COOKIE['cookiebar'] == "CookieAllowed") { // The user has allowed cookies, let's load our external services echo '<br> cookie is set analytics code can be executed <br><br>'; }} ?> <head> <script type="text/javascript" src="cookiebar-latest.js?tracking=1&always=1&top=1&showNoConsent=1&showPolicyLink=1&remember=Autodetect&privacyPage=Default%20(black)"> </script></head><body></body> </html> meaning that the first visit is not counted. Now this should be done this way. It is not allowed anymore to place any kind of code to set a cookie if the user doesn't agree with it. Im terrible with javascript. Which code should I use exactly after the Allow Cookies button is clicked?
  13. I solved it by placing other code found in the other menu part. basically its this: https://cookie-bar.eu/#configuration
  14. Maybe I'm making an error. But I am not that good with javacript. I'm used to PHP. If a php routine or variable is not executed then I used var_dump() to show the result on screen. How can I check if the js script I call is executed? I tried to use the console found in Chrome, here is an error report like this : Uncaught SyntaxError: Invalid or unexpected token What does that tell?
  15. Hi, I need help installing a cookie bar script. I run the script serverside !! Its found at this site: https://cookie-bar.eu/ I went to the cookiebar menu option. Under installation is written to grab the 'code below' but I can't find it. I think the code above is not useful. Can someone explain how to install the external js script correctly? As an example of how I tested this I included this code: <html> <head> </head> <body> <br><br><br> <a href="#" onclick="document.cookie='cookiebar=;expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/'; setupCookieBar(); return false;">Click here to revoke the Cookie consent</a> <br><br><br> Test script for cookies <br><br> <script src="cookiebar-latest.js"></script> </body> </html>
  16. I solved the issue meanwhile by doing this: "<?php echo $var ?>" using the double quote . Is that what you meant with javascript quotes?
  17. I dont understand. How should it be done? And what are Javascript quotes? And where to place them?
  18. hello I have a javascript code snippet I would like to add a php variable in the place where now is: abcd1234 original code: <script> window.dataLayer = window.dataLayer || []; function func_name(){dataLayer.push(arguments);} func_name('js', new Date()); func_name('config', 'abcd1234'); </script> I tried this : <?php $var = 'abcd1234' ?> var my_var = <?php echo $var; ?> but I don't know how to put the code in this line: func_name('config', what here? );
  19. a question about javascript. Is there a similar piece of code to php var_dump() ? I would like to know some kind of check command to see until where the javascript code I am running is working in the proper way.
  20. What are the best steps to set? Do it yourself or find a tool online? Is it a lot of work to do yourself as a programmer? Which skills are needed? Are there good maintained tools online that other people also use for browser/canvas fingerprinting?
  21. Never really heared about browser fingerprinting. How unique is a fingerprint actually? for example: https://fingerprintjs.com/ I can take this website as an example but it is not easy to determine whether it is really unique. Is it as unique as uniqid() ?
  22. I still have questions open for the visitor counter I am making. I now base a visit on a cookie, together with either an ip number or a get_browser() value; by placing it in the database table, distinguishing it in different time units. But what would you suggest to do when none of the above params is available? Is there an alternative? Can I use the headers for counting visits? And how is that done?
  23. It works for me. But I am testing localhost how a visitor counter has to work properly. I add visitors to a database.table based on cookie. If there is no cookie I use ip number AND browser type (get_browser) But there are many users that hide their ip or username. So my question is : can a website visitor hide the browser type by sending an empty value or is the get_browser() output then sending a fake / other browser name? get_browser parses then fake values of other browsers. Is that possible?
  24. No , what is written under 'Notes' is not what I mean because I have browscap installed. So when browscap installed, is it then still possible to get empty values?
×
×
  • Create New...