Breaking line in .htaccess

Posted on 2007-03-29
Last Modified: 2008-03-06

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);

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

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

thank you
Question by:simoa
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
LVL 48

Expert Comment

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

Accepted Solution

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

Author Comment

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

TeRReF: thanks it works.
LVL 29

Expert Comment

ID: 18817173
You're welcome.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System ( introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL ( several years ago, it seemed like now was a good time to updat…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

763 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