Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. Compare the line in my last post.. I believe you have entered it incorrectly
  2. oops $sql = sprintf("SELECT * FROM music WHERE musicartist LIKE '%s%' AND musicid !=%d ORDER BY `musicartist` ASC LIMIT 0,6",mysql_real_escape_string($name2), $_GET['v']); $s = mysql_query($sql) or die(mysql_error()); should be $sql = sprintf("SELECT * FROM music WHERE musicartist LIKE '%%s%' AND musicid !=%d ORDER BY `musicartist` ASC LIMIT 0,6",mysql_real_escape_string($name2), $_GET['v']); $s = mysql_query($sql) or die(mysql_error()); (missed a %)
  3. To do that see imagecopy in the manual, it has examples here's an example (untested) but should help you on your way.. (of course your need a.png and b.png) and it assumes the hight is 50px (if its bigger change the 50's to whatever (you may also want to change the 200 to a larger number) <?php //Blank image $dest = imagecreatetruecolor(200, 50); $gap = 2; $X = 0; //get Letter A $src = imagecreatefrompng('a.png'); getimagesize('a.png',$info); //Put image letter A on Blank Image imagecopy($dest, $src, 0, 0, $X, 0, $info[0], 50); imagedestroy($src); //Next letter $X = $X+$info[0]+$gap; //get Letter B $src = imagecreatefrompng('b.png'); getimagesize('b.png',$info); //Put image letter B on Blank Image imagecopy($dest, $src, 0, 0, $X, 0, $info[0], 50); imagedestroy($src); //done display image // Output and free from memory header('Content-Type: image/png'); imagegif($dest); imagedestroy($dest); ?>
  4. okay forget the writing text to the image, what you need to do is place images on top of images. what part is unclear ?
  5. Okay your need to update the query, from $s = mysql_query("SELECT * FROM music WHERE musicartist LIKE '".$name2."%' ORDER BY `musicartist` ASC LIMIT 0,6") or die(mysql_error()); to $sql = sprintf("SELECT * FROM music WHERE musicartist LIKE '%s%' AND musicid !=%d ORDER BY `musicartist` ASC LIMIT 0,6",mysql_real_escape_string($name2), $_GET['v']); $s = mysql_query($sql) or die(mysql_error()); that will list all songs except the one selected as for the cookie, add the following code at the start $cookie_name = "user_id"; $cookie_time = 60*60*24*7; // 1 week that should set the cookie to user_id and expire a week later
  6. cool, At least it will give your keyboard a rest from the beating!
  7. To solved the cookie problem, tell me what the name of the cookie is, and where you set that name.. when you can do that you will also solve the problem 3. i don't see the problem albums are correct and the names (look the same) but ones a ultrabeat mix!
  8. If its just an effect it will be quicker to create or get a custom font..if the letter are out the scoop of a normal font (it colours etc) then you will need to use something like imagecopy basically you add an image on top of another time, I'll suggest you name all of the files to the same as the image letter. it A.png = the image of the letter A etc etc Then create or load the background image as the destination image, then do something like this 1. (prep) $x=0;$gap=1;breakup string into letters (array) 2. get the width of the image letter (used later) getimagesize ($last_width) 3. load letter image as source imagecreatefrompng 4. put destination image on source image, (dst_x = $x) 5. $x=$x+$last_width+$gap; 6. goto 2. (repeat with all letters)
  9. 1. echo "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; 2. setcookie ($cookie_name, 'usr='.$email.'&hash='.$pass, time() + $cookie_time); $cookie_name hasn't been set.. thus it has no name
  10. No, you need the quotes to tell SQL your searching for a string, BUT the string can NOT have a quote in it, when you search for SELECT * from users WHERE family='Da Corleone's' the system read its as SELECT * from users WHERE family='Da Corleone' then the system sees s' thats not valid SQL.. hence the error So you need to tell the system that the quote IN is PART OF the string to do that you escape it ie Da Corleone\'s Now theirs a function to do that for you.. replace the line with $sql2="SELECT * from users WHERE family='".mysql_real_escape_string($famname2)."'";
  11. $src_x & $src_y are the X & Y position of the source image X = from the left Y = from the top now just say you have 2 images, and I wish to put image S on top of image D, these allow me to say where the top left of image S start.. ie image D has a height of 500 and width of 500 image S has a height of 100 and width of 400 and i want Image S to be in the middle of image D, I would set the $src_x to 50 and $src_y to 200 Now just say Image D was 500x500, but image $dst_w and $dst_h, just resize to to whatever size Hope that makes sense!
  12. It makes perfect sense.. let me explain in this query what am i searching for ? remember you need to quote the string your searching for SELECT * from users WHERE family='MadTechie's' AND Firstname = 'this is a 'quote' test' So you could say i am searching for 'MadTechie' and 'this is a ' but then we have some invalid SQL commands What does s' do ? and for that matter what's quote' test' theirs not command called quote? Now to make SQl understand that mean find 'MadTechie's' you need to let it know that the quote is part of the string and not ending the string, to do that you need to escape it with a slash, ie SELECT * from users WHERE family='MadTechie\'s' AND Firstname = 'this is a \'quote\' test' Now you can use addslashes, or mysql_real_escape_string, i recommend mysql_real_escape_string as its part of the sql pack and prevents SQL injection here's an example $sql2="SELECT * from users WHERE family='".mysql_real_escape_string($famname2)."'";
  13. preg_match is a little over kill for this, i would use stripos for example (untested) // if description is not empty and available is greater than 0 and description does not contain seedlings or discount if(!empty($description) && $available >0 && stripos($description, 'seedlings') === false && stripos($description, 'discount') === false){ mysql_query("INSERT INTO `availability` VALUES ('','$description','$available','$price')"); }
  14. Sounds like an SQL error, what line is 205 update $sql2="SELECT * from users WHERE family='$famname2'"; $result2=mysql_query($sql2); $num=mysql_num_rows($result2); to $sql2="SELECT * from users WHERE family='$famname2'"; $result2=mysql_query($sql2) or die($sql2."<br>\n".mysql_error()); //updated $num=mysql_num_rows($result2); this should give you an error that it a little more helpful
  15. just concatenate it where ever you echo the $errors.
  16. I would assume that the time would from AOL would be the amount of time they have been away for. 1 = 1 second 120 = 2 minutes etc. in that case, you could only really get a true time by pulling the xml every few minutes to check if they are still away
  17. Their is quite a few ways to do this, and it depends on that you wish to do with the data, Now the XML path would be ytmnd_response / users / user / recent_sites / site / title So you cab use xpath like this, <?php $XMLfile = <<<EOD <?xml version="1.0" encoding="UTF-8"?> <ytmnd_response timestamp="2009-11-09T21:01:33-06:00" request_type="user" extended_request="recent_sites" returned_results="1"> <users> <user user_id="1" user_name="max" signup_date="2004-04-06T18:36:06-05:00" last_active="2009-11-09T19:58:21-06:00"> <recent_sites> <site site_id="902163" domain="comparingmyselftojesus" created="2009-02-23T22:24:05-06:00" modified="2009-02-25T01:01:16-06:00"> <title>dying for your sins</title> <score computed_score="3.9563" total_votes="206" vote_sum="815" score_image="stars_red_40.gif"/> </site> <site site_id="897212" domain="MALLCOP" created="2009-01-15T03:48:42-06:00" modified="1969-12-31T18:00:00-06:00"> <title>MALL COP WITH PAUL BLART</title> <moderated work_safe="true"/> <score computed_score="4.071" total_votes="310" vote_sum="1262" score_image="stars_red_41.gif"/> </site> <site site_id="846996" domain="fingersmoke" created="2008-02-18T13:58:25-06:00" modified="1969-12-31T18:00:00-06:00"> <title>finger smoke</title> <moderated work_safe="true"/> <score computed_score="3.648" total_votes="375" vote_sum="1368" score_image="stars_red_36.gif"/> </site> <site site_id="796444" domain="trend" created="2007-08-02T06:08:01-05:00" modified="1969-12-31T18:00:00-06:00"> <title>totally 100% trend</title> <moderated work_safe="true"/> <score computed_score="3.8403" total_votes="695" vote_sum="2669" score_image="stars_red_38.gif"/> </site> <site site_id="768866" domain="myrelationship" created="2007-05-25T22:49:37-05:00" modified="2007-07-01T21:38:08-05:00"> <title>the captain always goes down with his ship</title> <score computed_score="4.0567" total_votes="652" vote_sum="2645" score_image="stars_red_41.gif"/> </site> </recent_sites> </user> </users> </ytmnd_response> EOD; $xml = new SimpleXMLElement($XMLfile); $result = $xml->xpath('/ytmnd_response/users/user/recent_sites/site/title'); while(list( , $node) = each($result)) { echo "$node\n"; } hope that helps (3:30am.. I'm off to sleep)
  18. No, I mean can you give me an example of what it suppose to do, basically this part id unclear The problem is 12086 is a time stamp, not a date stamp.. so are you only working on a day by day basis ? if that's true then you could do this:~ date_default_timezone_set('UTC'); echo date("H:i:s",time()-$time); but i think i am missing something!
  19. Yay okay if this is solved please click topic solved (bottom left) Note: you can unsolve it if needed!
  20. can you give me an example of what your trying to do
  21. What about Zend Optimizer(meah) , APC, also memcached was ported to windows http://labs.northscale.com/memcached-packages/
  22. It won't work because its has no way of linking back to the sid, I'm sorry but i don't have a very clear picture, of how your system should work.. it does seam like its becoming spaghetti code. this maybe a good time to take a step back and review it as a whole!
  23. okay to update the time, you need to do 2 things 1. update the form from <input type="gametime[]" value="<? echo $better_gametime ?>" size="10"> to (PS i assume type should of been name) <input name="gametime[<?php echo($sid); ?>]" value="<? echo $better_gametime ?>" size="10"> 2. grab the new value list($schedule_id,$fld,$better_gametime,$team) = explode('|',$key); $better_gametime = $_POST['gametime'][$schedule_id]; //<---ADD this line Okay this is kinda strange as you are pulling the value twice but the exploded one is static so you replace it with the dynamic one
  24. Okay well i got all that from the code! Your example is missing the png header! (as stated) you could just add an if statement, ie if($s_key == "att"){ imagestring($image, $fsize, 20, 10, $value[1], $fcolour); continue; } if($s_key == "def"){ imagestring($image, $fsize, 30, 40, $value[1], $fcolour); continue; } imagestring($image, $fsize, $x[$row], $y[$column], $value[1], $fcolour);
  25. not a lot of coding but it kinda hard to workout what you want, breaking up the text block into parts then moving each part kinda lacks in detail.. what is the text your dealing with ? what does it look like at the moment? what are you trying to achieve ?
×
×
  • 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.