Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. or <?php $string = "1.The little fox jumped over a green hedge.2.The hare ate fish.3.The little fox jumped over a green hedge4.Alligator jumped a green hedge.5.The little fox jumped over a green hedge"; print $result = preg_replace('/(?<=.+)(\d\.)/i', "\r\n\$1", $string); ?>
  2. have you tried <?php start_session(); //Added include("db_connect.php"); include("fn_encodestr.php"); include("fn_secureint.php"); //.....
  3. well its setting the session, can you post more of the form code please
  4. because you would hate to find a simple solution due the amount time spent LOL happens to me all the time..
  5. poEdit the main feature is UTF-8 support, for languages "poEdit understands all encodings supported by operating system and works in Unicode internally. [1.1.0]"
  6. captcha script looks ok.. try another file ie test.php <?php session_start(); print_r($_SESSION); die(); ?>
  7. add <br> after each fetch! total guess req. more info!
  8. heres a quick example it may help <?php session_start(); ?> <form method="post"> <textarea name="msg">test</textarea> <input name="submit" type="submit" value="ok"> </form> <?php $delay = 10; //seconds if(isset($_POST['submit'])) { //protection $wait = ($_SESSION['posttime']+$delay) - time(); if(!isset($_SESSION['posttime']) || $wait <=0 ) { $_SESSION['posttime'] = time(); echo $_POST['msg']; }else{ die("flood protections active..<br>wait $wait seconds"); } } ?> Edit: As a side note if you don't use a login system then you can't truely stop flooding, only make it harder.
  9. can you post the code for the flat file system you have.. maybe sessions will work.. set the last post time and refuse posts until x time has passed
  10. something to readup on Localizing PHP web sites using gettext
  11. i want a £10,000,000.. maybe the freelance section is better for this question.. we don't write the code for you!!!!
  12. I love that idea jitesh, multidimensional array would be a little better but still love the idea:) nice work..
  13. Welcome, can you please click solved also the "reason" it wasn't working was becuase the line <input type="submit" name="ok" value="Post!" onClick="disableButton();" /> basically it wasn't posting the OK so i added a hidden one
  14. try if (empty($del_id) && empty($edit_id)) { $output_text = ' <form method="post" action="announcementprocess.php"> <input name="ok" type="hidden" value="test" /> <strong>Title:</strong><br /> note the line <input name="ok" type="hidden" value="test" />
  15. is the 2nd script called announcementprocess.php?
  16. what does this return echo "loggedin="; //<--Added var_dump($loggedin); //<--Added echo "isadmins="; //<--Added var_dump($user['isadmin']); //<--Added echo "POST=";//<--Added print_r($_POST);//<--Added if ($loggedin && $user['isadmin']) { EDIT: oops also add POST
  17. if you post the code you use to create the image we can help.. or just create anothe file called image.php give it a image header and read the image inn.. image.php?src=myimage.jpg you also need the image "watermark.png" (reason for the png is the transparency) <?php header('content-type: image/jpeg'); $watermark = imagecreatefrompng('watermark.png'); $watermark_width = imagesx($watermark); $watermark_height = imagesy($watermark); $image = imagecreatetruecolor($watermark_width, $watermark_height); $image = imagecreatefromjpeg($_GET['src']); $size = getimagesize($_GET['src']); $dest_x = $size[0] - $watermark_width - 5; $dest_y = $size[1] - $watermark_height - 5; imagecopymerge($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, 100); imagejpeg($image); imagedestroy($image); imagedestroy($watermark); ?>
  18. i can't see the logical increase.. how are you working out the zoom compared to the dist! also it would probably be easier to do if ($dist1 >= 0 && $dist1<=600) { $zoom=4000; } if ($dist1 >= 601 && $dist1<=1000) { $zoom=8500; } quicker code being if ($dist1 >= 0 && $dist1<=600) { $zoom=4000; }else{ if ($dist1 >= 601 && $dist1<=1000) { $zoom=8500; } }
  19. also $rollExcel should be a field name!! BUT it should be $roll = $_SESSION ["roll"]; NOT $roll = $_SESSION ['roll"']; fix that problem...
  20. my 2cents <?php $dbs = "SELECT roll, acNumber FROM excelDS WHERE rollAmount ='{$_SESSION['rollAmount']}' AND {$_SESSION['roll']} = '10000'"; ?> or to concatenation <?php $dbs = "SELECT roll, acNumber FROM excelDS WHERE rollAmount ='".$_SESSION['rollAmount']."' AND ".$_SESSION['roll']." = '10000'"; ?> Try them.. and let us know:)
  21. add var_dump($user);//<--this switch($user) it may give you a clue whats wrong!
  22. use code tags then maybe someone will help!
  23. Add to the end if (preg_match('/q=(.*?)&/i', $ref, $regs)) { $search= $regs[0]; }
  24. here what the code should look like $returnValue = preg_replace('/[^\d]/', '', $text); replace whats NOT (^) digits(\d) with nothing ('')
  25. $result = preg_replace('/<!-- (.*) -->/si', '<img alt="tag_$1" src="images/exe.gif" class="FCK__TemplateTag" />', $subject); Ahh to last!
×
×
  • 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.