Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. well read and write works.. if unlink files atleast its empty
  2. Try this Example <?php $sql = 'SELECT COUNT(received) as numreceived, COUNT(unread) as numunread FROM messages WHERE (received = "0" OR unread = "unread") AND receiver = "'.$session->username.'" GROUP BY receiver '; $result = mysql_query($sql); $row = mysql_fetch_assoc($result) $consoleOutput = "<font face='Verdana' color='#FFFFFF' size='2'>Welcome back <b>$session->username</b>,</font> <a href='index.php?page=messages&option=inbox'>Private Messages</a> (Unread {$row['numunread']}, Total {$row['numreceived']})"; ?> stelthius You may want to try a performace test on both queries.. to see which one suite best,
  3. the file remains but is it empty ? normally means the account php is running is doesn't have owner access, are you sure the permissions are correct ? EDIT: that basically truncates the file (wipes its contents) also if an error occured their it gives a better idea what the problem could be
  4. I understood the problem.. any luck with the suggestions so far stelthius?
  5. Your function isn't returning anything try this <?php $tmpimg=imagecreatetruecolor(200,200); $color=imagecolorallocate($tmpimg,0,0,0); $tmpimg = roundedRectangle($tmpimg,0,0,200,200,20,$color); imagejpeg($tmpimg,$path.$filename); function roundedRectangle($im,$x,$y,$end_x,$end_y,$radius,$color) { //create two rectangles to form a sort of "cross" shape imagefilledrectangle($im,$x,$y+$radius,$end_x,$end_y-$radius,$color); imagefilledrectangle($im,$x+$radius,$y,$end_x-$radius,$end_y,$color); $dia = $radius*2; //fill in the corners of the "cross" with ellipses to form a rounded rectangle imagefilledellipse($im, $x+$radius, $y+$radius, $radius*2, $dia, $color); imagefilledellipse($im, $x+$radius, $end_y-$radius, $radius*2, $dia, $color); imagefilledellipse($im, $end_x-$radius, $end_y-$radius, $radius*2, $dia, $color); imagefilledellipse($im, $end_x-$radius, $y+$radius, $radius*2, $dia, $color); return $im; } ?>
  6. Any luck with the code i posted ?
  7. But do i get the last word ? monkuar Click solved if this is done
  8. meah.. try this <?php $installphp = dirname(__FILE__).'/install.php'; if (file_exists($installphp)){ chmod($installphp, 0777); $handle = fopen($installphp, 'w+'); fclose($handle); @unlink($installphp); } ?>
  9. LOL i win one the database name
  10. also are you trying to do this from inside install.php ?
  11. or with database name UPDATE `gzforums_ipb13`.`ibf_forums` SET `topics` = '0',`posts` = '0' DAME you Maq,, your too fast!
  12. Read google "SQL Injection" it basically protects against that!
  13. While Maq works his magic, i thought i add an idea, Add two fields to the users table called msg_unread and msg_recieved, when the user sends a message just add to that field as well, and when the user views his messages run those queries and update the users fields or maybe try (untested) <?php $sql = 'SELECT COUNT(received) as numreceived, COUNT(unread) as numunread FROM messages WHERE (received = "0" OR unread = "unread") AND receiver = "'.$session->username.'" GROUP BY receiver '; ?>
  14. so rename your function to counter instead of count
  15. Okay think this is all going wrong, your need to show an example as it is starting to sound like a JS problem (either that or your putting things in the wrong place)
  16. Yeah true, i had cookie issules with Safari, which effects sessions
  17. in that case, your need to escape the quotes Options are as follows $text = str_replace("'", "\'", $text); $text = addslashes($text); $text = htmlspecialchars($text, ENT_QUOTES); $text = htmlentities($text, ENT_QUOTES);
  18. Learning it isn't hard remembering it (for the amount of time you use it) thats harder One of my sites has a voting system i had WAP for that only, during the last update i didn't include it, so for no complaints!
  19. THe query is fine, is a php error, you have either not selected a database or have no connection/link to the database
  20. It maybe worth it but most moden phone have web browsers and don't use WAP anymore! ok my old phone could use view WAP but i never did because it was c##p, its okay for things like weather reports and stock market stuff (i don't go their), but for view a general website, it was pointless now with blackberri and iPhones etc thats a "Web Browser" so its Safari or Firefox or IE
  21. oops $dupcheck=mysql_query("SELECT Email.profile_admin, Email.profile_appraiser, Email.profile_user FROM profile_admin, profile_appraiser, profile_user WHERE Email.profile_admin='".$_POST['Email']."' OR Email.profile_appraiser='".$_POST['Email']."' OR Email.profile_user='".$_POST['Email']."' ") or die(mysql_query());
  22. Your very welcome. (and welcome to PHPFreaks) Oh and just so you know, without a function call it would look like this <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Letter Grades</title> </head> <body> <form action="LetterGrades.php" method="get" > <p> Grade: <input type="text" name="grade" /> <input type="submit" /> </p> </form> <?php if(!empty($_GET['grade'])) { switch ($Grade) { case "A": echo "Your grade is excellent."; break; case "B": echo "Your grade is good."; break; case "C": echo "Your grade is fair."; break; case "D": echo "You are barely passing."; break; case "F": echo "You failed."; break; default: return "You did not enter a valid letter grade."; } } ?> </body> </html>
  23. httpd.conf is the Main Configuration Files for apache , (so you need full access to the computer) FTP won't affect SSL, but SFTP will but as i said your probably okay, i won't worry about it,
  24. Put this in a single file called LetterGrades.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Letter Grades</title> </head> <body> <form action="LetterGrades.php" method="get" > <p> Grade: <input type="text" name="grade" /> <input type="submit" /> </p> </form> <?php if(!empty($_GET['grade'])) checkGrade($_GET['grade']); ?> </body> </html> <?php function checkGrade($Grade) { switch ($Grade) { case "A": echo "Your grade is excellent."; break; case "B": echo "Your grade is good."; break; case "C": echo "Your grade is fair."; break; case "D": echo "You are barely passing."; break; case "F": echo "You failed."; break; default: return "You did not enter a valid letter grade."; } } ?>
  25. $dupcheck=mysql_query("SELECT Email.profile_admin, Email.profile_appraiser, Email.profile_user FROM profile_admin, profile_appraiser, profile_user WHERE Email.profile_admin='".$_POST['Email']." OR Email.profile_appraiser='".$_POST['Email']." OR Email.profile_user='".$_POST['Email']."' ") or die(mysql_query());
×
×
  • 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.