-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
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); ?>
-
[SOLVED] Session var works in FF but not in IE
MadTechie replied to Yesideez's topic in PHP Coding Help
have you tried <?php start_session(); //Added include("db_connect.php"); include("fn_encodestr.php"); include("fn_secureint.php"); //..... -
[SOLVED] Session var works in FF but not in IE
MadTechie replied to Yesideez's topic in PHP Coding Help
well its setting the session, can you post more of the form code please -
[SOLVED] Session var works in FF but not in IE
MadTechie replied to Yesideez's topic in PHP Coding Help
because you would hate to find a simple solution due the amount time spent LOL happens to me all the time.. -
GETTEXT Function-how to implement locatization of website pls help me
MadTechie replied to suma237's topic in PHP Coding Help
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]" -
[SOLVED] Session var works in FF but not in IE
MadTechie replied to Yesideez's topic in PHP Coding Help
captcha script looks ok.. try another file ie test.php <?php session_start(); print_r($_SESSION); die(); ?> -
add <br> after each fetch! total guess req. more info!
-
[SOLVED] PHP Flood Protection scripts that uses flat file databases?
MadTechie replied to RickyF's topic in PHP Coding Help
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. -
[SOLVED] PHP Flood Protection scripts that uses flat file databases?
MadTechie replied to RickyF's topic in PHP Coding Help
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 -
GETTEXT Function-how to implement locatization of website pls help me
MadTechie replied to suma237's topic in PHP Coding Help
something to readup on Localizing PHP web sites using gettext -
GETTEXT Function-how to implement locatization of website pls help me
MadTechie replied to suma237's topic in PHP Coding Help
i want a £10,000,000.. maybe the freelance section is better for this question.. we don't write the code for you!!!! -
I love that idea jitesh, multidimensional array would be a little better but still love the idea:) nice work..
-
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
-
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" />
-
is the 2nd script called announcementprocess.php?
-
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
-
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); ?>
-
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; } }
-
also $rollExcel should be a field name!! BUT it should be $roll = $_SESSION ["roll"]; NOT $roll = $_SESSION ['roll"']; fix that problem...
-
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:)
-
add var_dump($user);//<--this switch($user) it may give you a clue whats wrong!
-
use code tags then maybe someone will help!
-
Add to the end if (preg_match('/q=(.*?)&/i', $ref, $regs)) { $search= $regs[0]; }
-
Can someone explain the following line of code to me ?
MadTechie replied to jini01's topic in Regex Help
here what the code should look like $returnValue = preg_replace('/[^\d]/', '', $text); replace whats NOT (^) digits(\d) with nothing ('') -
$result = preg_replace('/<!-- (.*) -->/si', '<img alt="tag_$1" src="images/exe.gif" class="FCK__TemplateTag" />', $subject); Ahh to last!