PDA

View Full Version : How can i do this?



Luke
31-10-2008, 07:36 PM
I'm in the process of making a friends system on my private messaging system.

On the compose (pnew.php) page, there is the recieptant box,
so how can i make it that when i click the friends name, it comes up with the compose page with the recieptant box already filled in.
Something like pnew.php?name={username}

To help
Lets just say that the textbox is named "name"
And the mysql db thing for username is "username"

Thanks
Luke

Luke
31-10-2008, 08:47 PM
anyone?

Luke

Editd by Yoshimitsui (Super Moderator): Please do not double post.

Jackboy
31-10-2008, 10:05 PM
Make it so that its like


<a href="message.php?name=$friendnamevariable[1]">$friendsnamevariable[1]</a>


Then on the page that u want it to be filled in just use


$sendto = Secure($_GET[name]);
echo ("<input type=text value=$sendto>");

Secure is your own securing function :D

Excellent2
31-10-2008, 10:07 PM
I'd just query the username and then fetch the array?

Jackboy
31-10-2008, 10:16 PM
I'd just query the username and then fetch the array?

I replied as if he had already done that lol..

:D



$getusers = mysql_query("SELECT * FROM `USERTABLE`");
while ($allusers = mysql_fetch_array($getusers)){
echo "<a href=\"message.php?name=$allusers[username]\">$allusers[username]</a><br>";
}


SORRY if any of that is wrong. I know you could've probably used assoc and it would've worked faster but i am outa practise im afraid.
</span></span>

Luke
01-11-2008, 08:08 PM
Thank you!

Worked a treat ;)

Jackboy
01-11-2008, 09:06 PM
Thank you!

Worked a treat ;)

No probs ;D

Want to hide these adverts? Register an account for free!