Jump to content

kernelgpf

Members
  • Posts

    227
  • Joined

  • Last visited

Everything posted by kernelgpf

  1. $sql="SELECT id,Sender,Subject,Message,date,new,Playername FROM messages WHERE Recipient='$id' order by id desc "; $result=mysql_query($sql); $msgs=mysql_num_rows($result); //and new='yes' if($msgs == "0"){ print "<tr><td colspan='5' style='background-color:#b3a889;'><BR><BR><BR><BR><BR><BR><BR><BR><center><font size='5pt' face='comic sans ms'>No Messages.</font><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR></td></tr>"; } print "<form method=post action=messages2.php?action=delete>"; for($i=0;$i<$msgs;$i++) { $r=mysql_fetch_array($result); $mid=$r["id"]; $Sender=$r["Sender"]; $Subject=$r["Subject"]; $Message=$r["Message"]; $Date=$r["date"]; $New=$r["new"]; $Playername=$r["Playername"]; if($New == "no"){$rou="<font color='#339966'>Read</font>";} if($New == "yes"){$rou="<font color='#1569C7'>*Unread*";} if(empty($Subject)){$Subject="No Subject";} //Sunday 6/18/2008 2:38pm //$Date=str_replace(D n/j/y g:ia,$Date); echo " <tr class='msg' class='scrollContent' onMouseOver=this.className='highlight' onMouseOut=this.className='msg'> <td width='18'><INPUT type='checkbox' value='$mid' name='delMsg[]'></td> <td width='225'><b><a class='mailbox2' href=player_individual.php?id=$Sender>$Playername</a></b></td> <td width='195'><b><a class='mailbox3' href='message_viewindividual.php?id=$mid'>$Subject</a></b></td> <td width='195'><i>$Date</i></td> <td><center><b>$rou</b></center></td> </tr> "; } ?> </table> </CENTER> </td></tr> <CENTER> </tbody> </table></CENTER></div> <BR> <a href="message_compose.php"> Compose a Message </a> | <input type='submit' name='massdelete' value='Delete Selection'></form> The code is not mine, just trying to fix it. It worked previously.
  2. When you click the button on this form, it attempts to use the query parameters on the end and add it as part of the file name. My form: <form method=post action=messages2.php?action=delete> The error: The requested URL /messages2.php?action=delete does not exist on OS. Please try again. It doesn't do this on other forms, I've never come across this before.
  3. Oh, duh. Sorry. But that's only 5 months, not 6?
  4. A step better: $today=date('d/m/y'); $time="6 MONTHS"; $expires = date('d/m/y', strtotime("$today + $time")); print "$today and $expires"; But now it prints out "04/05/09 and 05/10/09". It thinks today is April 5th?
  5. The code: $today=date('m/d/y'); $time="6 MONTHS"; $expires=date("$today", strtotime("+$time")); print "$today and $expires"; Prints out "05/04/09 and 05/04/09";
  6. Holy crap. I can't believe it was that simple to solve, I've been working on this thing for HOURS! You rock.
  7. Alright, my script takes a list from a database: apple | red | juicy, orange | orange | fleshy, grapefruit | pink | fleshy explodes between the commas making apple | red | juicy orange | orange | fleshy grapefruit | pink | fleshy and then runs a foreach on the exploded parts, and further explodes it between the bar things ( | ). So it then becomes apple | red | juicy [0] apple [1] red [2] juicy orange | orange | fleshy [0] orange [1] orange [2] fleshy grapefruit | pink | fleshy [0] grapefruit [1] pink [2] fleshy beautiful. then I take the first part of the second explosion. [possible values are apple, orange, or grapefruit], and try to match it up with the variable "$fruit". I was running into problems, so I made it print out the first part of the second explosion and made it print out $fruit next to it. If the two matched up, "MATCH" should print. now, MATCH ONLY prints when "apple" (or $fruit) is FIRST in the first explosion. So my script works if $row[biglistoffruit] equals "apple | red | juicy, orange | orange | fleshy" but not "orange | orange | fleshy, red | juicy | apple." I need it to work regardless of where it is in the first explosion. Script: $fruit="apple"; $fruitarray = explode(",", $row[biglistoffruit]); foreach ($fruitarray as $value){ print "$value<br>"; //check if this part of the array has the fruit $fruitinfo=explode(" | ",$value); print "if $fruitinfo[0] equals $fruit<p>"; if($fruitinfo[0] == $fruit){ //if this matches print " - MATCH!<p>"; } }
  8. Thanks for anything at all. =) How do you actually use ImageMagick in PHP? I saw the exec("commands here") but I do not know what exec() is or how it works, or how to show images. It permanently changes server-side images, right? That is not what I'm looking for.
  9. I'm looking for a bit of code that can overlay a modifiable opacity level layer onto another image, but ONLY where there is another image. So if a tiny rose was in the middle of a 1000x1000 image, I need ONLY the rose, or NON WHITE portions on the image, to be overlayed with the selected color. Any thoughts, suggestions, script bits? TIA! P.S. Does anyone know how to use ImageMagick within PHP? I'm lost.
  10. No. I meant I know how to do basic MySQL and your answer is not the solution. My entire code is this: $IDquery=mysql_query("SELECT pet_id from pets ORDER BY pet_id DESC() LIMIT 1")or die(mysql_error()); $IDrow=mysql_fetch_array($IDquery); $babyID2=$IDrow[pet_id];
  11. ... I omitted surrounding code to get to the base of the problem.
  12. The error: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '() LIMIT 1' at line 1" The code: mysql_query("SELECT pet_id from pets ORDER BY pet_id DESC() LIMIT 1")or die(mysql_error());
  13. I'm trying to get the English ordinal suffix for the day of the month (the "th", "nd", etc.) like 1st, 2nd, 3rd, 4th, etc. To format TODAY'S date, I know you do.. $day3=date('S'); But how do I figure out another date's "S"? I have a string named $day, and I need to figure out it's "S", if that makes sense. Thanks!
  14. I'm getting this error- Operand should contain 1 column(s) From this code- $u_sql = mysql_query("SELECT id,name,ownerid,attack,defense,speed,luck,conformation,looks,strength,intelligence,(attack,defense,speed,luck,conformation,looks,strength,intelligence) AS total FROM ponies ORDER BY total DESC LIMIT 10")or die(mysql_error()); Help? Thanks!
  15. Works wonders, thanks so much!
  16. I'm bad at parsing and was wondering if someone could whip up a bit of code to take a file name out of a directory URL. Here's an example- /home/wildtail/public_html/autopics/breedable/natural/manetail/black.png I need it to just take the actual file name (black.png) out from the rest, scrap the rest, and then remove the .png on the end so all that's left is "black", but it's different with different file names, obviously. Pre-thanks!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.