Notepad++ automatically opens links in the browser

Solved
Adri1infos Posted messages 658 Status Member -  
 sebastien -
Hello,
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

sebastien
 
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
 <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.
0
Adri1infos Posted messages 658 Status Member 306
 
Thank you for your information.
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).
0
sebastien > Adri1infos Posted messages 658 Status Member
 
Hello Adri
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
0
Adri1infos Posted messages 658 Status Member 306 > sebastien
 
No problem, here is the original code. Basically, I'm retrieving data from an HTML form and writing it to a text file.
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>
0
sebastien > Adri1infos Posted messages 658 Status Member
 
Several mistakes are already visible
 if (isset($_POST['nom']) && isset($_POST['prenom'])) 

Here is what you declare in the variables
 $_POST['prénom'] = $prénom;

replace with
 $_POST['prenom'] = $prenom;

Same here
 puts($fp, "nom : $nom prénom : $prénom");

 puts($fp, "nom : $nom prenom : $prenom");


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
0
Adri1infos Posted messages 658 Status Member 306 > sebastien
 
It's a copying error with codes for the fields; I replaced them with concrete terms.
So no problem on the PHP side.
Thanks anyway!
0