Ip-grabbing in php
Moderator: General Moderators
- potato
- Forum Contributor
- Posts: 192
- Joined: Tue Mar 16, 2004 8:30 am
- Location: my lovely trailer, next to the big tree
Ip-grabbing in php
Need help to grab someone's ip and make it a php var.
I know that the ip-grabbing should be done with javascript, but
that's all i knows.
And the only scripts that i can find are with javascript and asp.
Any idea would be welcome.
tom.
I know that the ip-grabbing should be done with javascript, but
that's all i knows.
And the only scripts that i can find are with javascript and asp.
Any idea would be welcome.
tom.
Re: Ip-grabbing in php
Nonsense. and if u was to search for this, you would find a answer 10x quicker then it did for u to type this thread.Bevibed.be wrote: I know that the ip-grabbing should be done with javascript, but
that's all i knows.
Code: Select all
<?php
$ip = $_SERVER['REMOTE_ADDR'];
echo $ip;
?>- potato
- Forum Contributor
- Posts: 192
- Joined: Tue Mar 16, 2004 8:30 am
- Location: my lovely trailer, next to the big tree
Does someone see the fault in it?
i get following error message: parse error, expecting `','' or `';'' in /
if ($totalRows_Recordset2 = "0"){
mysql_select_db($database_memberships, $memberships);
$query = mysql_query("UPDATE bands SET band_rating='$newrating' WHERE band_id='$bandid'")or exit('Not updated!');
echo "Rating Updated"
}else{ //here is the parse error
echo "You already had voted for this artist(s)"
};
i get following error message: parse error, expecting `','' or `';'' in /
if ($totalRows_Recordset2 = "0"){
mysql_select_db($database_memberships, $memberships);
$query = mysql_query("UPDATE bands SET band_rating='$newrating' WHERE band_id='$bandid'")or exit('Not updated!');
echo "Rating Updated"
}else{ //here is the parse error
echo "You already had voted for this artist(s)"
};
if ($totalRows_Recordset2 = "0"){ \
change
if ($totalRows_Recordset2 == "0"){
echo "You already had voted for this artist(s)"
};
change
echo "You already had voted for this artist(s)";
}
change
if ($totalRows_Recordset2 == "0"){
echo "You already had voted for this artist(s)"
};
change
echo "You already had voted for this artist(s)";
}
Last edited by tim on Tue Mar 16, 2004 9:52 am, edited 1 time in total.
-
penguinboy
- Forum Contributor
- Posts: 171
- Joined: Thu Nov 07, 2002 11:25 am
Or:
Code: Select all
$sql = "SELECT * FROM table_name WHERE id1='$id' && id2='$id2'";wait theres alot of syntax errors:
that should work
Code: Select all
<?php
if ($totalRows_Recordset2 = "0"){
mysql_select_db($database_memberships, $memberships);
$query = mysql_query("UPDATE bands SET band_rating='$newrating' WHERE band_id='$bandid'")or exit('Not updated!');
echo "Rating Updated"
}else{ //here is the parse error
echo "You already had voted for this artist(s)"
};
?>Code: Select all
<?php
if ($totalRows_Recordset2 == "0"){
mysql_select_db($database_memberships, $memberships);
$query = mysql_query("UPDATE bands SET band_rating='$newrating' WHERE band_id='$bandid'")or exit('Not updated!');
echo "Rating Updated"; // forget the ; here
} else {
echo "You already had voted for this artist(s)";
}
?>tim wrote:oh dont pay attention to Sami, just trying to scare ya.
![]()
![]()
More info @ http://www.mysql.com/doc/en/INSERT.html