Notepad++ automatically opens links in the browser
Solved
Adri1infos
Posted messages
658
Status
Member
-
sebastien -
sebastien -
Hello,
I use Notepad++ to write a PHP page. In this page, there is a redirection:
Unfortunately, every time I open the page for editing (or refresh Notepad), it opens the link in my browser.
So in less than a minute, I have more than 20 Google tabs open.
This is very annoying.
Do you have any information/solutions to avoid this (I've checked the settings, etc.)?
Adri1infos
I use Notepad++ to write a PHP page. In this page, there is a redirection:
<meta http-equiv="refresh" content="0;url=https://www.google.fr/"/>
Unfortunately, every time I open the page for editing (or refresh Notepad), it opens the link in my browser.
So in less than a minute, I have more than 20 Google tabs open.
This is very annoying.
Do you have any information/solutions to avoid this (I've checked the settings, etc.)?
Adri1infos
1 answer
Hello,
It's normal for your browser to open that many pages, but why is that?
Your refresh is at zero
Then use Js, it's much better
EXAMPLE
At least here you're only doing one redirection.
It's normal for your browser to open that many pages, but why is that?
Your refresh is at zero
Then use Js, it's much better
EXAMPLE
<html> <head> <script type="text/javascript"> function RedirectionJavascript(){ document.location.href="www.google.fr"; } </script> </head> <body onLoad="setTimeout('RedirectionJavascript()', 2000)"> <div>In 2 seconds you will be redirected to www.google.be</div> </body> </html> At least here you're only doing one redirection.
I did what you suggested, but it's the same: when I edit my code on Notepad, the redirect (whether it's your example without any modifications or my meta) opens in the browser (and if there's no link for the redirect, it tries to open rundll32.exe).
Could you please post all your code? One line is going to be tough. It's not Notepad that's the issue; I code like this so I suspect it's a coding problem or something else. But I will eliminate the coding issue first anyway :)
Thanks
I couldn't set up a PHP redirect because I need to execute the page before doing the redirection. With the meta tag, no issue (even with refresh = 0), the PHP executes perfectly.
<html> <head> <title>INDEX</title> <meta http-equiv="refresh" content="0;url=https://www.google.fr"/> </head> <body> <? // testing the variable declarations if (isset($_POST['nom']) && isset($_POST['prenom'])) { // displaying the results $_POST['nom'] = $nom; $_POST['prénom'] = $prénom; } if($fp = fopen("index.txt","a")){ /* opening the file for writing !this is line 17 */ fputs($fp, "\n"); // going to a new line fputs($fp, "name : $nom surname : $prénom"); // writing the name and surname to the file fclose($fp); } ?> </body> </html>Here is what you declare in the variables
replace with
Same here
Your field apparently is called prenom and not prénom
Otherwise, I don't see any explanation regarding the opening of the pages. It is not possible for your PHP to execute since your fields did not have the same prénom or prenom, as a choice I did not see the HTML
So no problem on the PHP side.
Thanks anyway!