[PHP] image problem

2005-03-24 Thread William Stokes
Hello,

I really can't figure this out. Can someone help please. I've wasted hours 
already with this one.

I'm trying to print image to a web page using fpassthru. Here's the code:

$name = path/to/the/image/folder/img1.jpeg;
 $fp = fopen($name, 'rb');

 // send the right headers
 header(Content-Type: image/jpeg); //also tested with type pjpeg
 header(Content-Length:  . filesize($name));

 // dump the picture
 fpassthru($fp);

Help Appeciated. Thanks.
-Will

This code is basically straight from manual. I have verified that the images 
path is correct. When I test this I get a browserfull of junk like this:
ñQÎ$ìÙåòpv{º:S¤d䱧'AêסöfçnßgýqZ;ji²ÃxYÝ3¬çõ:f±±-,ímfcNÒþÂ×Æéá³-Ô­nÚ?÷IÛU`r÷¹ßùñê6Ú-Ky®Ó
 
ÀZÛ­-?Õ­µîþÂç^w1®¨ºAdÀoV?Öν_ZÏÇY±bµÌÇ$Ay?Îä9¿êmo¤ßôKï°Të[/µÍsÆYôUØáÇ×^
 
ÐɐK$^û[»¥` 'DfüY¤å 
Ü{{q»Ò±«¼{zç4AñzÿºµòXZ}PX]\'à\[ÃÚ~·èØ~¨üçÐÄTÛßÏYêªm±ò\Ûê-Óasµjí¶q¹YKÇ¿?ößò'Õ_GÿÔàw;MzI÷fTï
 
nãð¹)h÷a.fÆs'xUìÎÛí¨4ÿ(Jo~YÑs8P¶_s1ñêu·ZàÊë`Üç9ßE¬húNR{d 
*¨ç½îÞò\ï³Ò¬È§?ìp,±¤XƼs=Z5edPhy©Ä:Æ'°?0¡h±²Û?¬ÏÑ©S.}{ 
\Xö¦ÑËOþê+¢ 
ê¹ÿY°:eÛoçß`ÝVOéÿwÑ¢¯å»þ¶¸Îµõªu£éä¼U^Ó,ĪEr¬Y~Cÿ.gö-v=ûYaq{ýîsO-7îü¸Ä'áÅ?w-udË)i°J\ݤññOxOo$nY£0Úö'MÏ£ÿ,nSçv5¿Í¿/ßöwúvYúU.OOL1²ku7Òí-Tñiså?F*`æVç8áÁîÁ}ÐgTF¸
 
l±Æ{è{¤Hb¢tüKÓr;L'Ýæn\|[EMAIL PROTECTED] 
YØ?u·8öÁ,Bä-'?=Ö2ªsë-´?W[so÷¬®¶7Ü÷½ßA«S#oH¦Ü,rÔlkªÎÊa6ÛÓ°zßûo¨f7ùïè~ÿ«ú¯½`½Ý7§z¦Çú?i²oªú,Üæ~sn¹îû%Yàÿ]·ùÆT³sh@;)À³}:-ÛÍf84í
 
/¨?_V?'Áü¶¦f-½?¿z#\K|'î?¾û}»$B°Ø'÷ê~~Èhè^ï¢BQWuù- 
Cº®/Øz\üü:úy?u´T 
ïéZwÒ{±ªß.Óàë¿þãzyYjg_vV5øîÙ}oßKÇ-±'eOþ͍j2ÚÔ7cÚF£TNÒ¯õÜz*êV¿zz.[kÌÆgµä±¹M©±þ,Ë,Çÿ¬ª-ú[{¤:è)«*{üT[¢$§Ð4z'oÿÖâ²
 
YI'¹kGÄ.G¦ãߝöpFU­¢tÞÿMþrYW·o£Xäaÿ©gýùXè¶6Z±vXpkªÄɾ'Ò{[Qoòc÷±mc¿ý$ÝW*OO»?g
 
0ð^ïEÆ[Ã}ù6ríÿ.ÈTÚéË8pNÃÛÀYÁN4aê»GéãÆ?Y,X§sqüòHøkP²_²-G/0ZÆíÇ 
ãh|?®Ho媺1¨oʱÝsGÍçîî?³aæÂ]òá¿ôQٍ~KfiÄÌIH[ü­¾äF'¾ú¨î?íø;OÝCOÜZê/¥
 
Û[~Ò%®ZAþ[eS»Nþ¡S{4~T Ðä ˱ÕþÑò'èÓ~¾8ÙZÏü:¥WÝÏ 
õ®õ~­ãYÜu,¶-ô`8ÿÒ­Q~Ðpí?sSf.9÷|ãðAk£§rs¢`îWå;vÿ[ÓOµ¯ÿ×ó¾ªÝ×zoÇ°ü,®]ú:nïQØï?Òj·vÛ]kwdíüS­L?:-}ícè§ðÕxùËoðlÐFû?òÉûÖ÷ÕÆÓZ.,vE'Ö?a-¥õ9¤îýc{«¿ÛüÏóÿQsXnp{Ú磻?µý­-
 
óOÞ(ؤêØÔÕÔþÏOíØÁÓP$9Á¿KcË ú?£»óØ 
YO`æö¿9VÄlÜ]à?*;½ù½~Ùù'~RxÒZþM¦6??ömv.=­÷º¦4W3¹ÖWK\ÝzíߤBf 
¦Â̳¨ST\î¥áâ9Ð?iü¦Æö'Ìzi4AìõyØõ³êh¶o?Ù[1ð.Ñ.¯ºÊ±=?mOc= 
Yh²Ï´þzåóZzóþÎkÂ7Øö³oÓc2ßðMýpU?ÜjsÃ'êºöº¹5Ö÷3ÐûK]`ßöYL¿ÒfÿÐÛúÇôSý%ÏÑ8Æ?hqORc¨k×ðuC¿ìk7õ,ÇüN
 
ïê#wzSïP¥Òzf0æÑvKÇò²®skÿÙl\wªRÑN£Äø'Ãaõ,rÝ#G¨ðÎÜ»áûªÖæÌùþMz$ò|IåNJ¢Þ¯ÿÐóË^öÛÃd±ße¿æ¹FêÉnfÜù¿Ä(c¿Ôcê:[EMAIL
 PROTECTED],wg 
ºÂ~A6F+?àø6pÛ .îJ.ZäZ|,z?mM5IÎñNå OVÝg² Í÷15¢D©¡BZä¿æ 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] image problem

2005-03-24 Thread Tom Rogers
Hi,

Friday, March 25, 2005, 3:27:41 AM, you wrote:
WS Hello,

WS I really can't figure this out. Can someone help please. I've wasted hours
WS already with this one.

WS I'm trying to print image to a web page using fpassthru. Here's the code:

WS $name = path/to/the/image/folder/img1.jpeg;
WS  $fp = fopen($name, 'rb');

WS  // send the right headers
WS  header(Content-Type: image/jpeg); //also tested with type pjpeg
WS  header(Content-Length:  . filesize($name));

WS  // dump the picture
WS  fpassthru($fp);

WS Help Appeciated. Thanks.
WS -Will

Make sure you don't have any whitespace after the trailing ? if there
is one, better still get rid of it.
Also I use readfile($name); ... can't remember why


Here is a bit of code I use for passing PDF files which also handles
caching control you can adapt easily for images.


?php
$cache_time = false;
$requested_time = false;
$filename = $_REQUEST{'filename'];
if(file_exists($filename)){
  $len = filesize[$filename);
  $mtime = filemtime($filename);
  $cache_time = gmdate('D, d M Y H:i:s', $mtime) . ' GMT';
  header('Last-Modified: '.$cache_time);
  $rt = false;
  if(isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])){
$rt = $_SERVER['HTTP_IF_MODIFIED_SINCE'];
  }
  if($rt) $requested_time = strtotime($rt);
  if($requested_time  $cache_time){
if($requested_time == $cache_time){
  Header($_SERVER['SERVER_PROTOCOL'].' 304 Not Modified');
  exit;
}
  }
  header(Accept-Ranges: bytes);
  header('Cache-Control: no-cache, must-revalidate');
  header(Content-type: application/pdf);
  header(Content-Length: $len);
  readfile($filename);
}

-- 
regards,
Tom

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Image Problem

2004-06-28 Thread Monil Chheda
Hi,

I store images in DB properly... no issues using the
following code

?php

// store.php3 - by Florian Dittmer [EMAIL PROTECTED]
// Example php script to demonstrate the storing of
binary files into
// an sql database. More information can be found at
http://www.phpbuilder.com/
?

html
headtitleStore binary data into SQL
Database/title/head
body

?php
// code that will be executed if the form has been
submitted:

if ($submit) {

// Include constants for database connectivity
include(constants.php);

//  The Database server connection function
$connection =
mysql_connect($host,$db_user,$db_pass) or
die(Couldn't connect to the MySql Database Server);

//  Database selection from the DB server
$db =   mysql_select_db($db_name,$connection) or
die(Couldn't select the required Database.);

$data = addslashes(fread(fopen($banner_image,
r), filesize($banner_image)));

$result =   MYSQL_QUERY(INSERT INTO banner_details
(text,banner_image,filename,filesize,filetype) .
VALUES
('$banner_description','$data','$form_data_name','$form_data_size','$form_data_type'))
or die(Couldnt insert banner in the Db);

echo Banner uploaded;

$id= mysql_insert_id();
print pThis file has the following Database ID:
b$id/b;

} else {

// else show the form to submit new data:
?

form method=post action=?php echo $PHP_SELF;
? enctype=multipart/form-data
Banner Text:br
input type=text name=banner_description 
size=40
input type=hidden name=MAX_FILE_SIZE
value=100
brImage to upload/store in database:br
input type=file name=banner_image  size=40
pinput type=submit name=submit
value=submit
/form


?php

}

?

/body
/html



I use the foll file to reterieve it...

?
/*
Aim:To fetch random image and its corresponding
text from the database.

Working:Generate a random number within the range of
1 and number of rows present in the DB and then fetch
the appropriate ROW ID.

Includes:   constants.php for DB connectivity

*/
// Include constants for database connectivity
include(constants.php);

//  The Database server connection function
$connection =
mysql_connect($host,$db_user,$db_pass) or
die(Couldn't connect to the MySql Database Server);

//  Database selection from the DB server
$db =   mysql_select_db($db_name,$connection) or
die(Couldn't select the required Database.);

/*
Fetching the number of rows in the DB table
*/

//  Reteriving the data from the banners table in the
DB
$sql=   SELECT *  .
FROM   banner_details;

//  Executing the Sql select statement
$result =   mysql_query($sql, $connection) or
die(Couldn't Execute the query.);

//  Getting the number of rows affected by the query
$rows   =   mysql_num_rows($result);

print(Rows in DB: $rows\n);

/*
Generating a Random number between 1 and the NUMBER OF
ROWS returned from the DB Table
*/

//  Seeding the random number generator...
//  this thing is usually used to SET an initial value
for the random number to be generated.
mt_srand(doubleval(microtime()) *   1);

//  The random number is generated...
$random_number  =   mt_rand(1, $rows);

print(The random number generated is
$random_number);
echo BRBR;

/*
Fetching the actual data from the DB Table
*/
$query = select banner_image, text, filetype from
banner_details where id=$random_number;

$result =   mysql_query($query, $connection) or
die(Couldn't Execute the query.);

$data = @MYSQL_RESULT($result,0,banner_image);
$text = @MYSQL_RESULT($result,0,text);
$type = @MYSQL_RESULT($result,0,filetype);

echo The banner is ;

Header(Content-type: $type);

echo $data;


echo The assocaited text is : $text;


?

--

And this for calling it...

?php

echo img src=rotate.php;

?

I get an Img with a cross (broken)...

Whats the error?

Am i missing something?

Pls help

-Monil

=
Best Regards,
Monil Chheda(INDIA)
http://domains.eliteral.com
===
===



__
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Image Problem

2004-06-28 Thread Binay
probably the table in which ur storing the images will be having its primary
key set to auto_increment.

If tht is the case then when u delete banner(s) then corresponding id(s)
match won't be found.

i.e say table is having 4 records with ids as follows

id =1
id=2
id=3
id=4

so random number generated would lie between 1 to 4.

now say u delete record with id=2. if this happens then no of  records will
be 3 and hence random number can be 2 for which theres no record in
database. and hence a broken image.




- Original Message -
From: Monil Chheda [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, June 28, 2004 1:24 AM
Subject: [PHP] Image Problem


 Hi,

 I store images in DB properly... no issues using the
 following code

 ?php

 // store.php3 - by Florian Dittmer [EMAIL PROTECTED]
 // Example php script to demonstrate the storing of
 binary files into
 // an sql database. More information can be found at
 http://www.phpbuilder.com/
 ?

 html
 headtitleStore binary data into SQL
 Database/title/head
 body

 ?php
 // code that will be executed if the form has been
 submitted:

 if ($submit) {

 // Include constants for database connectivity
 include(constants.php);

 // The Database server connection function
 $connection =
 mysql_connect($host,$db_user,$db_pass) or
 die(Couldn't connect to the MySql Database Server);

 // Database selection from the DB server
 $db = mysql_select_db($db_name,$connection) or
 die(Couldn't select the required Database.);

 $data = addslashes(fread(fopen($banner_image,
 r), filesize($banner_image)));

 $result = MYSQL_QUERY(INSERT INTO banner_details
 (text,banner_image,filename,filesize,filetype) .
 VALUES

('$banner_description','$data','$form_data_name','$form_data_size','$form_da
ta_type'))
 or die(Couldnt insert banner in the Db);

 echo Banner uploaded;

 $id= mysql_insert_id();
 print pThis file has the following Database ID:
 b$id/b;

 } else {

 // else show the form to submit new data:
 ?

 form method=post action=?php echo $PHP_SELF;
 ? enctype=multipart/form-data
 Banner Text:br
 input type=text name=banner_description
 size=40
 input type=hidden name=MAX_FILE_SIZE
 value=100
 brImage to upload/store in database:br
 input type=file name=banner_image  size=40
 pinput type=submit name=submit
 value=submit
 /form


 ?php

 }

 ?

 /body
 /html

 

 I use the foll file to reterieve it...

 ?
 /*
 Aim: To fetch random image and its corresponding
 text from the database.

 Working: Generate a random number within the range of
 1 and number of rows present in the DB and then fetch
 the appropriate ROW ID.

 Includes: constants.php for DB connectivity

 */
 // Include constants for database connectivity
 include(constants.php);

 // The Database server connection function
 $connection =
 mysql_connect($host,$db_user,$db_pass) or
 die(Couldn't connect to the MySql Database Server);

 // Database selection from the DB server
 $db = mysql_select_db($db_name,$connection) or
 die(Couldn't select the required Database.);

 /*
 Fetching the number of rows in the DB table
 */

 // Reteriving the data from the banners table in the
 DB
 $sql = SELECT * .
 FROM banner_details;

 // Executing the Sql select statement
 $result = mysql_query($sql, $connection) or
 die(Couldn't Execute the query.);

 // Getting the number of rows affected by the query
 $rows = mysql_num_rows($result);

 print(Rows in DB: $rows\n);

 /*
 Generating a Random number between 1 and the NUMBER OF
 ROWS returned from the DB Table
 */

 // Seeding the random number generator...
 // this thing is usually used to SET an initial value
 for the random number to be generated.
 mt_srand(doubleval(microtime()) * 1);

 // The random number is generated...
 $random_number = mt_rand(1, $rows);

 print(The random number generated is
 $random_number);
 echo BRBR;

 /*
 Fetching the actual data from the DB Table
 */
 $query = select banner_image, text, filetype from
 banner_details where id=$random_number;

 $result = mysql_query($query, $connection) or
 die(Couldn't Execute the query.);

 $data = @MYSQL_RESULT($result,0,banner_image);
 $text = @MYSQL_RESULT($result,0,text);
 $type = @MYSQL_RESULT($result,0,filetype);

 echo The banner is ;

 Header(Content-type: $type);

 echo $data;


 echo The assocaited text is : $text;


 ?

 --

 And this for calling it...

 ?php

 echo img src=rotate.php;

 ?

 I get an Img with a cross (broken)...

 Whats the error?

 Am i missing something?

 Pls help

 -Monil

 =
 Best Regards,
 Monil Chheda(INDIA)
 http://domains.eliteral.com
 ===
 ===



 __
 Do you Yahoo!?
 Yahoo! Mail - You care about security. So do we.
 http://promotions.yahoo.com/new_mail

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General

Re: [PHP] Image Problem

2004-06-28 Thread raditha dissanayake
Monil Chheda wrote:
Hi,
I store images in DB properly... no issues using the
 

Storing an image directly in the database certainly isnt' the proper way 
of doing it :-)
The common practice is just to store the path to the image name in the 
database.

--
Raditha Dissanayake.
-
http://www.raditha.com/megaupload/upload.php
Sneak past the PHP file upload limits.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Image Problem

2004-06-28 Thread Curt Zirzow
* Thus wrote Monil Chheda:
 Hi,
 
 I store images in DB properly... no issues using the
 following code
 
 snip
 
 I get an Img with a cross (broken)...
 
 Whats the error?

its funny, you're error is one click from finding out what it is,
view the source of that image and find it you will...


 
 Am i missing something?

about 10 or 12 things, but thats far beyond the scope of your
current  problem.


Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Image Problem

2004-06-28 Thread Red Wingate
Read: The best database to store images in is the Filesystem because 
thats what it's for :-)

Raditha Dissanayake wrote:
Monil Chheda wrote:
Hi,
I store images in DB properly... no issues using the
 

Storing an image directly in the database certainly isnt' the proper way 
of doing it :-)
The common practice is just to store the path to the image name in the 
database.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Image problem

2002-10-09 Thread Donahue Ben

I upload an image.  Once I upload this image using the
is_uploaded_file function, then writing this image
file using the copy function.  Everything seems to
work fine.  When i try to update (that is uploading a
new file and saving it with the same name as the first
file created) it shows the first image instead of the
second image.  So what I did was closed my browser,
then reopened it, then everything was ok.  So I figure
that I have a cache problem.  I then tried using the
clearstatcache() function right after I update this
image file.  But it did not seem to work.  So am I
going to have to close and reopen my browser to see
these changes take place or is there something else I
can do?

Ben

__
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos  More
http://faith.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Image problem

2002-10-09 Thread David Erickson

I had a similar problem and I just put this in front of my php so everytime
my scripts are called they always tell the browser and any proxy servers not
to cache anything from me.


header(Expires: Mon, 26 Jul 1997 05:00:00 GMT);// Date in the past
header(Last-Modified:  . gmdate(D, d M Y H:i:s) .  GMT);
 // always modified
header(Cache-Control: no-store, no-cache, must-revalidate);  // HTTP/1.1
header(Cache-Control: post-check=0, pre-check=0, false);
header(Pragma: no-cache);  // HTTP/1.0


- Original Message -
From: Donahue Ben [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, October 09, 2002 1:00 PM
Subject: [PHP] Image problem


 I upload an image.  Once I upload this image using the
 is_uploaded_file function, then writing this image
 file using the copy function.  Everything seems to
 work fine.  When i try to update (that is uploading a
 new file and saving it with the same name as the first
 file created) it shows the first image instead of the
 second image.  So what I did was closed my browser,
 then reopened it, then everything was ok.  So I figure
 that I have a cache problem.  I then tried using the
 clearstatcache() function right after I update this
 image file.  But it did not seem to work.  So am I
 going to have to close and reopen my browser to see
 these changes take place or is there something else I
 can do?

 Ben

 __
 Do you Yahoo!?
 Faith Hill - Exclusive Performances, Videos  More
 http://faith.yahoo.com

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Image problem

2002-10-09 Thread Owen Prime

If the browser still doesn't listen, you can always put a time() arg in you 
img src. ie. img src=\image.gif? . time() . \

David Erickson wrote:

 I had a similar problem and I just put this in front of my php so
 everytime my scripts are called they always tell the browser and any proxy
 servers not to cache anything from me.
 
 
 header(Expires: Mon, 26 Jul 1997 05:00:00 GMT);// Date in the past
 header(Last-Modified:  . gmdate(D, d M Y H:i:s) .  GMT);
  // always modified
 header(Cache-Control: no-store, no-cache, must-revalidate);  // HTTP/1.1
 header(Cache-Control: post-check=0, pre-check=0, false);
 header(Pragma: no-cache);  // HTTP/1.0
 
 
 - Original Message -
 From: Donahue Ben [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, October 09, 2002 1:00 PM
 Subject: [PHP] Image problem
 
 
 I upload an image.  Once I upload this image using the
 is_uploaded_file function, then writing this image
 file using the copy function.  Everything seems to
 work fine.  When i try to update (that is uploading a
 new file and saving it with the same name as the first
 file created) it shows the first image instead of the
 second image.  So what I did was closed my browser,
 then reopened it, then everything was ok.  So I figure
 that I have a cache problem.  I then tried using the
 clearstatcache() function right after I update this
 image file.  But it did not seem to work.  So am I
 going to have to close and reopen my browser to see
 these changes take place or is there something else I
 can do?

 Ben

 __
 Do you Yahoo!?
 Faith Hill - Exclusive Performances, Videos  More
 http://faith.yahoo.com

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
Cheers,

Owen Prime
http://www.noggin.com.au

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Image Problem

2002-10-08 Thread Mark Colvin

I have just upgraded php from 4.0.6 to 4.2.3. Everything works OK apart from
the line below -

echo 'td colspan=2 rowspan=2 align=centerimg alt=No Image to
display. src=thumbnail.php?image=00042.jpg valign=top//td';

The thumbnail.php script uses php functions imagecreate,
imagecreatefromjpeg, imagecopyresized. The script created a thumbnail OK
before the upgrade and now I get no image. Is this because php has to be
configured with the GD Library? If so, can I add this in without having to
reinstall php? I am running on a Red Hat 7.2 box.



This e-mail is intended for the recipient only and
may contain confidential information. If you are
not the intended recipient then you should reply
to the sender and take no further ation based
upon the content of the message.
Internet e-mails are not necessarily secure and
CCM Limited does not accept any responsibility
for changes made to this message. 
Although checks have been made to ensure this
message and any attchments are free from viruses
the recipient should ensure that this is the case.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Image Problem

2002-10-08 Thread Jason Wong

On Tuesday 08 October 2002 20:08, Mark Colvin wrote:
 I have just upgraded php from 4.0.6 to 4.2.3. Everything works OK apart
 from the line below -

 echo 'td colspan=2 rowspan=2 align=centerimg alt=No Image to
 display. src=thumbnail.php?image=00042.jpg valign=top//td';

 The thumbnail.php script uses php functions imagecreate,
 imagecreatefromjpeg, imagecopyresized. The script created a thumbnail OK
 before the upgrade and now I get no image. Is this because php has to be
 configured with the GD Library?

If you had error reporting ON, it would be pretty obvious if that was the 
problem (you would either see the error on screen or it would be in the 
logs).

Use phpinfo() to find out whether PHP was compiled with GD library support.

 If so, can I add this in without having to
 reinstall php? I am running on a Red Hat 7.2 box.

If it wasn't, you would have to reconfigure/recompile PHP (after installing 
the GD library).


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
When the blind lead the blind they will both fall over the cliff.
-- Chinese proverb
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Image problem

2001-12-07 Thread Peter Lalka


Hi.
I've instaled and cofigured php4 on WinNT with Apache Web server.
I can't use any fuction of Image manipulation, 'cause I get this error
message: ImageGif: No GIF support in this PHP build
In phpinfo() is listed that: gd lib. enabled, zlib lib. enabled.
What do I still miss there?
Peter.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Image problem

2001-05-15 Thread Michael O'Neal

Hi,

I'm still pretty new to PHP, and would like help on a solution for a 
problem I have.

I have a website that has 6 different sections.  (about, news, buying, 
selling, community, and relocation)  Each of the sections has it's own 
subfolder in the root directory of the website.  (/about, /news, etc...)  
Each of the sections also has a header image and footer image associated 
with that section.  (hdr_txt_about.gif, ftr_txt_about.gif, 
hdr_txt_news.gif, etc..)

I want to use PHP to know what section of the website the user is in, 
and load the appropriate header/footer image.  I know that I need some 
sort of if/then statement, and I know that it has to use the URL to see 
where it is, but I don't know where to implement it, and I'm not quite 
sure how.  The website is setup with an included header that has most of 
the html/javascript, a mostly text file for the content, and an included 
footer that takes care of the rest.  

Any help with this would be greatly appreciated.

Thanks,

mto

Michael O'Neal
Web Producer/ Autocrosser
ST 28 '89 Civic Si
-
 M   A   N   G   O
B  O  U  L  D  E  R 
-
http://www.thinkmango.com
[EMAIL PROTECTED]
p-303.442.1821
f-303.938.8507



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Image problem

2001-05-15 Thread Jerry Lake

This is how I fixed that same issue
in the head of my page
snip
if (ereg (new, $PHP_SELF)) {
$header = img src=location/of/header/image;
$title = www.website.com - What's New; }
elseif (ereg (products, $PHP_SELF)) {
$header = img src=location/of/header/image;
$title = www.website.com - Products; }
else {
$header = img src=location/of/header/image;
$title = www.website.com; }
/snip

then call the header in in the appropriate place in
your html ? echo $header; ?

Jerry Lake
Interface Engineering Technician
Europa Communications - http://www.europa.com
Pacifier Online - http://www.pacifier.com


-Original Message-
From: Michael O'Neal [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 15, 2001 10:14 AM
To: php
Subject: [PHP] Image problem


Hi,

I'm still pretty new to PHP, and would like help on a solution for a 
problem I have.

I have a website that has 6 different sections.  (about, news, buying, 
selling, community, and relocation)  Each of the sections has it's own 
subfolder in the root directory of the website.  (/about, /news, etc...)  
Each of the sections also has a header image and footer image associated 
with that section.  (hdr_txt_about.gif, ftr_txt_about.gif, 
hdr_txt_news.gif, etc..)

I want to use PHP to know what section of the website the user is in, 
and load the appropriate header/footer image.  I know that I need some 
sort of if/then statement, and I know that it has to use the URL to see 
where it is, but I don't know where to implement it, and I'm not quite 
sure how.  The website is setup with an included header that has most of 
the html/javascript, a mostly text file for the content, and an included 
footer that takes care of the rest.  

Any help with this would be greatly appreciated.

Thanks,

mto

Michael O'Neal
Web Producer/ Autocrosser
ST 28 '89 Civic Si
-
 M   A   N   G   O
B  O  U  L  D  E  R 
-
http://www.thinkmango.com
[EMAIL PROTECTED]
p-303.442.1821
f-303.938.8507



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Image problem

2001-05-15 Thread Michael O'Neal

On Tue, 15 May 2001 10:23:39 -0700, Jerry Lake [EMAIL PROTECTED] 
wrote:

This is how I fixed that same issue
in the head of my page
snip
if (ereg (new, $PHP_SELF)) {
   $header = img src=location/of/header/image;
   $title = www.website.com - What's New; }
elseif (ereg (products, $PHP_SELF)) {
   $header = img src=location/of/header/image;
   $title = www.website.com - Products; }
else {
   $header = img src=location/of/header/image;
   $title = www.website.com; }
/snip

then call the header in in the appropriate place in
your html ? echo $header; ?

Thanks Jerry.

This is what I ended up going with, (Thanks to Josh Hoover) and it works 
great!


switch(true)

{
case (stristr($REQUEST_URI, /about/)):
$headerImage = /images/hdr_txt_about.gif;
$footerImage = /images/ftr_txt_about.gif;
break;
case (stristr($REQUEST_URI, /news/)):
$headerImage = /images/hdr_txt_news.gif;
$footerImage = /images/ftr_txt_news.gif;
break;
case (stristr($REQUEST_URI, /buying/)):
$headerImage = /images/hdr_txt_buying.gif;
$footerImage = /images/ftr_txt_buying.gif;
break;
case (stristr($REQUEST_URI, /selling/)):
$headerImage = /images/hdr_txt_selling.gif;
$footerImage = /images/ftr_txt_selling.gif;
break;
case (stristr($REQUEST_URI, /community/)):
$headerImage = /images/hdr_txt_community.gif;
$footerImage = /images/ftr_txt_community.gif;
break;
case (stristr($REQUEST_URI, /relocation/)):
$headerImage = /images/hdr_txt_relocation.gif;
$footerImage = /images/ftr_txt_relocation.gif;
break;


}

Then, just called $headerImage, and $footerImage in the appropriate 
places.

Thanks to all!

mto

Michael O'Neal
Web Producer/ Autocrosser
ST 28 '89 Civic Si
-
 M   A   N   G   O
B  O  U  L  D  E  R 
-
http://www.thinkmango.com
[EMAIL PROTECTED]
p-303.442.1821
f-303.938.8507



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Image problem

2001-01-20 Thread Richard Lynch

 Can anyone tell me how to display both jpg and gif images.  Basically,
 what i've got is:
 img src="$filedir/$CUserName".jpg

 Now, I know I probably need slashes in there and I played around with it
 but no luck. Where do I put them?

TIP:  Use "View Source" in your browser to see what the IMG tag looks like.

I suspect you've forgotten that you're not in PHP mode, and are just sending
a very oddly-named image tag, literally:
"$filedir/$CUserName"

Since the quotes are going there, I guess HTML is going to ignore the .jpg
part, or treat it as an unkown attribute.

I'm guessing you want:

img src="?php echo $filedir, '/', $CUserName, '.jpg';?"



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Image problem

2001-01-19 Thread Mike Yuen

Can anyone tell me how to display both jpg and gif images.  Basically,
what i've got is:
img src="$filedir/$CUserName".jpg

Now, I know I probably need slashes in there and I played around with it
but no luck. Where do I put them?

Thanks,
Mike



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]