Search found 401 matches

by launchcode
Wed Jul 07, 2004 4:52 pm
Forum: PHP - Code
Topic: [SOLVED] How to get filename without extension?
Replies: 12
Views: 2241

Then a basic check to see if $filename contains a period first will stop the need to fire-up the entire preg engine for such a simple task.

Code: Select all

$pos = strrpos($file, '.');
if ($pos)
{
$filename = substr($file, 0, $pos); 
}
by launchcode
Wed Jul 07, 2004 1:44 pm
Forum: Graphics
Topic: [NOT SOLVED]Creating a thumbnail of a BMP?
Replies: 14
Views: 21856

Depends how the imagecreatefromstring function works, try it and see? It's not what I meant, but it would be worth a shot.
by launchcode
Wed Jul 07, 2004 1:24 pm
Forum: Graphics
Topic: [NOT SOLVED]Creating a thumbnail of a BMP?
Replies: 14
Views: 21856

Yes.. read it in and then go through the data byte by byte. A BMP is a straight raw byte dump of an image (most the time, unless it is an 16 or 256 colour run-length encoded one (very rare!)).

This should help: http://www.fastgraph.com/help/bmp_header_format.html
by launchcode
Wed Jul 07, 2004 1:16 pm
Forum: PHP - Code
Topic: IntSmarty, Has Anyone Ever Installed This?
Replies: 6
Views: 1012

I would take the vast lack of responses to mean that no-one has used it ;) Probably time to ask somewhere else.. like the Smarty mailing list? Or even PHP-General where the author hangs out a lot.
by launchcode
Wed Jul 07, 2004 1:14 pm
Forum: Graphics
Topic: [NOT SOLVED]Creating a thumbnail of a BMP?
Replies: 14
Views: 21856

GD won't support it directly - but the BMP format is an *extremely* simple one, so there is nothing to stop you reading the format yourself and then creating a JPG/PNG version of it - once done you could them convert your new JPG/PNG into a thumbnail size.
by launchcode
Wed Jul 07, 2004 1:12 pm
Forum: PHP - Code
Topic: [SOLVED] How to get filename without extension?
Replies: 12
Views: 2241

Or of course:

Code: Select all

$filename = substr($file, 0, strrpos($file, '.'));
Now it doesn't matter how long the file extension is or how many other periods exist in the file name.
by launchcode
Wed Jul 07, 2004 5:46 am
Forum: PHP - Code
Topic: [SOLVED] Session trouble
Replies: 4
Views: 821

That isn't valid 1.0 Transitional XHTML, so yes it is likely it wouldn't work in Mozilla.
by launchcode
Tue Jul 06, 2004 11:03 am
Forum: PHP - Code
Topic: [SOLVED] Form to form problem - please help!
Replies: 8
Views: 1180

You may need to do this:

Code: Select all

$viewmember = $_POST['viewmember'];
If your server has Register Globals disabled (which most do these days).
by launchcode
Tue Jul 06, 2004 10:47 am
Forum: PHP - Code
Topic: [SOLVED] Syntax problem, can't find it
Replies: 3
Views: 654

isset() doesn't check to see if a variable is empty - it checks to see if it exists or not. You probably want to use empty().
by launchcode
Tue Jul 06, 2004 10:17 am
Forum: PHP - Code
Topic: [SOLVED] Form to form problem - please help!
Replies: 8
Views: 1180

Post your second script here too.
by launchcode
Tue Jul 06, 2004 10:16 am
Forum: PHP - Code
Topic: Redirect
Replies: 10
Views: 1545

At what stage am i outputting headers??
Outputting HTML automatically outputs a header. Your entire DIV Form block is HTML, ergo you've output headers.

Swap around the sequence - do the Header check BEFORE you output the Form.
by launchcode
Tue Jul 06, 2004 9:23 am
Forum: PHP - Code
Topic: Redirect
Replies: 10
Views: 1545

Post your script - if you don't understand what "don't output any HTML before calling the Header function" means, then perhaps we can actually show you instead?
by launchcode
Tue Jul 06, 2004 7:53 am
Forum: PHP - Code
Topic: [SOLVED] Rows instead of tables
Replies: 2
Views: 496

Take the "echo <table>" (blah blah) line outside of your WHILE loop then! :) Put it before and put the closing table tag at the } ending the while loop.
by launchcode
Tue Jul 06, 2004 7:52 am
Forum: PHP - Code
Topic: Redirect
Replies: 10
Views: 1545

Like I said (thanks Malcolm! :) ) - you are already outputting something in your script - some HTML or a space, whatever - it's causing the Header to fail.
by launchcode
Tue Jul 06, 2004 7:41 am
Forum: PHP - Code
Topic: Redirect
Replies: 10
Views: 1545

Yes use the header function (as shown below) but notice this will only work if you have not output any headers already (which could be anything from a space in your file to an echo statement, etc). Basically this will only work if no other output has already been sent to the browser. <? Header('Loca...