Re: [PHP] Is it Possible?

2005-02-04 Thread Martin Holm
Sagar C Nannapaneni wrote:
I'm calling a php script with img tag
for ex: img src=http://localhost/test.php?img=asfd;
and the test.php is as follows...
test.php

?
...
...
some server side validations
...
readfile(abcd.gif);
?
---
Theres no problem with this..its working fine. But i want to return some
text(or Html) the
browser along with the image. So is there anyway that i can send the text
to the browser
in this fashion. Even anyother solution other than the img is also Ok.
Showing img
is not a priority for me but sending the text is..
Any help will be greatly appreciated..
Thanks,
/sagar
 

you have to send a header containing the mime type. last example at 
http://www.php.net/header is a good one.

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


Re: [PHP] GD functions don't delete temporary files

2004-12-13 Thread Martin Holm
Steve wrote:
I am using GD image function with PHP (PHP 4.3.9 on RedHat 9). Today I 
found that for all images I have created so far (using the ImageGIF() 
function), there is a temporary file in /tmp with that image. The name 
of the temp file is a 6 character combination of letters and digits, 
e.g. jvc5Ne.

To be sure it's not a config problem, I compiled again with minumum 
options and minimum script

./configure --with-gd --with-zlib
?php
$im = ImageCreate(20, 20);
ImageGIF($im);
ImageDestroy($im);
?
But the problem is still there (CGI and CLI sapi tested). I used the 
-n option, so php.ini can't cause the problem, either.
Has anyone else experienced that?

Regards,
Steve
http://www.php.net/manual/en/function.imagegif.php -
*Note: * Since all GIF support was removed from the GD library in 
version 1.6, this function is not available if you are using that 
version of the GD library.

http://www.php.net/manual/en/function.imagecreatefromgif.php -
*Note: * GIF support was removed from the GD library in Version 1.6, and 
added back in Version 2.0.28. This function is not available between 
these versions.

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


Re: [PHP] HTML button as hyperlink

2004-11-18 Thread Martin Holm
Mulley, Nikhil wrote:
Hi All,
My Question is that , I have an HTML page , how can  I make it as
Hyperlink instead of a Form Button
When user clicks on that button , it must be a href link .
Please guide me.
Thanks,
Nikhil.
.
 

first of all, i dont see anything regarding php in this question.
form method=post action=http://new.url.com/whatever.html;
input type=submit value=Go to other page
/form
// Martin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] splitting string into array

2004-09-29 Thread Martin Holm
blackwater dev wrote:
How can I take a string and create an array?
Example,
A12B05C45D34
I need to split this into chunks of three A12,B05,C45..etc?
Thanks!
|
use str_split()
if you dont have php5, you can use the following code:
|
?php
if (!function_exists('str_split')) {
   function str_split ($str, $size = 1) {
   $arr = array();
   for ($i = 0 ; $i  strlen($str) ; $i += $size) {
   $arr[] = substr($str,$i,$size);
   }
   return $arr;
   }
}
$array = str_split('A12B05C45D34',3)
print_r($array);
?
||
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Highest Key in an Array

2004-09-17 Thread Martin Holm
Daniel Schierbeck wrote:
I've been looking at php.net, but i couldn't find what i'm searching for.
I have a numeric array, and i'd like to get the highest key. E.g.
$arr = array(3 = foo, 7 = bar, 43 = foobar);
What i want is a function that, in this case, returns 43.
Daniel Schierbeck
$arr = array(3 = foo, 7 = bar, 43 = foobar);
krsort($arr);
$highestkey = key($arr);
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Splitting 12345 - 1,2,3,4,5

2004-09-16 Thread Martin Holm
Michael Mao wrote:
Thanks John.
Found what I'm looking for:
Function str_split()
to make it php4 compatible you can use this function:
|?php
if (!function_exists('str_split')) {
  function str_split ($str, $size = 1) {
 $arr = array();
 for ($i = 0 ; $i  strlen($str) ; $i += $size) {
$arr[] = substr($str,$i,$size);
 }
 return $arr;
  }
}
?
works in about the same way as the function in php5.
|
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] stdin buffering

2004-09-09 Thread Martin Holm
I'm currently working on some stuff with php-cli and got a few problem.
I want to be able to read one single character from stdin via keyboard, 
ie. pressing a button.
It works fine if I use enter as newline afterwards, but I would like to 
do it without pressing enter.
Thus, I have to turn off buffering in the input stream but I can't find 
any way to do it.

Been looking everywhere on php.net but can't find any hints.
// Martin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] stdin buffering

2004-09-09 Thread Martin Holm
Greg Donald wrote:
On Thu, 2004-09-09 at 15:25, Jim Grill wrote:
 

exec(stty -icanon min 0 time 0);
   

Nice.
I suspect 'phpSnake' will appear on freshmeat in a couple days.
:)
 

thats more or less what we are trying to do. =)
pong as a start at least.
doing it all over again, this time php-style.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php