PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Try It Free
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
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  
Old June 13th, 2002, 07:56 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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.

Reply With Quote
  #2  
Old June 13th, 2002, 07:58 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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, =).

Reply With Quote
  #3  
Old June 14th, 2002, 02:17 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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...


Reply With Quote
  #4  
Old June 14th, 2002, 06:19 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Showing Individual Files Using MYSQL

Ok, that's exactly what I wanted, thanks.

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > Showing Individual Files Using MYSQL


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway