marklarah Posted January 22, 2008 Share Posted January 22, 2008 My code: <?php include_once 'top.php'; $send = "no"; ?> <?php if (isset($_POST['to']) && isset($_POST['title']) && isset($_POST['message'])) { //if the user has just tried to send a message $to = $_POST['to']; $title = $_POST['title']; $message = $_POST['message']; $query= 'select * from users ' ."where username='$to' "; $result = mysql_query($query); if (mysql_num_rows($result) = 1) { $to_id = $row['ID']; $f_id = $_SESSION['userID']; //if they are in the db, its Allright. mysql_query("INSERT INTO myPMs (id, to_id, from_id, time_sent, title, message) VALUES(NULL, '$to_id', '$f_id', NOW(), '$title', '$message' ) ") or die(mysql_error()); $send = "borkborkbork - How the hell are you reading this? I mean seriously?"; } } ?> <html> <title>TLS-3 Private Messaging v0.1B</title> <body bgcolor="#000000"> <p>Hi</p> <table width="900" align="center" border="0"> <tr> <td width="100%" height="133"> <img src="top.gif" width="900" height="133"></td> </tr> <tr> <td width="100%" height="30" bgcolor="#333333"> <font color="#FFFFFF" face="Bell MT, Bahtang, Helvetica"><? include 'bar.php'; ?></font> </td> </tr> <tr> <td width="100%" bgcolor="555565"> <table border="0"> <tr> <td> <?php include 'dbs.php'; ?> <font face="Arial, Helvetica"><h1>Private Messaging v0.1B <hr width="300" color="white" align="left"></h1></font><br> <table> <tr> <td width="17">   </td> <td> <table border="0" cellpadding="0" cellspacing="0" width="504" align="left"> <tr> <td><img src="images/spacer.gif" width="45" height="1" border="0" alt=""></td> <td><img src="images/spacer.gif" width="226" height="1" border="0" alt=""></td> <td><img src="images/spacer.gif" width="233" height="1" border="0" alt=""></td> <td><img src="images/spacer.gif" width="1" height="1" border="0" alt=""></td> </tr> <tr> <td colspan="3"><img name="art_r1_c1" src="images/art_r1_c1.png" width="504" height="11" border="0" alt=""></td> <td><img src="images/spacer.gif" width="1" height="11" border="0" alt=""></td> </tr> <tr> <td><img name="art_r2_c1" src="images/art_r2_c1.png" width="45" height="26" border="0" alt=""></td> <td valign="top" bgcolor="#999999"><p style="margin:0px"> <b> <font size="+1" face="Century Gothic, Arial, Comic Sans MS, Helvetica">Logout</font></b></p></td> <td><img name="art_r2_c3" src="images/art_r2_c3.png" width="233" height="26" border="0" alt=""></td> <td><img src="images/spacer.gif" width="1" height="26" border="0" alt=""></td> </tr> <tr> <td><img name="art_r3_c1" src="images/art_r3_c1.png" width="45" height="17" border="0" alt=""></td> <td colspan="2"><img name="art_r3_c2" src="images/art_r3_c2.png" width="459" height="17" border="0" alt=""></td> <td><img src="images/spacer.gif" width="1" height="17" border="0" alt=""></td> </tr> <tr> <td colspan="3" background="images/art_r4_c1.png"> <table width="464" border="0" align="center"> <tr> <td> <font face="Verdana, Helvetica, Trebuchet MS, Comic Sans MS, Arial"> <?php if ($send == "no"){ ?> Send Message:<br><br> <form method="post" action="sendpm.php"> Send to user: <input type="text" name="to"<?php if (isset($_GET['touser'])){ $touser = $_GET['touser']; echo 'value="'.$touser.'"'; } ?> ><br> Message Title: <input type="text" name="title"> <br> Message: <br> <textarea cols="40" rows="20" name="message"> </textarea> <br> <input type="submit" value="Post"><input type="reset" value="Clear"> <?php }else{ echo 'Message Sent to '; echo $_POST['to']; echo ". Hope it wasn't spam."; } ?> My error: Fatal error: Can't use function return value in write context in ....... Erm...I have never come accross this before. For once google, my friend, offered no help. You guys are my only hope I have left... Seriosuly though, what is that? Quote Link to comment https://forums.phpfreaks.com/topic/87250-solved-weird-error/ Share on other sites More sharing options...
rhodesa Posted January 22, 2008 Share Posted January 22, 2008 Fatal error: Can't use function return value in write context in ....... Can you include the rest of that error, specifically which line it is referring to. Quote Link to comment https://forums.phpfreaks.com/topic/87250-solved-weird-error/#findComment-446307 Share on other sites More sharing options...
marklarah Posted January 22, 2008 Author Share Posted January 22, 2008 Fatal error: Can't use function return value in write context in /home2/tlscom/public_html/sendpm.php on line 19 Quote Link to comment https://forums.phpfreaks.com/topic/87250-solved-weird-error/#findComment-446309 Share on other sites More sharing options...
Aeglos Posted January 22, 2008 Share Posted January 22, 2008 if (mysql_num_rows($result) = 1) {... should be if (mysql_num_rows($result) == 1) {... Quote Link to comment https://forums.phpfreaks.com/topic/87250-solved-weird-error/#findComment-446312 Share on other sites More sharing options...
marklarah Posted January 22, 2008 Author Share Posted January 22, 2008 of course... Quote Link to comment https://forums.phpfreaks.com/topic/87250-solved-weird-error/#findComment-446342 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.