-
Posts
131 -
Joined
-
Last visited
Everything posted by pro_se
-
user [b]A[/b] goes to user [b]B's[/b] profile. User [b]A[/b] clicks a link to add to buddy list. User [b]A[/b] now has user [b]B[/b] on his profile. User [b]B[/b] also has user [b]A[/b] on his profile.
-
lol... i already have the whole site running on a local server but im just adding to it.... it is written in php, runs off of mysql.... i just want a user to be able to add a friend and once taht is done also have the friend to display the person that added him...
-
hey everyone!!! okay... i want to create a friend system similar to myspace... i was thinking i could create a sql table named friends with 2 columns one being 'friendid' and the other 'userid' and when they click add friend it inserts the information... i dont know what the query would be... oh and they also have avatars the url is saved in a table called users... any tutorials or someone that knows how to do this will be great...
-
THANKS!!! all you guys rock! poco got it for me though... thanks dude!
-
Parse error: parse error, unexpected $ in /var/www/user.php on line 363 there is no 363... ???
-
no.... okay... the user does not exist... a 10 year old kid messes around with the url and makes it http://somthing.com/?user=4534 and the real users id is like 3.... i want it to say invalid user only if the user does not exist but there are other people... it just needs to attempt to find a row and if it does not exist say invalid user...
-
hey! i am creating an online community and whenever someone pulls up a profile it displays information from a database... duh! but when someone puts a fake url or non-existant user id into the url it shows a profile page with nothing in it... how can i instead of a blank page have a message saying invalid user or somthing like that... this is what i was thinking... [code]<?php require 'db_connect.php'; $id = $_GET['id']; $result = mysql_query("SELECT * FROM users WHERE id=$id"); while($num=mysql_num_rows($result)) {if ($num == 0){ die('This user does not exist!'); } } ?>[/code] tell me what u think
-
thanks for all ur help! :P
-
dude... it was not that... i got it.... it was the name thing... for the $_GET.... i had it named wrong.... wow... im am a dummy...
-
ahhh!!!!! it still does not work!!!!!!!! same error... wow... link: user.php?name=corey&ip=10.160.43.200&time=1:03&date=July%2028,%202006
-
select * from comments where uname='corey' and ip='10.160.43.200' Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /var/www/user.php on line 56 address bar: user.php?name=corey&ip=10.160.43.200
-
no sessions... my address bar looks like: http://localhost/users.php?name=corey its a comment system where anyone can comment
-
id to from ip msg date time 1 corey Nil Thacker 10.160.43.200 Testing the comment system... July 28, 2006 1:03 in a table called comments... my address bar looks like: http://localhost/users.php?name=corey
-
that is the right query... this is weird...
-
select * from comments where uname='corey' Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /var/www/user.php on line 56
-
nope... same error... Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /var/www/user.php on line 53 ???
-
I have a query that is looking up a users comments: [code]<?php $uname = $_GET['name']; $result = mysql_query("select * from comments where to=$uname"); while($r = mysql_fetch_array($result)) { $from=$r["from"]; $msg=$r["msg"]; $time=$r["time"]; $date=$r["date"]; echo "$msg<br /> <sub>$from | $date | $time</sub> <hr color=#B0B0B0 noshade=noshade size=1/>"; } ?>[/code] and I keep getting an error like this: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/user.php on line 45 I have no idea what is wrong... maybe someone can help me?
-
thanks... i should have seen that... :(
-
hey! you guys have helped me alot and i hope you can help me with this next question i have... i am building a cms and i dont want those gay dynamic urls and i followed some tutorial and this is what i got: [code]Options +FollowSymLinks RewriteEngine On RewriteRule ^([^/]*)/$ /index.php?q=$1 [L][/code] and it works when i type the url like this: http://somedomain.com/home/ but not like this: http://somedomain.com/home basically it does not work if i dont put the trailing slash in it... does anyone know how to make it work without the ending slash?
-
it still does not work... all it does is says it 'Error- You can only vote once!'... it does not enter it but even if the ip was not in the table it still says that... i am gonna try the cookies and go on the honor system....
-
[quote author=Orio link=topic=100964.msg399152#msg399152 date=1153221949] To validate, do this: [code]<?php //let's say $ip holds the user's ip $sql="SELECT * FROM vote_security WHERE IP='$ip'"; if(mysql_num_rows(mysql_query($sql))!=0){ die("Error- You can only vote once!"); } ?>[/code] Basicly, search if there's such an IP in the db. If so, "shoot the user". Orio. [/quote] dude... i tried it... it does not work... this is how i put it in... [code]<?php mysql_connect("localhost","root","poopy"); $ip = $REMOTE_ADDR; $sql="SELECT ip FROM vote_security WHERE IP='$ip'"; if(mysql_num_rows(mysql_query($sql))!=$ip) { die("Error- You can only vote once!"); } else { mysql_connect("localhost","root","i am n00b"); mysql_select_db("hizzr"); $id = $_GET["id"]; $sql = "UPDATE links SET total_votes = total_votes + 1 WHERE id='$id'"; $result = mysql_query($sql); echo("<b>Vote counted!</b>"); } ?>[/code]
-
so what you are saying is make a table with ip's and usernames?
-
lol... thanks...
-
i cant think of what to use for the ip thing though... i already have it inserting the ip: [code]<?php //insert into the database... $id = $_GET["id"]; mysql_connect("localhost","root","poop"); mysql_select_db("hizzr"); $result = mysql_query("INSERT INTO vote_security VALUES ('$REMOTE_ADDR','$id')"); //see if it matches somthing in the database? if (ip exists) { shoot the person} else { vote} ?>[/code] but how to validate? iono...
-
hmmm... since the session's were not working out i will try out the ip idea... then i will try the cookies... cool avatar orio!