Ad block is installed and active. Please support us by disabling it.
HomeSaturday, January 20, 2018, 16:48:58
2

How to insert new line (IP Address) with fwrite

Tuesday, February 10, 15, 09:51:03, 3 Yaers Ago Via wain, Hits: 3502
How to insert new line (IP Address) with fwrite, Get IP address and write to file.
Example:

Code:
<?php
$ipaddress=$_SERVER["REMOTE_ADDR"];
$newline = $ipaddress."\r";
$file = "text.txt";
$fh = fopen($file, "a");
fwrite($fh,$newline."\n");
fclose($fh);
echo $newline;
?>

Sign In

Sponsor

Related

PHP explode

Explode — Split a string by string.

Captcha V2 - Free PHP Script

PHP Captcha protection image Version 2, - Requirement(s): PHP Server, GD Library

Adsense crawler errors and robots.txt

How to fix Google AdSense crawler errors in robots.txt

Email to Friend - PHP Script

This form allows your visitors to suggest your site to a friend. It features an HTML email format and an admin notification email.

Creating a CAPTCHA with PHP with imagecreate

This tutorial will show you how to create a form with Captcha, Requirement(s): PHP Server, GD Graphics Library

MySQL to RSS

Publishing MySQL data in RSS

MySQL – Select from two tables

Select data from two tables, PHP MySQL

PHP Jquery Form

PHP Jquery Form allow your visitors to contact you directly from your website.

Advanced Contact Form - PHP Script

Advanced Contact Form with email and form field validation. Features: HTML Output(Response), Captcha Image.

PHP Form Action Self Submit

PHP form action self submit tutorial, requirement(s): PHP server
About Author

wain

Date Registered: Sun, Feb 8, 15
Last Time Online: Thu, Jun 15, 17
So far has created 115 entries.
wain
This author has not yet filled in any details.