Jump to content

ozestretch

Members
  • Posts

    237
  • Joined

  • Last visited

Everything posted by ozestretch

  1. I would stick to: <img src="?op=view&imgdata=".$_GET['imgdata']."
  2. This works fine for me <?php $i=0; while($i<3) { /* * we will change this to check it */ if(isset($somethingthatdoesnotexist)) { //THIS BIT WORKS - but wont now echo '<label class="description" for="element_11"><img src="images/green_tick.gif" width="18" height="18"> You have selected ' . $det['name'] . '.</label>'; echo '<input id="busid" name= "busid" class="element text" maxlength="255" size="8" value="' . $det['id'] . '" type="hidden"/>'; echo '<input id="busname" name= "busname" class="element text" maxlength="255" size="8" value="' . $det['name'] . '" type="hidden"/><div></div>'; } else { //THIS DONT (JAVASCRIPT:AUTOSUGGEST()) IS WHAT ISNT WORKING. /* * * THIS BIT IS ACTUALLY BEING OUTPUTTED RIGHT?? * lets check by changing something above ^^^^^^^^^^^ */ $echo '<label class="description" for="element_11">Type To Search: </label><div><input name="search-q" id="search-q" type="text" class="element text medium" value="" onkeyup="javascript:autosuggest()"/></div>'; } $i++; } ?> so I guess you know where to look
  3. So have... found a little snippet you might be able to use: <?php //=========== change the text to display in the image $text = $_GET['text']; $font = 'arial.ttf'; $imgfile = $_GET['imgfile']; $ext=substr($imgfile,-3); $ext=strtolower($ext); if($ext=="jpg" || $ext=="jpe") $im=@imagecreatefromjpeg("$imgfile"); elseif ($ext=="gif") $im=@imagecreatefromgif("$imgfile"); else {print "Unknown image format"; exit;} if (!$im) { /* See if it failed */ $im = ImageCreate (200, 100); /* Create a blank image */ $bgc = ImageColorAllocate ($im, 255, 255, 255); $tc = ImageColorAllocate ($im, 0, 0, 0); ImageFilledRectangle ($im, 0, 0, 150, 30, $bgc); /* Output an errmsg */ ImageString($im, 1, 5, 5, "Error loading $imgfile", $tc); return $im; } $x=imagesx($im); $y=imagesy($im); $fontsize=$x/20; $fontsize=floor($fontsize); if($fontsize<20) $fontsize=20; $black = imagecolorallocate($im, 100, 100, 100); /* * Add this */ $tb = imagettfbbox($fontsize, 0, $font, $text); $x = ceil((200 - $tb[2]) / 2); // lower left X coordinate for text imagettftext($im, $fontsize, 0, $x, 150, $white, $font, $text); // write text to image /* * End Add */ // comment this out // imagettftext($im, $fontsize, 0, 0, 150, $white, $font, $text); if($ext=="gif") { header("Content-type: image/gif"); imageGIF($im); } else { header("Content-type: image/jpeg"); imagejpeg($im); } imagedetroy($im); ?>
  4. So the second choice of the else statement is returned at some point? <?php while($det = mysql_fetch_array($Dets)) { /* * we will change this to check it */ if(isset($somethingthatdoesnotexist)) { //THIS BIT WORKS - but wont now echo '<label class="description" for="element_11"><img src="images/green_tick.gif" width="18" height="18"> You have selected ' . $det['name'] . '.</label>'; echo '<input id="busid" name= "busid" class="element text" maxlength="255" size="8" value="' . $det['id'] . '" type="hidden"/>'; echo '<input id="busname" name= "busname" class="element text" maxlength="255" size="8" value="' . $det['name'] . '" type="hidden"/><div></div>'; } else { //THIS DONT (JAVASCRIPT:AUTOSUGGEST()) IS WHAT ISNT WORKING. /* * * THIS BIT IS ACTUALLY BEING OUTPUTTED RIGHT?? * lets check by changing something above ^^^^^^^^^^^ */ echo '<label class="description" for="element_11">Type To Search: </label><div><input name="search-q" id="search-q" type="text" class="element text medium" value="" onkeyup="javascript:autosuggest()"/></div>'; } } ?>
  5. Yarr be a wee scallywag but amiss yee not ie: thanks
  6. lmao, didn't mention it was not being displayed at all That line echo '<label class="description" for="element_11">Type To Search: </label><div><input name="search-q" id="search-q" type="text" class="element text medium" value="" onkeyup="javascript:autosuggest()"/></div>'; displays fine on my server... does this if(isset($det['name']) && isset($_GET['busid'])) { actually return false at any stage?
  7. have you tried to echo it only once? (one loop) Or does it fault regardless of single field use or multiple field use
  8. Must be onClick that doesn't need it. Do you have variables in the function call? eg: onkeyup="autosuggest('var1',this.value);"
  9. does it need to have 'javascript:' part? echo '<label class="description" for="element_11">Type To Search: </label><div><input name="search-q" id="search-q" type="text" class="element text medium" value="" onkeyup="autosuggest();" /></div>'; I also assume that actual function is coded somewhere I couldn't see
  10. Can't see where you are checking if $y<$y1 also check if $y1<$y and return an error as departure can not be before arrival
  11. Something to consider would be sorting the songs prior to inserting into the table initially
  12. I am not good with expressions, but try this <? $s1 = '13.61sd'; $s2 = '25.21ed'; if (preg_match('/^[0-9]{2}.[0-9]{2}sd/',$s1) && preg_match('/^[0-9]{2}.[0-9]{2}ed/',$s2)) { $s1A=str_replace('sd','ed',$s1); $s2A=str_replace('ed',sd',$s2); } echo $s1A; ?> if not, try asking in http://www.phpfreaks.com/forums/index.php/board,43.0.html
  13. Was my first thought when I seen the text to the left. Don't think you have posted that part of the code yet
  14. Even though it is not being inserted into the database, it is in the query itself... which is where an injection occurs! Is a common mistake to think that, but must make sure it is always made safeĀ® when using in the query. What you have is safe.... and can do more to make it safeĀ®, just depends where you want to draw the line. function safedata($variable ){ $variable = htmlentities($variable, ENT_QUOTES); if (get_magic_quotes_gpc()) { $variable = stripslashes($variable); } $variable = mysql_real_escape_string(trim($variable)); $variable = strip_tags($variable); $variable = str_replace("\r\n", "", $variable); return $variable; }
  15. Forgot the change of $text to $_POST['text'] below <html> <head> <title>News Bulletin</title> </head> <body style="font-family: Arial; font-size: 10pt"> <p><b></b><br> Add caption to the image </p> Type text here <form method="POST" action="index.php"> <input type="text" name="text" size="20" maxlength="50"><br> <input type="submit" value="Submit" name="submit"> </form> <br> <?php $imgfile="newsheader.jpg"; if (isset($_POST['text'][0])) print "<img border='0' align=center src='img.php?imgfile=newsheader.jpg&text=".$_POST['text']."' width='720' height='212'>"; else print "<img border='0' align=center src='newsheader.jpg' width='720' height='212'>"; ?> </body> </html> and then in second part comment out $text = $_GET['text']; //$imgfile="newsheader.jpg"; $font = 'arial.ttf';
  16. okay, good now change $text = 'mydomain.com'; to $text = $_GET['text'];
  17. I am assuming it is not getting $text either. //=========== change the text to display in the image $text = 'mydomain.com'; $imgfile="newsheader.jpg"; uncomment like above, see if it displays the image with the text 'mydomain.com'
  18. php">.'$row['user should be php">'.$row['user decimal in wrong spot
  19. $ext=substr($imgfile,-3); to $imgfile = $_GET['imgfile']; $ext=substr($imgfile,-3);
  20. haha I am soooo sorrryyyyy. well, you should be too $restult = mysql_query($sql_disp); or die(mysql_error()); while($row = mysql_fetch_array($result)) { change to $result = mysql_query($sql_disp); or die(mysql_error()); while($row = mysql_fetch_array($result)) {
  21. $text has not been assigned yet. $text = $_POST['text']; print "<img border='0' align=center src='img.php?imgfile=newsheader.jpg&text=$text' width='720' height='212'>";
×
×
  • 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.