//flex table opened by JP

Click to See Complete Forum and Search --> : Form and IP??


G-man632
03-08-2003, 07:20 PM
is there a way to get someones IP address through a form? like a submit button?? so when they click it i get their address

qball
03-08-2003, 08:58 PM
whatever you use to process the request to get the page that shows the form in the first place, knows your IP, else you wouldn't see form.

If form just html passed by web server on GET, then when you process the submitted form, whatever you use to do that knows the IP, as in PHP:

$ip = getenv ("REMOTE_ADDR"); // get the ip number of the user

G-man632
03-08-2003, 10:12 PM
where would i put that in here?


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
[* Change this to effect the no of replies to display *]
[string $replies = "100"]

[* Shout Box Title *]
[string $title = "Perfect Sport"]

[*----- User Interface -----*]
[* Your Table Width *]
[string $tablewidth = "10"]

[* Your Table Border Width *]
[string $borderwidth = "0"]

[* Your Border Color *]
[string $bordercolor = ""]

[* Font you wish to use *]
[string $fontface = "Verdana, Arial, Helvetica, sans-serif"]

[* Font Size *]
[string $fontsize = "1"]

[* First Alternating Color *]
[string $firsta = ""]

[* Second Alternating Color *]
[string $seconda = ""]

[* HTML Code *]
<form method="post" action="http://www.activetopic.com/engine.post.generate">
<table width="[$tablewidth]" border="0" cellspacing="0" cellpadding="2" bordercolor="[$bordercolor]">

[string $start = "0"]

[* Start the main section loop *]


[* Do alternating Colors *]

<tr bgcolor="[$firsta]" bordercolor="[$bordercolor]">
[string $start = "1"]
[elseif $start eq "1"]
<tr bgcolor="[$seconda]" bordercolor="[$bordercolor]">
[string $start = "0"]

<td width="56%" height="31" colspan="2">
<p><font size="[$fontsize]" face="[$fontface]" color="#FFFFFF"><b>

<font color='#FF0000'>Red_one</font>
[elseif $main/nick neq 'coffee']
[$main/nick]

<font size="[$fontsize]" face="[$fontface]" color="#425961"></b>:
[$main/contents]
</font></p>
</td>
</tr>



<tr align="left" valign="middle">
<td bgcolor="[$seconda]" width="28%" bordercolor="[$bordercolor]"><font face="[$fontface]" size="[$fontsize]" color="#FFFFFF">
Name: <br>
<br>
</font></td>
<td bgcolor="[$seconda]" width="28%" bordercolor="[$bordercolor]"><font face="[$fontface]" size="[$fontsize]" color="#000066">
<input type="text" color="#000066" name="name" size="10" style="BORDER-RIGHT: #000066 2px solid; BORDER-TOP: #000066 2px solid; FONT-SIZE: 10px; BORDER-LEFT: #000066 2px solid; COLOR: #000066; BORDER-BOTTOM: #000066 2px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #ffffff">
</font></td>
</tr>
<tr align="left" valign="middle">
<td bgcolor="[$seconda]" width="28%" bordercolor="[$bordercolor]"><font face="[$fontface]" size="[$fontsize]" color="#FFFFFF">Message:</font></td>
<td bgcolor="[$seconda]" width="28%" bordercolor="[$bordercolor]"><font face="[$fontface]" size="[$fontsize]" color="#425961">
<input type="text" name="message" size="15" style="BORDER-RIGHT: #000066 2px solid; BORDER-TOP: #000066 2px solid; FONT-SIZE: 10px; BORDER-LEFT: #000066 2px solid; COLOR: #000066; BORDER-BOTTOM: #000066 2px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #ffffff"><font size="[$fontsize]" face="[$fontface]" color="#425961">&nbsp;
</font></td>
</tr>
<tr align="center" valign="middle">
<td bgcolor="[$seconda]" width="28%" bordercolor="[$bordercolor]">&nbsp;</td>
<td bgcolor="[$seconda]" width="28%" bordercolor="[$bordercolor]"><font face="[$fontface]" size="[$fontsize]" color="#425961">
<input type="hidden" name="i" value="[$userid]">
<input type="submit" name="submit" value="- Say -" style="BORDER-RIGHT: #ffffff 2px solid; BORDER-TOP: #ffffff 2px solid; FONT-WEIGHT: bold; FONT-SIZE: 10px; BORDER-LEFT: #ffffff 2px solid; COLOR: #000066; BORDER-BOTTOM: #ffffff 2px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #ffffff">
</font></td>
</tr>
</table>
<center>
</form>
</body>
</html>

G-man632
03-08-2003, 11:10 PM
btw i am using active topic and i am trying to get it so that when a person post say from 192.1.1.101 their name will turn red

all i need is a way to get hold of their ip

qball
03-09-2003, 09:22 PM
what's "active topic"?

I honestly don't know the:

[string $replies = "100"]

Format. What mechanism processes the stuff between the '[' ']'?

G-man632
03-15-2003, 12:23 AM
thats just to make it user friendly

just forget about the <html> tags etc

www.activetopic.com its a shoutbox

http://www10.brinkster.com/g321ca/shoutbox.htm

thats an example

wsl
03-21-2003, 11:36 PM
if youre to do it with php, on the part that recieves the information from the form you could do like

$ip = $_SERVER['REMOTE_ADDR']; //gets IP

then you could have like a column in the mysql table called `flag` or something, so if they have that IP you could set it equal to 1, and if not set it equal to 0.
$flag = 0;
$ipArray = array("12.345.678", "123.231.33");
foreach($ipArray as $i)
if($ip == $i) $flag = 1;

then when reading it you could do
$query = mysql_query("SELECT * FROM `activetopic`");
while($p = mysql_fetch_array($query)){
if($p['flag'] == 1)
echo "<span style=\"color: red;\">$p['name']</span>";
else
echo "<span>$p['name']</span>";
}

of course thats just a basic skeleton...

G-man632
03-24-2003, 07:23 PM
o ok nvm im not sure if I could get into the database/mysql to do that thx anyways tho:t