include function being weird?


Posted on 16th Feb 2014 07:03 pm by admin

I have a very simple system to grab an IP outputted by a PHP file.. (for a project I have) but it outputs a 1 at the end!!
<form method="post" action="<?php echo $_SERVER["PHP_SELF"]; ?>">
<font style="color:#333;">IP Address to Analyse:</font> <input type="text" value="<?php echo include('./disp_ip.php'); ?>" size="20" maxlength="20" name="IPaddr"><br />
<input style="color:#333;" type="submit" value="submit" name="submit">

Is the code, note NO 1. Disp_ip.php has this simple code:
<?php echo $_SERVER['REMOTE_ADDR']; ?>

Yet I get this insanely weird result?
<input type="text" name="IPaddr" maxlength="20" size="20" value="64.180.2.2341"/>

Where on earth is this 1 coming from? it appears EVERY time I echo disp_ip.php

No comments posted yet

Your Answer:

Login to answer
170 Like 20 Dislike
Previous forums Next forums
Other forums

Empty text file when there is over XXXX lines of text.

define("RANDOM_FILE","/public_html/random.txt");
$randomEntry = "

Confusing Functions
So, I've been reading up on Functions and I like them! However, I need some help using variables in

Else statement screws up all css
Does anyone know what goes wrong in the process with this php code?
This code seems to be causing

How to display random record from table?
I have the following code:

Code: <?php
$display_block .= "<input type=

Form submissing with PHP and JQuery/Ajax
I have searched everywhere, but cannot find a solution for this... I have worked all day trying to g

Calling strings from other php class
I have test1.php{
$string1;
$string2;
....
... //10 strings in this class <

[function.file]: failed to open stream: No such file or directory
Okay I wrote this little script to upload a csv file that is located on my webhosts server to a mysq

explode() function problem maybe
Hi I'm having trouble searching my database. When I type two words in the search field it only searc

ok i need to join all this pages to make 1 neat code
i have 5 pages that make up my tv guide it works 100% but i want to make it 1 page if i can or 2, i

Grouping and sorting results
Please help with this query.

I have 2 tables in a database, countires and cities. states look

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash