|
|
|
Add Submitter IP to Tables and Validate Form 3 Years, 4 Months ago
|
Karma: 0
|
Hi everyone, I haven't been around in awhile. I used to go by the name Highlander here. Lately my site had alot of submissions for data recovery software, etc. The website address and templates were different but the all the templates looked like cookie cutter purchased templates. When I searched through my server logs I found they were all coming from the same set of IP range. I wanted an easier way though to check the IP address of the submitter without having to search through an 80 Mb log file.
With this mod when a user submits a website their IP address with be saved to the Temp table. When you pull up the Validate Site form you will see the submitters IP on the form.
When you validate the site the Submitter IP address will be saved to the Links table, just in case you ever need to go back and check IP's. I coded this on the old version 2.0.1.0b Non SEF, but it should work on the new SEF version as well.
| Code: |
Go to your database with phpMyAdmin and add the field "SubmitterIP" to
the phplinks_links and phplinks_temp tables. Set varchar to 20
Open include/add.php
Find code around line 24:
$submit_add=$_POST['submit_add'];
After it add:
$SubmitterIP = $_SERVER['REMOTE_ADDR'];
Around line 232 find code:
$insert = sql_query("
insert into $insert_table(
SiteName,
SiteURL,
RecipURL,
LastUpdate,
Added,
Description,
Category,
Country,
UserName,
Password,
Hint,
Email
) values (
'$SiteName',
'$SiteURL',
'$RecipURL',
now()+0,
now()+0,
'$Description',
'$Category',
'$Country',
'$UserName',
password('$PW'),
'$Hint',
'$Email'
Change it to:
$insert = sql_query("
insert into $insert_table(
SiteName,
SiteURL,
RecipURL,
LastUpdate,
Added,
Description,
Category,
Country,
UserName,
Password,
Hint,
Email,
SubmitterIP
) values (
'$SiteName',
'$SiteURL',
'$RecipURL',
now()+0,
now()+0,
'$Description',
'$Category',
'$Country',
'$UserName',
password('$PW'),
'$Hint',
'$Email',
'$SubmitterIP'
------------------------------------------
Open admin/validate.php
Find code around line 49:
$insert = sql_query("
insert into $tb_links (
ID,
SiteName,
SiteURL,
RecipURL,
Description,
Category,
Country,
Email,
LastUpdate,
Added,
UserName,
Password,
Hint
) values (
'',
'$SiteName',
'$SiteURL',
'$RecipURL',
'$Description',
'$Category',
'$Country',
'$Email',
now()+0,
now()+0,
'$UserName',
'$Password',
'$Hint'
Change it to:
$insert = sql_query("
insert into $tb_links (
ID,
SiteName,
SiteURL,
RecipURL,
Description,
Category,
Country,
Email,
LastUpdate,
Added,
UserName,
Password,
Hint,
SubmitterIP
) values (
'',
'$SiteName',
'$SiteURL',
'$RecipURL',
'$Description',
'$Category',
'$Country',
'$Email',
now()+0,
now()+0,
'$UserName',
'$Password',
'$Hint',
'$SubmitterIP'
Find code around line 176:
<tr>
<td class="text">Email</td>
<td><input class="small" type="text" name="Email"
value="<?=$rows[Email]?>" size="35"></td>
</tr>
After it add:
<tr>
<td class="text">Submitter IP</td>
<td><input class="small" type="text" name="SubmitterIP"
value="<?=$rows[SubmitterIP]?>" size="35"></td>
</tr>
|
|
|