Forum: PHP 7 Days Ago |
| Replies: 17 Views: 494 Like my previous solution:
<?php
function CutThumb($img){
//set variables
$crop = 15;
$thumb_w = 150;
$thumb_h = 150;
//get info from original image
list($w, $h) = getimagesize($img); |
Forum: PHP 7 Days Ago |
| Replies: 17 Views: 494 OK F, will have a look later on - got to pick up the kids. Hope to get back in a couple of hours.
BTW: anybody else out there? This ain't a private discussion. All solutions considered, especially... |
Forum: PHP 7 Days Ago |
| Replies: 17 Views: 494 This is what I was saying!
Your script is way too complicated for just a simple thumb crop. It's great, don't get me wrong, but a little heavy-handed for what you need.
If you tell me what... |
Forum: PHP 8 Days Ago |
| Replies: 17 Views: 494 Firstly, have you contacted the author of the script to troubleshoot?
Secondly, do you really need all this functionality or are you just wanting to crop 15px off the thumbnail? If so, this script... |
Forum: PHP 8 Days Ago |
| Replies: 17 Views: 494 Sorry F, I'm not going to download them. If you want to post the relevant bits, we'll have a look. |
Forum: PHP 8 Days Ago |
| Replies: 17 Views: 494 By all means, as long as it is posted to the forum. I do not accept PMs. Anyway, I can't promise to help and perhaps another member can give better advice.
What we need to know is the nature of... |
Forum: PHP 8 Days Ago |
| Replies: 17 Views: 494 Have to be honest - I don't really understand exactly what you want:
Do you just want to resize the image (height only)?
e.g. just take 15px off the height and don't worry about stretching the... |
Forum: PHP 8 Days Ago |
| Replies: 4 Views: 251 It's not that difficult. I like the way templating systems allow you to separate php code and html. You can even nest template pages (like php include files).
The systems allow loops and... |
Forum: PHP 8 Days Ago |
| Replies: 17 Views: 494 Try this - I messed around with it for a while, but I'm sure it could be further optimized - perhaps with just the one imagecopyresampled - but my head's fried.
<?php
function CutThumb($img){... |
Forum: PHP 9 Days Ago |
| Replies: 4 Views: 251 IF you want a good robust and QUICK templating system, get something like Smarty. I tend to use Rain TPL due to its small size.
I've also developed my own templates, but these tend to be... |
Forum: PHP 10 Days Ago |
| Replies: 2 Views: 235 You place a value within $dbitem but use $db_item in the SQL. They aren't the same. |
Forum: PHP 11 Days Ago |
| Replies: 4 Views: 230 $max_no = 25; //change this
$i = 1;
while($i < $max_no+1){
$output[] = '<td><IMG SRC="../cart-demo/images/'.$id.'.jpg" WIDTH="100" HEIGHT="100"></td>';
$i = $i + 1;
} |
Forum: PHP 11 Days Ago |
| Replies: 4 Views: 230 I assume this is in a loop of some description:
$i = 1;
...start loop...
$output[] = "<td><img src=\"../cart-demo/images/$i.jpg\" width=\"100\" height=\"100\"></td>";
... |
Forum: PHP 11 Days Ago |
| Replies: 9 Views: 306 OK. Note my point about quotes around the attribute value.
Say you have this sort of thing going on:
<td><input type="text" name="txtName[]"/></td>
<td><input type="text" name="txtMaths[]"... |
Forum: PHP 11 Days Ago |
| Replies: 9 Views: 306 What? I know he said thank you, but it's good practice to mark a thread solved so that contributors do not waste their time trying to help thread starters when the issue has been resolved. |
Forum: PHP 12 Days Ago |
| Replies: 9 Views: 306 |
Forum: PHP 12 Days Ago |
| Replies: 9 Views: 306 <td><input type="text" name=txtName[]/></td>
<td><input type="text" name=txtMaths[] /></td>
<td><input type="text" name=txtScience[] /></td>
<td><input type="text" name=txtEnglish[] /></td>
... |
Forum: PHP 14 Days Ago |
| Replies: 5 Views: 287 show_large_image(this)';return false;
You need a ';' before the 'return false'. |
Forum: PHP 15 Days Ago |
| Replies: 5 Views: 287 <img border='1' src='$PathG' onmouseover=\"getElementById('larger').src=$PathG; return false;\" width='100' height= '70' />
Close the tag and place larger within quotes - check your quotes!
IF... |
Forum: PHP 19 Days Ago |
| Replies: 5 Views: 278 Try this:
$client = utf8_encode(stripslashes(urldecode($_GET['clientData'])));
Worked for me. Here's how I tested it:
<?php
$x =... |
Forum: PHP 20 Days Ago |
| Replies: 5 Views: 278 Do ya think ya could post yer code mista? |
Forum: PHP 21 Days Ago |
| Replies: 2 Views: 223 Mark it solved next time, so people won't waste their time checking the first post. |
Forum: PHP 22 Days Ago |
| Replies: 3 Views: 194 Depends what you're trying to do, but I assume 755 would be fine:
If you didn't know (just in case):
OWNER = first digit (7)
GROUP = second digit (5)
USER = last digit (5)
The numbers are... |
Forum: PHP 23 Days Ago |
| Replies: 3 Views: 194 http://www.elated.com/articles/understanding-permissions/
Different files should have different permissions, depending on location/purpose. |
Forum: PHP 23 Days Ago |
| Replies: 5 Views: 280 $page = 'http://www.site.com/page.php';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $page);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
Tried this and it works... |
Forum: PHP 27 Days Ago |
| Replies: 10 Views: 405 public function getswachapter($book, $chapter){
//you still need to clean inputs!
$query = "SELECT kiswahili.Chapter, kiswahili.Verse, kiswahili.Scripture, vitabu.Name FROM kiswahili INNER... |
Forum: PHP 27 Days Ago |
| Replies: 10 Views: 405 Do you really need to run 2 queries? I don't know your table structures, but the first query looks redundant. |
Forum: PHP 28 Days Ago |
| Replies: 7 Views: 331 OK, I've just noticed - you're sending the form to the include file (or trying to). This won't work. You actually have to send the request, usually via submit button to a new page (products.php). An... |
Forum: PHP 28 Days Ago |
| Replies: 7 Views: 331 IN addition to name="inventorid", add id="inventorid". I'm not sure if it will work, but I can't see anything wrong with your code - mind you - my head's like a rotten apple at the moment.
In your... |
Forum: PHP 28 Days Ago |
| Replies: 7 Views: 331 I'm confused - you seem to have a circular reference - although it may just be my slow brain after my science club capers! I can't see where some variables are set. Please post the relevant bits from... |
Forum: PHP 28 Days Ago |
| Replies: 7 Views: 331 Don't do that!!!
You have a choice of client-side scripts or server-side. If you want something to happen before you send the form - use JS (but this isn't foolproof - JS is not secure), or if you... |
Forum: PHP 30 Days Ago |
| Replies: 7 Views: 353 I can't check it - I don't have your DB. Guess you'll have to wait. |
Forum: PHP 30 Days Ago |
| Replies: 7 Views: 353 |
Forum: PHP 30 Days Ago |
| Replies: 7 Views: 353 |
Forum: PHP 31 Days Ago |
| Replies: 14 Views: 690 Oh boy, where do I start?
First of all, most of the time Ajax is pretty much javascript calling a php script in order to change the contents of a tag. There's heck of a lot more to it, but that's... |
Forum: PHP 31 Days Ago |
| Replies: 14 Views: 690 This is a situation where ajax could help. You really don't need to have two pages. You could have just the one with a DIV that is updated to show different forms. This means you could have a number... |
Forum: PHP Nov 17th, 2009 |
| Replies: 13 Views: 534 Sorry M, this was the problem:
$day = $no(date('w'));
should've been:
$day = $no[date('w')];
Guess I'm not square enough! |
Forum: PHP Nov 16th, 2009 |
| Replies: 7 Views: 339 Sorry sadie - I edited while you replied - hope you got the rest of my post! |
Forum: PHP Nov 16th, 2009 |
| Replies: 7 Views: 339 Yes.
From the php manual:
mkdir("/path/to/my/dir", 0700);
http://www.php.net/manual/en/
OR download from: |
Forum: PHP Nov 16th, 2009 |
| Replies: 8 Views: 365 I
To answer the question:
"SELECT region_id FROM building_lvl WHERE (building_id = 3 AND lvl = 2) OR (building_id = 2 AND lvl = 5)"
However you then introduce another table, which I assume... |