-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
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
-
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
-
I'm kinda unsure of the actual question here! The table used is the same one in the SQL statement!
-
Have you looked in your text file ?
-
UPLOAD AND RESIZE IMAGES TO SERVER then link with MYSQL
MadTechie replied to andrew101's topic in PHP Coding Help
Define, "doesn't work" please show your current code -
UPLOAD AND RESIZE IMAGES TO SERVER then link with MYSQL
MadTechie replied to andrew101's topic in PHP Coding Help
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 -
LOL, That's a lot of appreciation for such a small package amount of code,
-
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!
-
If you have threaded apache then your connection will close when the script terminates, try using non-threaded, however premiso suggestion would be better!
-
the JS is simple document.title="Your title";
-
You seam to be missing some code, where is $row['title'] set ?
-
Could somebody please explain this drop down driven page to me?
MadTechie replied to spenceddd's topic in PHP Coding Help
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 -
Please Read RULE #17!
-
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)
-
problem with inserting data in mysql using php
MadTechie replied to Rahmi's topic in PHP Coding Help
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! -
Yeah it stinks!
-
Humm one didn't appear! (moved it)
-
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
-
OKay try this
-
Coolie, I'll take all the credit Not forgetting cags & salathe who pointed out issue and solutions.
-
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 :) :) :) :) :) :) :) :) :) _______________________________________________ _____________________________________________________________ } ?>
-
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
-
[ot]No no, I'm sure it will resolve itself [/ot]
-
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!