Solved

Breaking line in .htaccess

Posted on 2007-03-29
4
202 Views
Last Modified: 2008-03-06
Hello,

how can I break the link with this code? I tried to include \n but it doesn't work. The code will write to .htaccess file.

<?
$ip = "deny from $REMOTE_ADDR\n" ;
$banip = '.htaccess';
$fp = fopen($banip, "a");
$write = fputs($fp, $ip);
fclose($fp)
?>

.htaccess file output, it cannot break the line in between "deny from 123.122.8.10"

<Files 403.shtml>
order allow,deny
allow from all
</Files>
deny from 123.122.8.10deny from 456.122.8.10deny from 696.122.8.10

thank you
0
Comment
Question by:simoa
  • 2
4 Comments
 
LVL 48

Expert Comment

by:hernst42
ID: 18816287
use
$ip = "\ndeny from $REMOTE_ADDR";
in this case
0
 
LVL 29

Accepted Solution

by:
TeRReF earned 50 total points
ID: 18816352
If that doesn't work, try:
$ip = "\r\ndeny from $REMOTE_ADDR";
0
 

Author Comment

by:simoa
ID: 18816467
hernst42: sorry your couldn't work thanks for helping.

TeRReF: thanks it works.
0
 
LVL 29

Expert Comment

by:TeRReF
ID: 18817173
You're welcome.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now