Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. Well it didn't work at all for me, the problem is probably greediness, I replaced body with message to get it working but you need to be careful when using .* as it grabs as much as it can, try less greedy .*? instead
  2. Remember, you need to workout the XP required to level up, for example, if you have these values Level 1 $maxexp = 100 Level 2 $maxexp = 150 then when you start level 2 it will save 66%, because your XP would be on 100 of 150, (hence 66%) So you will need to get the differences between your current level and the next, So $currentexp should be $currentexp - $previouslevelMaxXP
  3. I'm kinda unsure of the actual question here! The table used is the same one in the SQL statement!
  4. Have you looked in your text file ?
  5. Define, "doesn't work" please show your current code
  6. Here's some code from the manual imagecopyresampled I have slightly tweaked it, <?php //Example #2 Resampling an image proportionally function ResizeJPEG($filename, $width, $height){ list($width_orig, $height_orig) = getimagesize($filename); $ratio_orig = $width_orig/$height_orig; if ($width/$height > $ratio_orig) { $width = $height*$ratio_orig; } else { $height = $width/$ratio_orig; } $image_p = imagecreatetruecolor($width, $height); $image = imagecreatefromjpeg($filename); //JPEG imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); return imagejpeg($image_p, $filename, 100); //JPEG } ?> add the code to the same script and then below echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded, and your information has been added to the directory"; add ResizeJPEG($target, 200, 200); and it will proportionally resize your image to a max height/width of 200
  7. LOL, That's a lot of appreciation for such a small package amount of code,
  8. It depends on exactly what you have an expect, in concept you could just pass the database records ID, then a simple $ID =(int)$_GET['ID']; would work but without knowing what you have its very hard to say anything for sure!
  9. If you have threaded apache then your connection will close when the script terminates, try using non-threaded, however premiso suggestion would be better!
  10. the JS is simple document.title="Your title";
  11. You seam to be missing some code, where is $row['title'] set ?
  12. I have re-written, the code in a format that may help The commented out lines do exactly the same as the new lines below it <?php $colname_chosen_seminar = "-1"; if (isset($_POST['attend'])){ //$colname_chosen_seminar = (get_magic_quotes_gpc()) ? $_POST['attend'] : addslashes($_POST['attend']); if(get_magic_quotes_gpc()){ $colname_chosen_seminar = $_POST['attend'] }else{ $colname_chosen_seminar =addslashes($_POST['attend'] } } mysql_select_db($database_db, $db); //$query_chosen_seminar = sprintf("SELECT * FROM seminar WHERE id = %s", $colname_chosen_seminar); $query_chosen_seminar = "SELECT * FROM seminar WHERE id = '".$colname_chosen_seminar."' "; $chosen_seminar = mysql_query($query_chosen_seminar, $db) or die(mysql_error()); $row_chosen_seminar = mysql_fetch_assoc($chosen_seminar); $totalRows_chosen_seminar = mysql_num_rows($chosen_seminar); Now get_magic_quotes_gpc checks to see if "Magic Quotes" are turned on, on the server, (this automatically add's slashes to strings, So the code check to see if they are on, if they are then it doesn't addslashes, if are are NOT on then it does addslashes As for the sprintf it gets the parameter and put it in a string format where the %s is, Now my comments.. if the $_POST['attend'] is a number (i assume it is ad MOST ID's are and its not been quoted in the SQL statement) then i would do this <?php //if $_POST['attend'] is not set or 0 then set it to -1 else convert to int and user it $colname_chosen_seminar = (empty($_POST['attend']))?-1:(int)$_POST['attend']; mysql_select_db($database_db, $db); //Use the number for the ID $query_chosen_seminar = sprintf("SELECT * FROM seminar WHERE id = %d", $colname_chosen_seminar); $chosen_seminar = mysql_query($query_chosen_seminar, $db) or die(mysql_error()); $row_chosen_seminar = mysql_fetch_assoc($chosen_seminar); $totalRows_chosen_seminar = mysql_num_rows($chosen_seminar); Hope that helps
  13. Please Read RULE #17!
  14. Why are you using FTP instead of HTTP to get the images ? multiple connection from the same IP could cause this problem (depends on how the FTP is setup)
  15. Can't see any logical problems, what's not being inserted, This basically need some debugging, you need to know the problem exists before you can workout how to fix it!
  16. Yeah it stinks!
  17. Humm one didn't appear! (moved it)
  18. Wrong section for Urgent and wrong section for requesting code
  19. MySQL encryption functions Simple option is, INSERT INTO table (Phone) VALUES ('ENCODE("Hello World","Password") '); SELECT DECODE(Phone,'Password') as DecodedPhone, Phone FROM table Or encrypt/decrypt the data prior insert and display via PHP
  20. OKay try this
  21. Coolie, I'll take all the credit Not forgetting cags & salathe who pointed out issue and solutions.
  22. I had an old PC for friends kids to use, basically ubuntu, Instead of seeing my code replaced with <?php class orders{ fucntion __coneuhf weukdf fsdhfksdf f sdf sda fafhjsdfhasdjkfhjksa :) :) :) :) :) :) :) :) :) _______________________________________________ _____________________________________________________________ } ?>
  23. I could be wrong but 133MHz CL3 SDRAM only goes up to 512Mb, so do you have 4 DIMM slots ? try eBay (<-- added search link)) but be careful some will sell 512MB but its 2x256) so double check
  24. [ot]No no, I'm sure it will resolve itself [/ot]
  25. Well if you got £10 then What's the spec on the PC ? and what are you going to use it for? you may not need the memory!
×
×
  • 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.