Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. no syntax errors in thats code..
  2. i'm not sure how you know when something is going to be the default so i guessed its when $row['G_Status'] == "Good", so change that if needed i think this is what you want! $default = ($row['G_Status'] == "good")?" selected ":""; echo "<option $default>{$row['G_Status']}</option>"; EDIT: replacing the echo "<option>" . $row['G_Status'] ."</option>"; line
  3. Oh dumb ass (talking to myself) try while(($row = mysql_fetch_assoc($result)) || $cont)
  4. humm try <?php $result = "SELECT user_id, que FROM users ORDER BY que DESC"; $cont = true; $UID = 1; //users ID $counter = 0; $row = array(); while($row = mysql_query($result) && $cont) { $counter++; $cont = !($row['user_id'] = $UID); } echo "you are position $counter"; ?>
  5. humm remove $cont = array();
  6. $fontdata = chr($numchars).chr(0).chr(0).chr(0).chr($startchar).chr(0).chr(0).chr(0).chr($pixelwidth).chr(0).chr(0).chr(0).chr($pixelheight).chr(0).chr(0).chr(0); is used when creating the GDF from the png (sample font.png) once thats done it creates font.gdf, this can be loaded in as a GD font that is used by imageloadfont.. hope that makes sense!
  7. print_r($_FILES); i bet $_FILES['Picture3']['tmp_name'] isn't set
  8. I don't know if you can convert to TTF.. you can convert TTF to GDF, yes it create an image using the fonts maybe imagettftext would be better i have attached 182kb zip which may help [attachment deleted by admin]
  9. substr substr('Order #77', 7, 2);
  10. I'll build you a basic GD font pack, i have a basic GD Font Creator
  11. See imageloadfont example of what i have done is here
  12. No Close tells the system you finished with the file.. to remove it use unlink($filename);
  13. correction <?php $value = '111111'; $firstVal = $value{0}; ?>
  14. substr() not working ? show some code please can you show what you expect the output to be as i think you mean 111111 to 1 being the first number. but i am not sure!
  15. <?php // now do the rest.../////////////////////////////////////////////////////////////// $query1 = "SELECT * FROM `membership` WHERE `user_class`='Site Administrator'"; $result1 = mysql_query($query1); while ($row = mysql_fetch_array($result1)) { $admin_ids = $row['id']; } ?> translated: 1. find all admins 2. set $admin_ids to the current one 3. next admin 4. if not at end of admin list goto 2 5. $admin_ids = last admin id in the list move // insert into the pms.../////////////////////////////////////////////////////////// $query2 = "INSERT INTO `pms` (`sender_id`,`reciever_id`,`subject`,`pm_message`,`date_added`) VALUES ('$s_id','$admin_ids','$subject','$pm_message',now())"; $result2 = mysql_query($query2); into the loop IE <?php // now do the rest.../////////////////////////////////////////////////////////////// $query1 = "SELECT * FROM `membership` WHERE `user_class`='Site Administrator'"; $result1 = mysql_query($query1); while ($row = mysql_fetch_array($result1)) { $admin_ids = $row['id']; // insert into the pms.../////////////////////////////////////////////////////////// $query2 = "INSERT INTO `pms` (`sender_id`,`reciever_id`,`subject`,`pm_message`,`date_added`) VALUES ('$s_id','$admin_ids','$subject','$pm_message',now())"; $result2 = mysql_query($query2); } ?>
  16. - on upload convert the file to jpg and resize until it meet a size (ie 256kb) if you use dynamic resizing then they may not be cached.. limiting the file size is a good idea.. but alot of people will get confused how to do this.
  17. you mean like this ? <?php $somecontent = "blar"; if($a == "stuff") { $handle = fopen($filename, 'a') if (fwrite($handle, $somecontent) === FALSE) { echo "Cannot write to file ($filename)"; exit; } fclose($handle); } ?>
  18. with zip files i had a ton of problems, (i created the zip on the fly) i used this and it works perfectly <?php $archiveName = "whatever.zip"; if(ini_get('zlib.output_compression')) { ini_set('zlib.output_compression', 'Off'); header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: private",false); header("Content-Type: application/zip"); header("Content-Disposition: attachment; filename=".basename($archiveName).";" ); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".filesize($archiveName)); readfile("$archiveName"); exit; ?> as for readfile vs fread i have had less problems with readfile (try decreaseing the block size on fread, see how that affects it)
  19. Sessions are safer, but expire (based on server settings) you could applie a filter <?php $usernameC = preg_replace('/[^0-9a-z]/i', '', $_COOKIE['my_username_cookie']); $passwordC = preg_replace('/[^0-9a-z]/i', '', $_COOKIE['my_password_cookie']); ?> will change a' or 1=1-- to safer aor11 it will removel everything thats NOT a-z (upper and lower case) or 0-9.
  20. i think your thinking of War of the Worlds Minority Report
  21. My very first idea stop MOST hackers lol
  22. i use MD5(MD5($pass).$SALT) $SALT is also stored in the users login (RANDOM)
  23. echo "Name:" .$personalinfo['Name']. "<br>Age:" .$personalinfo['Age']. "<br>Sex Type:" .$personalinfo['Sex'];
  24. can you change the colour of the text your trying to grab
  25. erm.. no print_r($_COOKIES); or print_r($HTTP_COOKIE_VARS);
×
×
  • 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.