Solved

Breaking line in .htaccess

Posted on 2007-03-29
4
228 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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 (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logiā€¦
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

840 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