Jump to content

Daney11

Members
  • Posts

    301
  • Joined

  • Last visited

    Never

Everything posted by Daney11

  1. Thankyou again for your reply. $size = getimagesize($i); if($size[0] > 500){ $w=500; $h = $size[1] * ($w/ $size[0]); }else{$w=$size[0];$h=$size[1];} $Text = preg_replace("/\[img\](.+?)\[\/img\]/", '<img src="$1" width="'.$w.'" hight="'.$h.'">', $Text); is not working. The images are the same That is posted in my BBCode
  2. Thankyou for you reply. The image is linked from other websites for example [im g]http://www.site.com/image.jpg[/im g] So i need to know how to resize the image inside the table when using the [im g] tags in bbcode.
  3. Hey guys, Im using BBCode $Text = preg_replace("/\[im g\](.+?)\[\/im g\]/", '<img src="$1">', $Text); And when i use [im g]imageurl[/im g] it works fine.. however if the image width is say over 510px and my table is only 510px the table streches..... I need to know how to make it so the image resizes down to say 500px width.. Thanks
  4. FIXED Cross Site Scripting: You can submit ">code when creating a private message. FIXED - Was this on the sponsor modify? URL part? Cross Site Scripting: You can submit ">code when creating a sponsor. FIXED Cross Site Scripting: You can submit ">code when editing and creating news. FIXED Cross Site Scripting: You can submit ">code when using the forgot password page. This is being created.. activation.php on either two.nexiv.co.uk or two.team-who.co.uk doesn't exist. FIXED SQL Error: http://two.team-who.co.uk/news_more.php?news_id=83&page=a Quote You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-10, 10' at line 1 FIXED SQL Error: http://two.team-who.co.uk/members.php?page=a Quote You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-10, 10' at line 1 HTML Email being fixed. 2 Questions: How do i fixed the captcha. Full Path Disclosure: http://two.team-who.co.uk/CaptchaSecurityImages.php?width Quote Warning: imagecreate(): Invalid image dimensions in /home/www/teamoywho/CaptchaSecurityImages.php on line 27 Full path disclosure http://two.team-who.co.uk/CaptchaSecurityImages.php?width=1p <?php session_start(); class CaptchaSecurityImages { var $font = 'arial.ttf'; function generateCode($characters) { /* list all possible characters, similar looking characters and vowels have been removed */ $possible = '23456789AaBbCDdEeFfGgHhJjKLMmNnPQqRrSTtUVWXYyZ'; $code = ''; $i = 0; while ($i < $characters) { $code .= substr($possible, mt_rand(0, strlen($possible)-1), 1); $i++; } return $code; } function CaptchaSecurityImages($width='120',$height='40',$characters='6') { $code = $this->generateCode($characters); /* font size will be 50% of the image height */ $font_size = $height * 0.50; $image = imagecreate($width, $height) or die('Cannot initialize new GD image stream'); /* set the colours */ $background_color = imagecolorallocate($image, 000, 000, 000); $text_color = imagecolorallocate($image, 250, 250, 250); $noise_color = imagecolorallocate($image, 000, 000, 000); /* generate random dots in background */ for( $i=0; $i<($width*$height)/3; $i++ ) { imagefilledellipse($image, mt_rand(0,$width), mt_rand(0,$height), 1, 1, $noise_color); } /* generate random lines in background */ for( $i=0; $i<($width*$height)/150; $i++ ) { imageline($image, mt_rand(0,$width), mt_rand(0,$height), mt_rand(0,$width), mt_rand(0,$height), $noise_color); } /* create textbox and add text */ $textbox = imagettfbbox($font_size, 0, $this->font, $code) or die('Error in imagettfbbox function'); $x = ($width - $textbox[4])/2; $y = ($height - $textbox[5])/2; imagettftext($image, $font_size, 0, $x, $y, $text_color, $this->font , $code) or die('Error in imagettftext function'); /* output captcha image to browser */ header('Content-Type: image/jpeg'); imagejpeg($image); imagedestroy($image); $_SESSION['security_code'] = $code; } } $width = isset($_GET['width']) && $_GET['height'] < 600 ? $_GET['width'] : '120'; $height = isset($_GET['height']) && $_GET['height'] < 200 ? $_GET['height'] : '40'; $characters = isset($_GET['characters']) && $_GET['characters'] > 2 ? $_GET['characters'] : '6'; $captcha = new CaptchaSecurityImages($width,$height,$characters); ?> Thanks for all your help guys. *All errors have been fixed on my local machine and wont be viewable online at the moment.
  5. Hey guys, Could you beta test my site please. This will be the first run of beta testing. http://two.team-who.co.uk Username: demo@demo.com Password: milkshake *Please note that the registration email link will not work and the user demo has level 5 access, they can do everything
  6. <!-- data start --> <table width="850" border="0" cellspacing="0" cellpadding="0"> <?php // let's get some data include('adminconnect.php'); $query = "SELECT ProductNo,ProductName,Dispay,Price FROM Product"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)) { // loop through and display ?> <tr align="left"> <td width="33"> </td> <td width="82"><a class="black"><?php echo $row['ProductNo'];?></a></td> <td width="61"><?php echo $row['ProductName'];?></td> <td width="61"><?php echo $row['Display'] ;?></td> <td width="230"><?php echo $row['Price'];?></td> </tr> <? } ?> </table>
  7. Price <input name="Price" type="text" id="Price"> should be Price <input name="price" type="text" id="Price">
  8. and on http://www.richdgrimes.co.uk/phptest/newbook.html change the name of the price field from Price to price, all lowercase
  9. try if ($isbn == NULL || $author == NULL || $title == NULL || $price == NULL)
  10. for the 100 people who viewed this topic and had no clue i found out agter 7 hours of testing. if($_POST['delete']){ for($i=0;$i<$total_results;$i++){ $del_id = $_POST['delete_mail'][]; $sql = "DELETE FROM mail WHERE mail_id='$del_id'"; $resulta = mysql_query($sql) or die(mysql_error()); } if($resulta){ echo "lol"; } } }
  11. Im using http://www.phpeasystep.com/mysqlview.php?id=8 and that is wrong, that doesnt work.
  12. Because im using a hidden field called submitted which is true. So i dont need an action in form.
  13. Im sure someone from PHPFreaks knows how to mass delete from checkboxes.
  14. Anyone got any checkbox code then can post for me to look at?
  15. Im now using var_dump($_POST['delete_mail']); if (isset($_POST['submitted'])) { foreach ($_POST['delete_mail'][] as $del_id => $checked) { $sql = "DELETE FROM mail WHERE mail_id = '$checked'"; //$result = mysql_query($sql) or die(mysql_error()); } if($result) { echo $sql; //echo '<META HTTP-EQUIV=Refresh CONTENT="1">'; } } When i var_dump i get. array(1) { [0]=> string(2) "20" } array(2) { [0]=> string(2) "20" [1]=> NULL } I have 2 mails, mail_id 20 and mail_id 25. When i select both its not picking up the 25 in the array. When i click on mail_id 20 i get array(1) { [0]=> string(2) "20" } array(2) { [0]=> string(2) "20" [1]=> NULL } When i just click on mail_id 25 which is the bottom entry i get NULL array(1) { [0]=> NULL } Any ideas?
  16. ive googled some examples but get nothing what im looking for, can anyone link me to a tutorial if no one knows how to fix this? Thankyou
  17. actaully, this still isnt working, its only allowing me to delete the top entry only. ive tested everything and even var_dumped everything. using var_dump the top entry gives me a value but the entrys below that dont give me nothing.
  18. this if (isset($_POST['submitted'])) { for($i=0;$i<$totalmail;$i++){ $del_id = $_POST[delete_mail][$i]; $sql = "DELETE FROM mail WHERE mail_id = '$del_id'"; $result = mysql_query($sql) or die(mysql_error()); } } works, thanks anyways guys
  19. Im now using if (isset($_POST['submitted'])) { for($i=0;$i<$totalmail;$i++){ $del_id = $delete_mail[$i]; $sql = "DELETE FROM mail WHERE mail_id = '$del_id'"; $result = mysql_query($sql) or die(mysql_error()); } if($result){ echo $sql; } } With a hidden submit field and now im getting.. DELETE FROM mail WHERE mail_id = '' So the ID is not being sent, however the values of the checkboxes are correct and when i view source code the values are there....
  20. <td width="20" height="21" align="left" valign="middle" class="text" bgcolor="<?php echo $color ?>"><input name="delete_mail[]" id="delete_mail[]" type="checkbox" value="<?php echo $mail_id ?>" /></td> I already did, 3rd from last line
  21. Hey guys, This is my form. <form method="post" action=""> <table width="508" cellpadding="0" cellspacing="0" align="center" class="news-table"> <tr> <td width="254" height="21" bgcolor="#535459"> <a href="mail_compose.php">[Create New Mail]</a></td> <td width="254" height="21" bgcolor="#535459" align="right"><input name="delete" type="submit" id="delete" value="Delete"> </td> </tr> </table> <table width="508" cellpadding="0" cellspacing="0" align="center"> <tr> <td height="1"><img src="images/spacer.gif"></td> </tr> </table> <table width="508" cellpadding="0" cellspacing="0" border="0" align="center" class="sponsor_more-table"> <tr> <td width="20" height="21" align="left" valign="middle" class="text"> </td> <td width="100" height="21" align="left" valign="middle" class="boldtext"> From:</td> <td width="140" height="21" align="left" valign="middle" class="boldtext"> Date:</td> <td width="228" height="21" align="left" valign="middle" class="boldtext"> Subject:</td> <td width="20" height="21" align="left" valign="middle" class="text"><input name="delete_mail" type="checkbox" value="" /><input type="hidden" name="submitted" value="TRUE"></td> </tr> </table> <link href="style/layout1_style.css" rel="stylesheet"> <table width="508" height="1" cellpadding="0" cellspacing="0" border="0" align="center"> <tr> <td><img src="images/spacer.gif" height="1"></td> </tr> </table> <table width="508" cellpadding="0" cellspacing="0" border="0" align="center" class="sponsor_more-table"> <?php // Colours For Different Positions $color = '#73757b'; $color1 = '#535459'; $color = ($row_count % 2) ? $color : $color1; if ($mail_read == 'Unread') { $mail_image = '<img src="misc/new_mail.gif">'; } else { $mail_image = '<img src="misc/old_mail.gif">'; } if (strlen($mail_from) > 11 ) { $totalchars = 11; $mail_from = substr($mail_from,0,$totalchars). "..."; } ?> <tr> <td width="20" height="21" align="left" valign="middle" class="text" bgcolor="<?php echo $color ?>"> <?php echo $mail_image ?></td> <td width="100" height="21" align="left" valign="middle" class="text" bgcolor="<?php echo $color ?>"> <a href="member.php?member_id=<?php echo $member_id ?>"><?php echo $mail_from ?></a></td> <td width="140" height="21" align="left" valign="middle" class="text" bgcolor="<?php echo $color ?>"> <?php echo $mail_date ?></td> <td width="228" height="21" align="left" valign="middle" class="text" bgcolor="<?php echo $color ?>"> <a href="mail_read.php?mail_id=<?php echo $mail_id ?>"><?php echo $mail_subject ?></a></td> <td width="20" height="21" align="left" valign="middle" class="text" bgcolor="<?php echo $color ?>"><input name="delete_mail[]" id="delete_mail[]" type="checkbox" value="<?php echo $mail_id ?>" /></td> </tr> </table> </form> And im using if($delete){ for($i=0;$i<$total_results;$i++){ $del_id = $delete_mail[$i]; $sql = "DELETE FROM mail WHERE mail_id='$del_id'"; $resulta = mysql_query($sql) or die(mysql_error()); } if($resulta){ echo "lol"; } } But nothing is getting deleted. Im getting no errors or nothing. The values are correct inside the checkboxes etc. the php is at the top of the script.
  22. Ive got it working now Im using <select class="forminput" name="server_game"> <?php $gamequery = "SELECT * from `games` WHERE `game_active`='Yes' ORDER BY `game_name` ASC"; $gameresult = mysql_query($gamequery, $connect) or die(mysql_error()); while($row_games=mysql_fetch_array($gameresult)){ echo "<option value=\"{$row_games['game_name']}\""; echo ">{$row_games['game_name']}</option>\n"; } ?> </select> Thanks anyway guys.
  23. when i add the or die bit my page breaks and doesnt show me an error. :S and the page stays as it is after posting.
  24. Hey guys Im currently using <select class="forminput" name="server_game"> <?php $gamequery=mysql_query("SELECT * from `games` WHERE `game_active`='Yes' ORDER BY `game_name` ASC"); while($row_games=mysql_fetch_array($gamequery)){ echo "<option value=\"{$row_games['game_name']}\""; echo ">{$row_games['game_name']}</option>\n"; } ?> </select> It works fine but after the form has been submitted, the options dissappear..... Any ideas?
×
×
  • 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.