|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Showing Individual Files Using MYSQL
Ok, I'm using MySQL and PHP, and I've created this mail script so far. It's very simple, being there's a user script integrated with it, you can send "private messages" to other users of the site.
Anyway, when you check the mail you have, I made an array like this: Code:
if ($action == "Inbox") {
$GetMail = mysql_query("SELECT * FROM Mail WHERE mailreceiver='$usercookie'");
if(mysql_num_rows($GetMail) > 0) {
while ($row = mysql_fetch_array($GetMail)) {
$author = $row["mailauthor"];
$topic= $row["mailtopic"];
$message = $row["mailmessage"];
$status = $row["mailstatus"];
$id = $row["mailid"];
print "<tr><td><font size=2 color=#333366 face=Verdana, Arial> $status </td>";
print "<td><font size=2 color=#333366 face=Verdana, Arial> $author </td>";
print "<td><font size=2 color=#333366 face=Verdana, Arial>"; >
[Insert URL to individual file here]
<? print "$topic
}
}
}
Ok, anyway, I just want to know how'd I make the URL, so when you clicked the topic of the private mail, it would send you to a page where it displays ONLY that mail's topic, author, and message... I hope you understand what I mean. |
|
#2
|
|||
|
|||
|
RE: Showing Individual Files Using MYSQL
By the way, contrary to how it may appear, the coding IS done correctly, I think it was slightly altered when I pasted it into the message box, =).
|
|
#3
|
|||
|
|||
|
RE: Showing Individual Files Using MYSQL
What you'd need to do is pass that $id variable to another page:
echo "<a href="showmessage.php?id=$id">Show Message</a>"; That will build the link... then in the script showmessage.php, you run a query : $result = mysql_query("SELECT * FROM Mail WHERE mailid=" . $_GET['id']); that will grab that message....note that will only work on php version 4.1.0 and above..for older versions user $HTTP_GET_VARS rather than $_GET... For security you will need to check if the message belongs to the user that is trying to pull it up.... $row = mysql_fetch_array($result); if($row['mailreceiver'] != $usercookie) { echo "This isn't your mail!"; exit; } Hope that gives you some ideas... |
|
#4
|
|||
|
|||
|
RE: Showing Individual Files Using MYSQL
Ok, that's exactly what I wanted, thanks.
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > Showing Individual Files Using MYSQL |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|