Solved

Breaking line in .htaccess

Posted on 2007-03-29
4
240 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn how to dynamically set the form action using jQuery.

751 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