116 Posted Topics

Member Avatar for sarithak

Hi there, I've got this code for creating thumbnails, i'm not sure if it's what you're looking for but here it is: [code=php] function createThumb($imageDirectory, $imageName, $thumbDirectory) { $ext = strtolower(substr($imageName, strrpos($imageName, '.'))); if (($ext == "jpg") || ($ext == "jpeg")) { if(function_exists('imagecreatefromjpeg')) { $srcImg = imagecreatefromjpeg("$imageDirectory/$imageName"); $originalWidth = imagesx($srcImg); …

Member Avatar for praveen_dusari
0
149
Member Avatar for inabahtrg

Hi there, I think that the problem may lie in your javascript, try changing the parameter of the eval() function to: [code] targ+".location='"+selObj.options[selObj.[B]options[/B].selectedIndex].value+"'" [/code]

Member Avatar for Will Gresham
0
166
Member Avatar for Niccloud

Hi there, Have you tried running your sql statement straight through your SQL command interface (like phpMyAdmin). If that returns no errors, try adding some error catching as follows and check the results: [code=php] $query = 'SELECT * FROM `security` LIMIT 0 , 30'; $result = mysql_query($query, $conn); if (mysql_numrows($result) …

Member Avatar for Menster
0
292
Member Avatar for thompson007

Hi there, If efficiency is what you are after, I don't think your above code is your best bet. I personally prefer to write the SQL statements myself, and execute them with a simple "query()" function on my Data Access Object (which figures out what type of db I'm working …

Member Avatar for Menster
0
100
Member Avatar for ervine

Hi there, It depends what you want to do with the e-mail address, but your best (and easiest) option would just be to use strtr. for a full breakdown of the function go to [URL="http://us2.php.net/manual/en/function.strtr.php"]http://us2.php.net/manual/en/function.strtr.php[/URL]. But a basic algorithm would be: [code=php] $maskedAddress = strtr($originalAddress,"AEIOUSTVRP","##########"); [/code]

Member Avatar for Menster
0
64
Member Avatar for StefaRSA

Hi there, Nothing leaps out at me as being wrong with your code, except it being a little incomplete. Eg your php side AJAX file doesn't echo the output or give any of the option elements any values. You could try this: Instead of replacing the entire select element with …

Member Avatar for Tulsa
0
135
Member Avatar for arshadshaikh

As far as I know its impossible, a query will always return a result set according to certain parameters passed. So all of your results must have something in common (or something they are commonly lacking). If you really had to do it in one statement i would recommend using …

Member Avatar for Menster
0
93
Member Avatar for zenix

Hi there, I'm not quite sure what you're up to. Are you coding your own front-end for a database or are you using a proprietary tool like phpMyAdmin? If the latter then you are pretty much stuck with what they give you unless you actually want to dig through hundreds …

Member Avatar for zenix
0
106
Member Avatar for vanessia_1999

Hi there, give this a go: [code=php] echo "<h2>Current Items and Quantities:</h2>\n"; echo "<table width=\"100%\" cellpadding=\"1\" border=\"1\">\n"; $query = "SELECT description, quantity from products"; $result = mysql_query($query); while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $description = $row['description']; $quantity = $row['quantity']; echo "<tr><td>$description</td><td>$quantity</td></tr>\n"; } echo "</table>\n";[/code] This construct will loop through all …

Member Avatar for nish123
0
106
Member Avatar for ace_dman

Write an algorithm in Javascript that can solve an np-complete problem in quadratic time. Thats always a good one, plus if you actually crack it you'll probably win a nobel prize.

Member Avatar for Menster
0
59
Member Avatar for rockyman12

I'll just say exactly what one of my 2nd year lecturers said to me: "There is no ultimate language or method, each one is better for something and terrible at something else, and because of this, sticking to one language will be your biggest downfall." What I'm saying is that …

Member Avatar for diafol
0
152
Member Avatar for itsrahulk

I you are looking for a mail handling solution written in php then the guys at squirrelmail have already beaten you to it with their excellent solution. I you wanted to start your own online mail servise (like gmail, or webmail) then their solution will also scale to your needs, …

Member Avatar for Bojero
0
74
Member Avatar for coleguitajuan

[icode] $value = intval(rand(1, 100)); if ($value < 80) { $sales_code = 'VW'; } else if (($value > 79) && ($value <= 86)) { $sales_code = 'DF'; } else if (($value > 86) && ($value <= 93)) { $sales_code = 'RK'; } else if (($value > 93) && ($value <= …

Member Avatar for Menster
0
110
Member Avatar for sarithak

Hi there, Just to clarify, when you pull a date from the database and echo it, it appears in the format DD-MM-YYYY hh-mm-ss. If thats the case and you just want the date part of the string, you can simply use substr() to get the part you want eg: [icode] …

Member Avatar for diafol
0
89
Member Avatar for jlasker

Hi there, PHP's mail() function should work just fine for what you're doing as I've used it many times for the exact same thing with no problems. For alternatives, the only 2 I know of are PEAR's mail function which (obviously) requires the PEAR libraries on your web server. For …

Member Avatar for cwarn23
0
82
Member Avatar for gingank

Hi there, Try instead of the check [icode]$phone == ''[/icode], use [icode]if (empty($phone) || !isset($phone))[/icode]

Member Avatar for emarshah
-1
119

The End.