php-general Digest 2 Mar 2002 08:58:08 -0000 Issue 1202
Topics (messages 86834 through 86886):
Re: get the median from an array of integers
86834 by: Jason Wong
86837 by: Erik Price
Re: compile php with GD2
86835 by: Hendrik
Non printable page
86836 by: Diana Castillo
86838 by: Scott St. John
86839 by: Lars Torben Wilson
86843 by: Scott St. John
86867 by: William Lovaton
86882 by: Michael Kimsal
Re: passing array of variables in a query string
86840 by: Richard Baskett
Re: Unable to display images on browser
86841 by: Narvaez, Teresa
86852 by: Andrew Brampton
86853 by: Narvaez, Teresa
86855 by: Andrew Brampton
Re: empty() & texarea
86842 by: Richard Baskett
how to use PHP on command line in windows
86844 by: Peter J. Schoenster
86845 by: Scott St. John
safe mode and file handling
86846 by: Mika Lindqvist
86847 by: Rasmus Lerdorf
86851 by: Jim Lucas [php]
Announcement: Smarty template engine 2.0 available
86848 by: Monte Ohrt
Re: mysql and telnet.
86849 by: Andrew Chase
Andy...
86850 by: Sean Kennedy
PHP Job opportunity, Washington DC Area
86854 by: Alok K. Dhir
Email MIME Support?
86856 by: Steven Walker
86868 by: olev rumm
Re: PHP and passwords
86857 by: William Lovaton
86860 by: Rasmus Lerdorf
Re: Building secure authentification with sessions
86858 by: Matthew Crouch
showing last mod. of *included* file
86859 by: Timothy J. Luoma
86879 by: Jason Wong
86885 by: Timothy J. Luoma
Arabic Form Input - Help!
86861 by: anarchocipher
Variables that can't be set by query string
86862 by: James Taylor
86864 by: Erik Price
Re: Overriding session headers
86863 by: William Lovaton
86884 by: Daniel Grace
Re: error msg
86865 by: William Lovaton
Time to recompile - time to add functionality
86866 by: Scott Brown
Problem with global variables?
86869 by: Jeff Lewis
how do you install this patch?
86870 by: Websitecd.aol.com
Re: can I sandwich html docs with PHP
86871 by: Michael Kimsal
86872 by: Michael Kimsal
86873 by: Rasmus Lerdorf
Re: just wanna know
86874 by: Quentin Bennett
86886 by: Boaz Yahav
help please -- error compiling php 4.1.2 (4.0.6 compiles fine)
86875 by: Scott Brown
HTTP Post to another server
86876 by: Quentin Bennett
shopping cart question
86877 by: Jon Feldhammer
anyone else been having this problem???
86878 by: Ben Turner
86880 by: Sean Kennedy
Re: Global Variable Change
86881 by: Yasuo Ohgaki
Ok Gurus Shake your nudels !!!
86883 by: olev rumm
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
On Saturday 02 March 2002 02:03, Daniel Grace wrote:
> > The web page features ten listboxes, each of which contains the same
> > options. Let's say that you can choose A, B, C, D, or E from each
> > listbox. Submit the form, run some code to figure out which was
> > most-frequently selected, and then display that value on the next page.
> >
> > That's all I really want to do, but I'm pretty bad at math -- I could
> > enter all the values into an array and run some kind of averaging code
> > on them, but the problem is that I don't want an "average", I need the
> > "most-chosen" value.
>
> As for the median value, there's a relatively easy way to do this in PHP:
>
> 1. Sort the array (sort())
> 2. Count the number of elements in the array (count())
> 3. Take the element that is equal to half the number of the elements
> (rounded to an int, which way you round doesn't matter)
> (really_easy_code())
>
> Might be off-by-1 but that's fixed easily enough.
I think Erik has gotten his terms mixed. He wants the "most-chosen" value,
which is the "mode" and not "median".
To get the mode, use array_count_values();
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
/*
Grief can take care of itself; but to get the full value of a joy you must
have somebody to divide it with.
-- Mark Twain
*/
--- End Message ---
--- Begin Message ---
On Friday, March 1, 2002, at 02:28 PM, Jason Wong wrote:
> On Saturday 02 March 2002 02:03, Daniel Grace wrote:
>> As for the median value, there's a relatively easy way to do this in
>> PHP:
>
> I think Erik has gotten his terms mixed. He wants the "most-chosen"
> value,
> which is the "mode" and not "median".
>
> To get the mode, use array_count_values();
I told you guys I was bad at math! I don't even remember the terms...
thanks to everyone who replied to this thread with advice, it looks like
I can do:
- grab all values from the desired inputs and slap them into an array
- run the array against array_count_values() to get the number of each
input value in that array (in the form of a new array)
- rsort the resulting new array (of 'value => occurrences' form) to put
the
highest-numbered array at the beginning of the array
- the key of the first element in this rsorted array is the value I am
looking for -- the most-chosen value from the initial user inputs
- array_flip the array inside the first element of the rsorted array to
make
the key into the value and vice versa
- my desired value is now the value of the first element in the array
It seems like a lot of work, but sounds logical. The end result is the
most-chosen value from the user inputs becomes the value of the first
element in the array returned by array_count_values() after that array
has been rsorted and flipped.
Crazy!
Erik
PS: can anyone see a flaw in this scheme? Can anyone even tell what I'm
talking about?
----
Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
hi again,
well sorry about that, it worked when i changed it to:
./configure --with-apxs=/usr/local/apache/bin/apxs --with-xml --with-curl
--with-swf=/usr/local/flash --enable-ftp --with-gd=/usr --with-jpeg-dir=/usr/local
--with-xpm-dir=/usr/X11R6 --with-png-dir=/usr --with-imap
--with-ming=/usr/src/ming-0.2a --enable-magic-quotes --with-mysql --enable-safe-mode
--enable-track-vars --with-ttf --enable-versioning --with-zlib
...however, now i ran into another problem: Ming!
The source is located /usr/src/ming-0.2a
and the installed files are located:
/usr/lib
/usr/include
but neither of these 3 is accepted in the configure line.
Or can i just leave it in the configure line and then just add the php_ming.so file,
copy it into the extension dir and add it to php.ini file?
Regards,
Duncan
--- End Message ---
--- Begin Message ---
Is there any way tomake a page that cannot be printed??
--- End Message ---
--- Begin Message ---
Black background, white text used to work :)
On Fri, 1 Mar 2002, Diana Castillo wrote:
> Is there any way tomake a page that cannot be printed??
>
>
>
>
--
--- End Message ---
--- Begin Message ---
Diana Castillo writes:
> Is there any way tomake a page that cannot be printed??
No. If you display data on my machine I can do anything with it,
since it must exist on my machine in some form in order to be
displayed.
--
Torben Wilson <[EMAIL PROTECTED]>
http://www.thebuttlesschaps.com
http://www.hybrid17.com
http://www.inflatableeye.com
+1.604.709.0506
--- End Message ---
--- Begin Message ---
Seriously, another option that works in IE would be to use the link tag
in the <head> of the document. Put an alternate document in the tag
so when they print the page you can control the content. Here is the
tag:
<link rel=alternate media=print href="whatever.txt">
-Scott
On Fri, 1 Mar 2002, Diana Castillo wrote:
> Is there any way tomake a page that cannot be printed??
>
>
>
>
--
--- End Message ---
--- Begin Message ---
But you could save the page... change the colors and then print it.
William.
El vie, 01-03-2002 a las 15:11, Scott St. John escribió:
> Black background, white text used to work :)
>
>
> On Fri, 1 Mar 2002, Diana Castillo wrote:
>
> > Is there any way tomake a page that cannot be printed??
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
--- End Message ---
--- Begin Message ---
Diana Castillo wrote:
> Is there any way tomake a page that cannot be printed??
>
GZIP the page and force the end user to use Netscape. ???
--- End Message ---
--- Begin Message ---
If you have control over the query string, just name your variable 'state[]'
and then when it is passed through the query string as:
http://www.archipro.com/test.php?state[]=AB&state[]=BC
PHP will see that it is an array and will parse it as such and you can
access the variables as an array.
Cheers!
Rick
"We should be taught not to wait for inspiration to start a thing. Action
always generates inspiration. Inspiration seldom generates action." - Frank
Tibolt
> ----- Original Message -----
> From: "Diana Castillo" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, March 01, 2002 6:42 PM
> Subject: [PHP] passing array of variables in a query string
>
>
> I was wondering if someone could help me
> with this:
> what I need to know is how to pick up an array of variables from
> a query string such as:
> http://www.archipro.com/test.php?state=AB&state=BC
> If I use $state, I get only the last one.
--- End Message ---
--- Begin Message ---
Hello,
Thanks for your responses; however, I do not think I have the gd
libraries installed because ImageCreateFromString() was not found. I will
install it.
I have a question: I can display the PNG or GIF image using the
browser. So Why do I need the GD library? Since I store the mime type in
the database I think that a call to header() to tell the browser what type
of mime-type is coming from the database should sufice. Also, I want to
store any type of binary data into my database (PNG, GIF, word, JPG, etc) Am
I missing something?
Thanks,
-Teresa
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 28, 2002 4:12 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Unable to display images on browser
You need to insert the following lines after this line:
Header("Content-type: image/gif");
$im = ImageCreateFromString ($fileContent);
ImageGif ($im);
and then remove this line: echo $fileContent;
That should do it.
/Joakim
-----Original Message-----
From: Narvaez, Teresa [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 27, 2002 8:32 PM
To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
Subject: RE: [PHP] Unable to display images on browser
Hello, Thanks for your help. This is what I have for file1.php and
ddownloadfile.php. What I want is to click on "Donwnload now" link and be
able to get the file out of the database and display it on the browser.
Thank you in adavance, -Teresa
file1.php
-----------
<?php
while ($row = mysql_fetch_array($result))
{
?>
SOME_HTLM_CODE_TO_DISPLAY_DB_FIELDS_GOES_HERE;
// <img src=\"ddownloadfile.php?fileId=<?php echo $row["PicNum"]; ?>\"
>
<a href="ddownloadfile.php?fileId=<?php echo $row["PicNum"]; ?>" >
Download Now
</a></font>
</td>
</tr>
<?php
ddownloadfile.php
------------------
<?
$dbQuery = "Select PicNum, size, type, description, Image";
$dbQuery .= " FROM Images WHERE PicNum = $fileId";
$result = mysql_query($dbQuery)
or die ("Could not get file list: " . mysql_error() );
echo "Sent Query successfully<br>";
if ( mysql_num_rows($result) == 1)
{
$fileType = @mysql_result($result,0, "type");
$fileContent = @mysql_result($result, 0, "Image");
$filedesc = @mysql_result($result,0, "description");
$filenum = @mysql_result($result,0, "PicNum");
Header("Content-type: image/gif");
echo $fileContent;
}
else
{
echo "Record does not exist";
} // else
?>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
if u have the data stored in the DB, just chuck the data out, with the
correct mime-type header..
Andrew
----- Original Message -----
From: "Narvaez, Teresa" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, March 01, 2002 8:41 PM
Subject: RE: [PHP] Unable to display images on browser
> Hello,
> Thanks for your responses; however, I do not think I have the gd
> libraries installed because ImageCreateFromString() was not found. I will
> install it.
>
> I have a question: I can display the PNG or GIF image using the
> browser. So Why do I need the GD library? Since I store the mime type in
> the database I think that a call to header() to tell the browser what type
> of mime-type is coming from the database should sufice. Also, I want to
> store any type of binary data into my database (PNG, GIF, word, JPG, etc)
Am
> I missing something?
>
> Thanks,
> -Teresa
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 28, 2002 4:12 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] Unable to display images on browser
>
>
> You need to insert the following lines after this line:
> Header("Content-type: image/gif");
>
> $im = ImageCreateFromString ($fileContent);
> ImageGif ($im);
>
> and then remove this line: echo $fileContent;
> That should do it.
>
> /Joakim
>
> -----Original Message-----
> From: Narvaez, Teresa [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 27, 2002 8:32 PM
> To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
> Subject: RE: [PHP] Unable to display images on browser
>
>
> Hello, Thanks for your help. This is what I have for file1.php and
> ddownloadfile.php. What I want is to click on "Donwnload now" link and be
> able to get the file out of the database and display it on the browser.
> Thank you in adavance, -Teresa
> file1.php
> -----------
> <?php
> while ($row = mysql_fetch_array($result))
> {
> ?>
> SOME_HTLM_CODE_TO_DISPLAY_DB_FIELDS_GOES_HERE;
> // <img src=\"ddownloadfile.php?fileId=<?php echo $row["PicNum"];
?>\"
> >
> <a href="ddownloadfile.php?fileId=<?php echo $row["PicNum"]; ?>" >
> Download Now
> </a></font>
> </td>
> </tr>
> <?php
>
>
> ddownloadfile.php
> ------------------
> <?
> $dbQuery = "Select PicNum, size, type, description, Image";
> $dbQuery .= " FROM Images WHERE PicNum = $fileId";
> $result = mysql_query($dbQuery)
> or die ("Could not get file list: " . mysql_error() );
> echo "Sent Query successfully<br>";
> if ( mysql_num_rows($result) == 1)
> {
> $fileType = @mysql_result($result,0, "type");
> $fileContent = @mysql_result($result, 0, "Image");
> $filedesc = @mysql_result($result,0, "description");
> $filenum = @mysql_result($result,0, "PicNum");
> Header("Content-type: image/gif");
> echo $fileContent;
> }
> else
> {
> echo "Record does not exist";
> } // else
> ?>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Andrew,
That is exactly what I am trying to do but the only thing I get is a
box with an X on IE 4.0 and Netscape Communicator 4.73. Please see my a
fragement of my php code below. Thanks in advance! -Teresa
--------------------------------------
file1.php
--------------------------------------
<?php
while ($row = mysql_fetch_array($result))
{
?>
SOME_HTLM_CODE_TO_DISPLAY_DB_FIELDS_GOES_HERE;
<a href="ddownloadfile.php?fileId=<?php echo $row["PicNum"]; ?>" >
Download Now
<?php
}
?>
--------------------------------------
ddownloadfile.php
--------------------------------------
<?
$dbQuery = "Select PicNum, size, type, description, Image";
$dbQuery .= " FROM Images WHERE PicNum = $fileId";
$result = mysql_query($dbQuery)
or die ("Could not get file list: " . mysql_error() );
echo "Sent Query successfully<br>";
if ( mysql_num_rows($result) == 1)
{
$fileType = @mysql_result($result,0, "type");
$fileContent = @mysql_result($result, 0, "Image");
$filedesc = @mysql_result($result,0, "description");
$filenum = @mysql_result($result,0, "PicNum");
// Header("Content-type: image/gif");
Header("Content-type: $fileType");
echo $fileContent;
}
else
{
echo "Record does not exist";
} // else
?>
-----Original Message-----
From: Andrew Brampton [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 01, 2002 5:08 PM
To: Narvaez, Teresa; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Re: [PHP] Unable to display images on browser
if u have the data stored in the DB, just chuck the data out, with the
correct mime-type header..
Andrew
------------------------------
----- Original Message -----
From: "Narvaez, Teresa" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, March 01, 2002 8:41 PM
Subject: RE: [PHP] Unable to display images on browser
> Hello,
> Thanks for your responses; however, I do not think I have the gd
> libraries installed because ImageCreateFromString() was not found. I will
> install it.
>
> I have a question: I can display the PNG or GIF image using the
> browser. So Why do I need the GD library? Since I store the mime type in
> the database I think that a call to header() to tell the browser what type
> of mime-type is coming from the database should sufice. Also, I want to
> store any type of binary data into my database (PNG, GIF, word, JPG, etc)
Am
> I missing something?
>
> Thanks,
> -Teresa
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 28, 2002 4:12 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] Unable to display images on browser
>
>
> You need to insert the following lines after this line:
> Header("Content-type: image/gif");
>
> $im = ImageCreateFromString ($fileContent);
> ImageGif ($im);
>
> and then remove this line: echo $fileContent;
> That should do it.
>
> /Joakim
>
> -----Original Message-----
> From: Narvaez, Teresa [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 27, 2002 8:32 PM
> To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
> Subject: RE: [PHP] Unable to display images on browser
>
>
> Hello, Thanks for your help. This is what I have for file1.php and
> ddownloadfile.php. What I want is to click on "Donwnload now" link and be
> able to get the file out of the database and display it on the browser.
> Thank you in adavance, -Teresa
> file1.php
> -----------
> <?php
> while ($row = mysql_fetch_array($result))
> {
> ?>
> SOME_HTLM_CODE_TO_DISPLAY_DB_FIELDS_GOES_HERE;
> // <img src=\"ddownloadfile.php?fileId=<?php echo $row["PicNum"];
?>\"
> >
> <a href="ddownloadfile.php?fileId=<?php echo $row["PicNum"]; ?>" >
> Download Now
> </a></font>
> </td>
> </tr>
> <?php
>
>
> ddownloadfile.php
> ------------------
> <?
> $dbQuery = "Select PicNum, size, type, description, Image";
> $dbQuery .= " FROM Images WHERE PicNum = $fileId";
> $result = mysql_query($dbQuery)
> or die ("Could not get file list: " . mysql_error() );
> echo "Sent Query successfully<br>";
> if ( mysql_num_rows($result) == 1)
> {
> $fileType = @mysql_result($result,0, "type");
> $fileContent = @mysql_result($result, 0, "Image");
> $filedesc = @mysql_result($result,0, "description");
> $filenum = @mysql_result($result,0, "PicNum");
> Header("Content-type: image/gif");
> echo $fileContent;
> }
> else
> {
> echo "Record does not exist";
> } // else
> ?>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
RE: [PHP] Unable to display images on browserI've never done this in PHP, but one way
of testing if your output is correct is telnet to your webserver and request the php
script yourself. Then request a valid JPG (or whatever), and compare the outputs..
If you have netcat (great tool), you can do this:
nc localhost 80 -v >> output.txt
GET /ddownloadfile.php?fileId=1 HTTP/1.0
and in output.txt would be some headers and some raw data, and u can compare this to a
normal jpg request.
If you don't have netcat, then just use standard telnet that comes with windows and
type
GET /ddownloadfile.php?fileId=1 HTTP/1.0
for the request as normal
Hope this helps
Andrew
----- Original Message -----
From: Narvaez, Teresa
To: 'Andrew Brampton' ; [EMAIL PROTECTED] ; [EMAIL PROTECTED]
Sent: Friday, March 01, 2002 10:21 PM
Subject: RE: [PHP] Unable to display images on browser
Andrew,
That is exactly what I am trying to do but the only thing I get is a box
with an X on IE 4.0 and Netscape Communicator 4.73. Please see my a fragement of my
php code below. Thanks in advance! -Teresa
--------------------------------------
file1.php
--------------------------------------
<?php
while ($row = mysql_fetch_array($result))
{
?>
SOME_HTLM_CODE_TO_DISPLAY_DB_FIELDS_GOES_HERE;
<a href="ddownloadfile.php?fileId=<?php echo $row["PicNum"]; ?>" >
Download Now
<?php
}
?>
--------------------------------------
ddownloadfile.php
--------------------------------------
<?
$dbQuery = "Select PicNum, size, type, description, Image";
$dbQuery .= " FROM Images WHERE PicNum = $fileId";
$result = mysql_query($dbQuery)
or die ("Could not get file list: " . mysql_error() );
echo "Sent Query successfully<br>";
if ( mysql_num_rows($result) == 1)
{
$fileType = @mysql_result($result,0, "type");
$fileContent = @mysql_result($result, 0, "Image");
$filedesc = @mysql_result($result,0, "description");
$filenum = @mysql_result($result,0, "PicNum");
// Header("Content-type: image/gif");
Header("Content-type: $fileType");
echo $fileContent;
}
else
{
echo "Record does not exist";
} // else
?>
-----Original Message-----
From: Andrew Brampton [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 01, 2002 5:08 PM
To: Narvaez, Teresa; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Re: [PHP] Unable to display images on browser
if u have the data stored in the DB, just chuck the data out, with the
correct mime-type header..
Andrew
------------------------------
----- Original Message -----
From: "Narvaez, Teresa" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, March 01, 2002 8:41 PM
Subject: RE: [PHP] Unable to display images on browser
> Hello,
> Thanks for your responses; however, I do not think I have the gd
> libraries installed because ImageCreateFromString() was not found. I will
> install it.
>
> I have a question: I can display the PNG or GIF image using the
> browser. So Why do I need the GD library? Since I store the mime type in
> the database I think that a call to header() to tell the browser what type
> of mime-type is coming from the database should sufice. Also, I want to
> store any type of binary data into my database (PNG, GIF, word, JPG, etc)
Am
> I missing something?
>
> Thanks,
> -Teresa
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 28, 2002 4:12 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] Unable to display images on browser
>
>
> You need to insert the following lines after this line:
> Header("Content-type: image/gif");
>
> $im = ImageCreateFromString ($fileContent);
> ImageGif ($im);
>
> and then remove this line: echo $fileContent;
> That should do it.
>
> /Joakim
>
> -----Original Message-----
> From: Narvaez, Teresa [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 27, 2002 8:32 PM
> To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
> Subject: RE: [PHP] Unable to display images on browser
>
>
> Hello, Thanks for your help. This is what I have for file1.php and
> ddownloadfile.php. What I want is to click on "Donwnload now" link and be
> able to get the file out of the database and display it on the browser.
> Thank you in adavance, -Teresa
> file1.php
> -----------
> <?php
> while ($row = mysql_fetch_array($result))
> {
> ?>
> SOME_HTLM_CODE_TO_DISPLAY_DB_FIELDS_GOES_HERE;
> // <img src=\"ddownloadfile.php?fileId=<?php echo $row["PicNum"];
?>\"
> >
> <a href="ddownloadfile.php?fileId=<?php echo $row["PicNum"]; ?>" >
> Download Now
> </a></font>
> </td>
> </tr>
> <?php
>
>
> ddownloadfile.php
> ------------------
> <?
> $dbQuery = "Select PicNum, size, type, description, Image";
> $dbQuery .= " FROM Images WHERE PicNum = $fileId";
> $result = mysql_query($dbQuery)
> or die ("Could not get file list: " . mysql_error() );
> echo "Sent Query successfully<br>";
> if ( mysql_num_rows($result) == 1)
> {
> $fileType = @mysql_result($result,0, "type");
> $fileContent = @mysql_result($result, 0, "Image");
> $filedesc = @mysql_result($result,0, "description");
> $filenum = @mysql_result($result,0, "PicNum");
> Header("Content-type: image/gif");
> echo $fileContent;
> }
> else
> {
> echo "Record does not exist";
> } // else
> ?>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
This is a simple solution and it should work and you'll probably kick
yourself when you hear it *grin* Use:
<textarea rows=8 cols=50 name=open_why_good_consult><?echo
$open_why_good_consult?></textarea>
Put it all on one line, because the way you have it currently there are
white spaces in the textarea and a newline so it's always going to be FALSE
when testing to see if it's empty.
Cheers!
Rick
"And God shall wipe away all tears from their eyes; and there shall be no
more death, neither sorrow, nor crying, neither shall there be any more
pain: for the former things are passed away." - Revelation 21:4
> From: John Fulton <[EMAIL PROTECTED]>
> Date: Fri, 1 Mar 2002 11:45:07 -0500 (EST)
> To: [EMAIL PROTECTED]
> Subject: [PHP] empty() & texarea
>
>
> I can't seem to get empty() to check if someone has left
> a textarea unanswered in an online form with code like
> the following:
>
> <textarea rows=8 cols=50 name=open_why_good_consult>
> <?echo $open_why_good_consult?>
> </textarea>
>
> if(empty($open_why_good_consult)) {
> print "Please fill in why you would be a good consultant";
> }
>
>
> Any ideas? It seems to work for things like this:
>
> <input type=text name=user_name size=8 value="<?echo $user_name?>">
>
> if empty($user_name) {
> print "Please fill in a username";
> }
>
> I suppose it is because the variable is not getting posted. Is
> there a way to post the variable?
>
> Thanks.
>
> John
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Hi,
I use NT for development and I like to write snippets of code and
test them on my local box. I can do this in Perl. How can I do that
in PHP without installing a webserver etc. etc. I guess I can install
a version of PHP and just make sure I've got the path in my env.
Thanks,
Peter
http://www.readbrazil.com/
Answering Your Questions About Brazil
--- End Message ---
--- Begin Message ---
Just download the CGI version and call it from the command line. I am
doing a project now based entirely on the command line using PHP as a file
parser on Win 2K. You can add it to your path or just call it:
c:\php\php.exe -q nameOfScript.php
Make sure you write it like a normal PHP script with the tags <?. The -q
will supress the HTTP headers.
-Scott
On Fri, 1 Mar 2002, Peter J. Schoenster wrote:
> Hi,
>
> I use NT for development and I like to write snippets of code and
> test them on my local box. I can do this in Perl. How can I do that
> in PHP without installing a webserver etc. etc. I guess I can install
> a version of PHP and just make sure I've got the path in my env.
>
> Thanks,
>
> Peter
> http://www.readbrazil.com/
> Answering Your Questions About Brazil
>
>
--
--- End Message ---
--- Begin Message ---
I and my www space provider have fought with a problem. All
files/directories created by PHP are owned by nobody/nobody and we want
them to be created by my own uid/guid. How this would be solved by least
amount of modification in the scripts.
The problem is in that safe mode requires that the script and the
directory containing the file/directory to be accessed is owned by me
and only me. If I tell PHP to create a directory test1 under my www root
and then change to that directory and tell it to create another
directory for example called test2, it fails because test1 is owned by
nobody, not me.
--- End Message ---
--- Begin Message ---
The easiest way to make this work is to use open_basedir settings instead
of safe_mode. Safe_mode is specifically created to prevent you from doing
what you are trying to do.
-Rasmus
On Fri, 1 Mar 2002, Mika Lindqvist wrote:
> I and my www space provider have fought with a problem. All
> files/directories created by PHP are owned by nobody/nobody and we want
> them to be created by my own uid/guid. How this would be solved by least
> amount of modification in the scripts.
>
> The problem is in that safe mode requires that the script and the
> directory containing the file/directory to be accessed is owned by me
> and only me. If I tell PHP to create a directory test1 under my www root
> and then change to that directory and tell it to create another
> directory for example called test2, it fails because test1 is owned by
> nobody, not me.
>
--- End Message ---
--- Begin Message ---
if you are on a unix system running with apache, you could modify the
virtual host block and have apache run as your user name and then change the
permissions of the docroot so you are the owner and group.
Jim Lucas
www.bend.com
----- Original Message -----
From: "Mika Lindqvist" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 01, 2002 1:21 PM
Subject: [PHP] safe mode and file handling
> I and my www space provider have fought with a problem. All
> files/directories created by PHP are owned by nobody/nobody and we want
> them to be created by my own uid/guid. How this would be solved by least
> amount of modification in the scripts.
>
> The problem is in that safe mode requires that the script and the
> directory containing the file/directory to be accessed is owned by me
> and only me. If I tell PHP to create a directory test1 under my www root
> and then change to that directory and tell it to create another
> directory for example called test2, it fails because test1 is owned by
> nobody, not me.
>
--- End Message ---
--- Begin Message ---
Smarty 2.0 is out!
The most notable new things:
*) Smarty has been rewritten with an underlying plugin architecture,
so adding functions, modifiers, compiler functions, prefilters,
postfilters, resources, and insert functions is as easy as dropping
a file into the plugin directory.
*) Performance, performance, performance! The benchmark page shows the
huge steps Smarty has made in performance, as well as comparisons to
other well known template engines.
*) Completely reorganized documentation, available in HTML and PDF.
*) Smarty no longer depends on PEAR.
http://www.phpinsider.com/php/code/Smarty/
http://www.phpinsider.com/php/code/Smarty/docs/
http://www.phpinsider.com/php/code/Smarty/benchmarks/
http://www.phpinsider.com/php/code/Smarty/downloads/
Version 2.0.0
-------------
- added "eval" function plugin for evaluating variables as
templates. (Monte)
- removed $tpl_file_ext class variable, no longer used. (Monte)
- added "hex" and "hexentity" escape types to escape modifier.
(Monte)
- removed dependency on PEAR. (Andrei)
- update popup_init to accept src attribute. (Monte, Duncan Forrest)
- implemented several optimizations, speeding up Smarty
significantly in most cases. (Andrei,Monte)
- implemented plugin architecture. (Andrei)
- added wordwrap and indent modifiers. (Monte)
- added support for 'If-Modified-Since' headers for cached content.
(Monte)
- removed insert_tag_check class variable, no longer needed. (Monte)
- optimized cache fetches by scanning for insert tags only if they
exist. (Monte)
- fixed bugs in overlib. (Monte, Duncan Forrest)
- fixed a problem with compile_id usage. (Andrei)
- fixed problem with using assigned vars with {include_php ...}
filepath. (Monte)
--
Monte Ohrt <[EMAIL PROTECTED]>
Director of Technology, ispi Inc.
--- End Message ---
--- Begin Message ---
Hmm, I'm assuming you're paying someone to host your site? Can't you give
the hosting company a quick call or e-mail re: whether or not they offer
MySQL? They would probably know better than we would. ;)
-Andy
> Thanks for the advice... But now I need to know what all this means:
>
> /home/chiliasp/odbc/direct/locale/en_US/LC_MESSAGES/ivmysql15.po
> /home/sites/home/web/CFIDE/administrator/datasources/drivers/myodb
> c_mysql.cfm
> /home/sites/home/web/CFIDE/administrator/datasources/drivers/mysql.cfm
> /home/sites/home/web/CFIDE/administrator/server_settings/drivers/mysql.cfm
> /home/coldfusion/lib/locale/en_US/LC_MESSAGES/CFmysql15.mo
> /home/coldfusion/lib/CFmysql15.so
> /home/coldfusion/scripts/mysql_expire.cfm
--- End Message ---
--- Begin Message ---
hi,
no, i'm not paying for my host. its from my isp. they didn't know. i'm not
asking if you know if i have it. i'm asking for help with figuring it out via
telnet. i got it. so thanks for your help anyway.
-sean kennedy
-http://www.gdesigns.vcn.com
--- End Message ---
--- Begin Message ---
We have an immediate position available for an experienced web developer
with the following skills:
Required skills (1.5+ years in each):
- PHP web development in a Linux/Unix environment
- SQL (MySQL preferred)
- HTML/Javascript
Plusses:
- Linux/Unix sysadmin experience
- OO programming
- Perl/Java/JSP
- UML
- CVS
The position is contract to permanent.
If you are interested in working on some exciting projects with an strong DC
area company, please send a cover letter and resume with salary requirements
to [EMAIL PROTECTED]
More information at: http://www.symplicity.com/about/solutions.php
Alok K. Dhir
[EMAIL PROTECTED]
Symplicity Corporation
http://www.symplicity.com
--- End Message ---
--- Begin Message ---
Hello,
I've just moved my website to a new server and sendmail is not working
the same. My email messages (sent via mail()) are coming out blank or
with mime attachments. To verify my sanity, I tested this same script on
the old server and it came through fine. The new server seems to like
only plain text emails with no headers.
Does mime support have to be enabled for sendmail?
Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Have a same problem.
Moved my mime stuff just for testing to other server and
not working at all.
working version www.toolmecindustries.com/submform.php
not workin version at http://streetrave.tartu.ee/toolmec/submform.php
what to do - good question......
Olev.
"Steven Walker" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED].;
> Hello,
>
> I've just moved my website to a new server and sendmail is not working
> the same. My email messages (sent via mail()) are coming out blank or
> with mime attachments. To verify my sanity, I tested this same script on
> the old server and it came through fine. The new server seems to like
> only plain text emails with no headers.
>
> Does mime support have to be enabled for sendmail?
>
> Steven J. Walker
> Walker Effects
> www.walkereffects.com
> [EMAIL PROTECTED]
>
--- End Message ---
--- Begin Message ---
If you use just and .inc file any user with a browser can hit in the
URL: http://www.site.com/connect.inc and see what is inside.
So, de recomendation is:
Use a .php extension: connect.inc.php
William
El jue, 28-02-2002 a las 14:16, Sam Masiello escribió:
>
> What you could do is have a script called connect.inc which has your
> pg_pconnect statement, then use the "include" directive to include your
> connect.inc on all of your subsequent PHP pages. This way you only have the
> username/password hard coded in one location so if the username/password
> were to change, you only have to change one script instead of changing many.
>
> HTH
>
> Sam Masiello
> Software Quality Assurance Engineer
> Synacor
> (716) 853-1362 X289
> [EMAIL PROTECTED]
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
--- End Message ---
--- Begin Message ---
No, that is not a good idea. It is potentially much worse to allow people
to execute include files out of context than to merely let them see them.
The correct way to handle this is to either put your include files outside
the document_root, or add an Apache rule to block any direct access to
.inc files.
-Rasmus
On 1 Mar 2002, William Lovaton wrote:
> If you use just and .inc file any user with a browser can hit in the
> URL: http://www.site.com/connect.inc and see what is inside.
>
> So, de recomendation is:
>
> Use a .php extension: connect.inc.php
>
>
> William
>
>
> El jue, 28-02-2002 a las 14:16, Sam Masiello escribió:
> >
> > What you could do is have a script called connect.inc which has your
> > pg_pconnect statement, then use the "include" directive to include your
> > connect.inc on all of your subsequent PHP pages. This way you only have the
> > username/password hard coded in one location so if the username/password
> > were to change, you only have to change one script instead of changing many.
> >
> > HTH
> >
> > Sam Masiello
> > Software Quality Assurance Engineer
> > Synacor
> > (716) 853-1362 X289
> > [EMAIL PROTECTED]
>
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
this is in the ballpark:
http://phpbuilder.com/columns/ying20000602.php3?page=1
Andy wrote:
> Hi there,
>
> I did recently read an article about security. Now I absolutly see the need
> of recoding my authentification procedure on a community site.
>
> There are questions I hoped some of you guys can answer....
>
> 1. Is storing sensitive data like permission level secure in session
> variables?
>
> 2. What could be a good way to session register a user and know which users
> are online, know their permission level in congungtion with a MySQL db?
>
> 3. Is it better to store the needed info about the user in a db table
> holding all current sessions, or to store it in more than 1 session
> variable.
>
> 4. Maybe someone can relate to a good site dealing with security issuses on
> this topic. I would really like to avoid that some hacker gets admin access
> on my website :-)
>
> Thanx for any hints,
>
> Cheers Andy
--- End Message ---
--- Begin Message ---
I have been using this code to show the last modified time:
(Note: the following was adapted from http://www.terrabyte.dc.com.au/phpscripts.php3 )
// the server is 13 hours ahead of Eastern Time USA
$hourdiff = "13";
$timeadjust = ($hourdiff * 60 * 60);
$eastern_time = date("d M Y g:ia",getlastmod() - $timeadjust);
echo "Last modified: $eastern_time (ET/USA) <br />";
This works really well, except for one thing.
All of my pages have two required parts:
index.php
body.html
and two optional parts
header.html
footer.html
The code above is 'include'd into 'index.php'
'index.php' is a boilerplate, and will hardly ever change.
The optional files are not likely to change all that often, if ever, if
they exist.
Is there a way that I can adapt the above PHP code to show the last mod.
time of 'body.html' (always the same filename) instead of index.php?
TjL
ps -- I did try to Google the solution, but this is such a specific
situation (needing to adjust the timestamp and then check the last mod of
an included file) that I did not have any luck finding anything that was
'on target'. Pointers happily selected.
--
TjL, PHP Neophyte
Site: www.tntluoma.com mailto:[EMAIL PROTECTED]
Info: Apache/1.3.19 (Unix) with PHP/4.0.6
--- End Message ---
--- Begin Message ---
On Saturday 02 March 2002 07:05, Timothy J. Luoma wrote:
> I have been using this code to show the last modified time:
>
>
> // the server is 13 hours ahead of Eastern Time USA
> $hourdiff = "13";
> $timeadjust = ($hourdiff * 60 * 60);
> $eastern_time = date("d M Y g:ia",getlastmod() - $timeadjust);
> echo "Last modified: $eastern_time (ET/USA) <br />";
>
>
> This works really well, except for one thing.
>
> All of my pages have two required parts:
>
> index.php
> body.html
>
> and two optional parts
>
> header.html
> footer.html
[snip]
> Is there a way that I can adapt the above PHP code to show the last mod.
> time of 'body.html' (always the same filename) instead of index.php?
Use filemtime().
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
/*
Your mode of life will be changed for the better because of new developments.
*/
--- End Message ---
--- Begin Message ---
> Use filemtime().
UGH! There are so many things to learn! I hate asking obvious questions
like this, but I'm still not finding the right search terms. I appreciate
your patience.
FYI the answer to my problem was found at
http://www.php.net/manual/en/function.filemtime.php
[EMAIL PROTECTED]
28-Aug-2000 02:33
This one reads all files in directory and prints only the newest date
--- End Message ---
--- Begin Message ---
Hello, I am writing software which uses MySQL as a
backend. I need to accept Arabic form input, store it
in MySQL, and use it later. I don't believe MySQL
supports Unicode except in BLOB column types, so I
want to convert it to NCR (numeric character html
entities). After looking at iconv() and recode(), I
think I need to use mb_encode_numericentity(). Some
questions:
1) Does that sound right? Accept Arabic form input and
then use mb_encode_numericentity() to convert it to
html character entities and then store in db?
2) Does anyone know where I can get a conversion map
for Arabic text? I'm still not sure what the encoding
is used by browsers to submit Arabic, iso-8859-6 I am
assuming.
3) Any other words of advice? :)
Thank you for any help! I have spent a lot of time
poring over manuals and technical papers to learn this
i18n stuff but I am stuck with the best way to
implement this in a web application I need to finish
(a non-commercial web project). Thank you!
[EMAIL PROTECTED]
__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com
--- End Message ---
--- Begin Message ---
I have a weblog type script I'm building for a friend where there are main
posts then comments - Registered users can post comments, unregistered don't
even have the option. I was thinking of making a page where a user logs on,
then it registers a session with a few variables like $sid, $username, etc.
IF a user is logged on, they can post, if not they don't even see the option.
Instead of doing a SQL query everytime they look at the posts, I was thinking
of registering a variable called like $true where if they're logged on, it's
set, and if it's set they see the option to post. The only thing I'm worried
about though is that someone could probably figure out to type in something
like comments.php?true=1 and that would allow anonymous posting, which I
don't want. Is there anyway to set a variable that can't be set in a query
string? Or, is there even a better way of doing something like this?
Sorry if I don't make much sense in this question, explaining what a script
is supposed to do is kind of difficult for me :)
--- End Message ---
--- Begin Message ---
On Friday, March 1, 2002, at 06:11 PM, James Taylor wrote:
> IF a user is logged on, they can post, if not they don't even see the
> option.
> Instead of doing a SQL query everytime they look at the posts, I was
> thinking
> of registering a variable called like $true where if they're logged on,
> it's
> set, and if it's set they see the option to post. The only thing I'm
> worried
> about though is that someone could probably figure out to type in
> something
> like comments.php?true=1 and that would allow anonymous posting, which I
> don't want. Is there anyway to set a variable that can't be set in a
> query
> string? Or, is there even a better way of doing something like this?
Have you investigated the possibility of turning register_globals=off ?
That's exactly why this recommendation was made. This keeps any GET
variables passed in the querystring (like the way you describe true=1
being passed) from being interpreted as session variables. When
register_globals=off, you have much more control and a much better sense
of where your variables are coming from and which variables you are
privileging to perform actions. This is because every variable (apart
from variables that are created only for the purposes of the current
script) is marked as being within the $_POST or $_GET or $_SESSION
array, etc. Someone can send GET variables like comments.php?true=1 all
they want, but your script doesn't globalize them -- and your script is
also specifically programmed to only check the $_SESSION array for the
presence of "true=1" (i.e. : if ($_SESSION['true'] == 1) etc). Thus
any extraneous GET variables just bounce off your script, having no
effect unless the script specifically looks for $_GET['true'] or
something.
Erik
----
Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
May be this helps:
http://www.php.net/manual/en/function.ob-start.php
William.
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
--- End Message ---
--- Begin Message ---
"William Lovaton" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED].;
> May be this helps:
>
> http://www.php.net/manual/en/function.ob-start.php
>
>
Nope, that won't work. I'm not even sending output at this point, just
trying to prevent a header from being sent and I'm not being allowed to
override it.
Maybe in some later version we'll get the ability to either fine-tune what
headers the Session handler sends, or the ability to directly modify what's
being sent for headers? Pleeease?
-- Daniel Grace
(my original message is re-quoted for context below)
Is there a way to override the headers that session_start() sends to the
browser from within a PHP script? On php 4.0.4pl1 (will be upgrading to
4.1.1 later) on SOME browsers (notably, IE 6.0 on XP -- my setup), a script
I have that outputs a PDF document will misbehave in IE when the "No-store"
portion of a cache-control header is present... which PHP sends as part of
the sessions.
When this is present, IE6 will either come up with a blank page, or it'll
present your typical "You are downloading the file: blah blah blah... would
you like to open the file or save it to your computer?" dialog box. However,
the 'open' option of the dialog box will be grayed out, and clicking Save
yields an error message reading "Internet Explorer can notnot download
<location> from <host>. Internet explorer was not able to open this Internet
Site. The requested site is either unavailable or cannot be found. Please
try again later."
Like I said, it seems to be the "No-store" part of a cache-control header
that causes the problem. Change the caching options for sessions from
nocache to private fixes this, but happens to break other things on the
site. Sending my own cache-control headers with header() either merges them
with the ones the session_start sends, or does absolutely nothing (verified
by doing a GET /url HTTP/1.0 via telnet to port 80), regardless of whether
the header occurs before or after the session_start.
-- Daniel Grace
P.S. The PDF documents are generated using Wayne Munro's cpdf and cezpdf
classes, located at http://sourceforge.net/projects/pdf-php/.; They do not
require clibpdf or pdflib and are public-domain, so there are no licensing
fees involved...
--- End Message ---
--- Begin Message ---
You have to check your php.ini and set a valid tmp directory for storing
session data. Look for the session section.
William.
El vie, 01-03-2002 a las 02:52, mm fernandez escribió:
> hi. i get this error message whenever i open my page (except during the
> first time i open it). Can someone tell me what this means?
>
> Warning: open(/tmp\sess_4ed4219513a84c54eba4c1117756c572, O_RDWR) failed: m
> (2) in C:\apache\htdocs\rs_alumni\alumni.php on line 2
>
> Here is the beginning of my code:
> // <?php
> // session_start();
> // session_register("email","pwd");
> // $session=session_id();
> // ?>
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
--- End Message ---
--- Begin Message ---
Ok - the scenario:
I have a box that I lease... I have root privs, so I can do almost anything
I want to it. Almost being the key word. Unfortunately, any time I try to
upgrade a base library, I snafu the thing, and the datacenter has to rebuild
the libraries.
Right now, I've got php4.0.4pl1 to compile with a jurry rigged GD 1.8.4...
It's patched to disable freetype, and jpeg and png... since the version of
the GD libraries that are installed only support GIF -- and as I mention, if
I try to install new ones, the machine fubars...
My Question:
Has anyone been able to (or can anyone suggest a means to) build PHP (I'm
going to move up to v4.1.2) with a statically linked GD that has all the
bells and whistles?
--- End Message ---
--- Begin Message ---
We have some software where there is a form that people can enter a message
in. When submitting the form, it is directed to a function that has global
declarations for the subject and message of the post.
This worked up until yesterday. And it didn't just happen on one site, it
stopped on several sites...
Did anyone have the same thing or has anyone ever heard of this happening?
Jeff
--- End Message ---
--- Begin Message ---
How do you install this patch?
php-4.0.6-to-4.1.1.patch.gz
Regards,
Joseph A. Bannon
.............................
The Webmaster CD
http://www.thewebmastercd.com
Join our affiliate program and get paid in 5 days.
--- End Message ---
--- Begin Message ---
Peter J. Schoenster wrote:
> Using mod_perl I can write a module for any phase that Apache
> goes through while handling a request. Based upon any variables I
> want, I can tell Apache to have my module handle one of those
> phases. So when you request this url for example:
>
> http://www.mydomain.com/joe.html
>
> My module can take joe.html and insert it as the body of a
> template and then return that to your browser or if you request
> something else like
>
> http://www.mydomain.com/image_of_joe.gif
>
> then my module just declines to handle that and apache continues
> through it's phases.
No, mod_php can't do that - at least not at this current stage. I
*thought* I'd heard some rumblings of some of the PHP team looking to
address the issue of allowing PHP more access to the Apache request
cycle. I think there's 7 stages, and PHP is only hooked in to one
stage, IIRC.
Maybe it was Rasmus in a recent interview who suggested there might be
tighter integration with Apache, I don't know. Perhaps this is also
something for Apache 2, down the road,
>
> Here is an example (bad execution of an example though)
>
> http://161.58.230.66/images/
>
>
> I have the following .htaccess file in that directory:
>
> SetHandler perl-script
> PerlHandler Apache::Schoenster_Gallery
>
> PerlSetVar DOCROOT /usr/local/etc/httpd/htdocs/images
> PerlSetVar URL_PATH /images
>
> I can stick this .htaccess file in any directory (only makes sense
> where I have images) and it uses those 2 variables above to
> determine where to read for images and where to write the files
> which produces the frame-set that you see (the module looks in
> that file for templates to parse so I can have different looks in
> different places wihout changing the module). I say it's a bad
> execution because I'm using imagemagick to resize (regardless of
> original size). If I add new images it will automatically create a
> thumbnail (which can currently be larger than the original :) of that.
> I use a db file to cache thumbnails already created but it does
> check file modification date to see if it should resize the image or
> not.
>
> But what I want to do is to do this with html files where I'll have a
> few templates (header,footer,navigation,boxes) that will be created
> on the fly depending upon variables when a client requests an html
> file and I want to know if I can do this in PHP without rewriting the
> url (which is not such a bad option perhaps).
>
> Peter
>
I think you'll have to use url rewriting for this. Not as tight
integration as mod_perl, but if you have to use it, that's probably your
only option at this point.
Good luck!
Michael Kimsal
http://www.phphelpdesk.com
Taking the ? out of <?php
734-480-9961
--- End Message ---
--- Begin Message ---
Peter J. Schoenster wrote:
> Using mod_perl I can write a module for any phase that Apache
> goes through while handling a request. Based upon any variables I
> want, I can tell Apache to have my module handle one of those
> phases. So when you request this url for example:
>
> http://www.mydomain.com/joe.html
>
> My module can take joe.html and insert it as the body of a
> template and then return that to your browser or if you request
> something else like
>
> http://www.mydomain.com/image_of_joe.gif
>
> then my module just declines to handle that and apache continues
> through it's phases.
No, mod_php can't do that - at least not at this current stage. I
*thought* I'd heard some rumblings of some of the PHP team looking to
address the issue of allowing PHP more access to the Apache request
cycle. I think there's 7 stages, and PHP is only hooked in to one
stage, IIRC.
Maybe it was Rasmus in a recent interview who suggested there might be
tighter integration with Apache, I don't know. Perhaps this is also
something for Apache 2, down the road,
>
> Here is an example (bad execution of an example though)
>
> http://161.58.230.66/images/
>
>
> I have the following .htaccess file in that directory:
>
> SetHandler perl-script
> PerlHandler Apache::Schoenster_Gallery
>
> PerlSetVar DOCROOT /usr/local/etc/httpd/htdocs/images
> PerlSetVar URL_PATH /images
>
> I can stick this .htaccess file in any directory (only makes sense
> where I have images) and it uses those 2 variables above to
> determine where to read for images and where to write the files
> which produces the frame-set that you see (the module looks in
> that file for templates to parse so I can have different looks in
> different places wihout changing the module). I say it's a bad
> execution because I'm using imagemagick to resize (regardless of
> original size). If I add new images it will automatically create a
> thumbnail (which can currently be larger than the original :) of that.
> I use a db file to cache thumbnails already created but it does
> check file modification date to see if it should resize the image or
> not.
>
> But what I want to do is to do this with html files where I'll have a
> few templates (header,footer,navigation,boxes) that will be created
> on the fly depending upon variables when a client requests an html
> file and I want to know if I can do this in PHP without rewriting the
> url (which is not such a bad option perhaps).
>
> Peter
>
I think you'll have to use url rewriting for this. Not as tight
integration as mod_perl, but if you have to use it, that's probably your
only option at this point.
Good luck!
Michael Kimsal
http://www.phphelpdesk.com
Taking the ? out of <?php
734-480-9961
--- End Message ---
--- Begin Message ---
> > Using mod_perl I can write a module for any phase that Apache
> > goes through while handling a request. Based upon any variables I
> > want, I can tell Apache to have my module handle one of those
> > phases. So when you request this url for example:
> >
> > http://www.mydomain.com/joe.html
> >
> > My module can take joe.html and insert it as the body of a
> > template and then return that to your browser or if you request
> > something else like
> >
> > http://www.mydomain.com/image_of_joe.gif
> >
> > then my module just declines to handle that and apache continues
> > through it's phases.
>
>
> No, mod_php can't do that - at least not at this current stage. I
> *thought* I'd heard some rumblings of some of the PHP team looking to
> address the issue of allowing PHP more access to the Apache request
> cycle. I think there's 7 stages, and PHP is only hooked in to one
> stage, IIRC.
>
> Maybe it was Rasmus in a recent interview who suggested there might be
> tighter integration with Apache, I don't know. Perhaps this is also
> something for Apache 2, down the road,
Yes, I started this work and was hoping there would be more interest out
there. If you look at the apache_hooks CVS branch you will see the code
needed to register a PHP script to handle the url translation request
stage. Each of the other stages would be implemented the same way.
-Rasmus
--- End Message ---
--- Begin Message ---
Unlike echo, print can accept only one argument
Unlike echo, print returns a value, which represents whether the print
statement suceeded.
Both are language constructs, so () are optional. Using () with echo limits
you to one argument.
All courtesy PHP 4 Bible.
Quentin Bennett
"Eoghan" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED].;
> hi
>
> whats the difference between
> print and echo ?
>
> thanks
--- End Message ---
--- Begin Message ---
This looks like a great example to add to weberdev.
would you care to spend 3 minutes and let other PHP developers enjoy
from
your experience?
You are one click away from doing a good deed :)
http://www.weberdev.com/index.php3?GoTo=addexample.php3
Sincerely
berber
Visit http://www.weberdev.com Today!!!
To see where PHP might take you tomorrow.
-----Original Message-----
From: Quentin Bennett [mailto:[EMAIL PROTECTED]]
Sent: Saturday, March 02, 2002 3:51 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: just wanna know
Unlike echo, print can accept only one argument
Unlike echo, print returns a value, which represents whether the print
statement suceeded.
Both are language constructs, so () are optional. Using () with echo
limits
you to one argument.
All courtesy PHP 4 Bible.
Quentin Bennett
"Eoghan" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> hi
>
> whats the difference between
> print and echo ?
>
> thanks
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
I'm trying to deal with the recent security advisory... but I cant get
4.1.2 to compile on my system
I'm getting :
gcc -I. -I/home/webmaster/new_build/php-4.1.2/ext/standard -I/home/webmaster
/new_build/php-4.1.2/main -I/home/webmaster/new_build/ph
p-4.1.2 -I/home/webmaster/new_build/apache_1.3.23/src/include -I/home/webmas
ter/new_build/apache_1.3.23/src/os/unix -I/home/webmaste
r/new_build/php-4.1.2/Zend -I/home/webmaster/new_build/gd-1.8.4 -I/usr/local
/include -I/home/webmaster/new_build/php-4.1.2/ext/mysql
/libmysql -I/home/webmaster/new_build/php-4.1.2/ext/xml/expat -I/home/webma
ster/new_build/php-4.1.2/TSRM -O2 -fomit-frame-pointer -
ffast-math -fexpensive-optimizations -c filestat.c && touch filestat.lo
In file included from /usr/include/sys/statfs.h:26,
from filestat.c:49:
/usr/include/statfsbuf.h:25: redefinition of `struct statfs'
make[3]: *** [filestat.lo] Error 1
make[3]: Leaving directory
`/home/webmaster/new_build/php-4.1.2/ext/standard'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory
`/home/webmaster/new_build/php-4.1.2/ext/standard'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/webmaster/new_build/php-4.1.2/ext'
make: *** [all-recursive] Error 1
[root@apollo /home/webmaster/new_build/php-4.1.2]#
However, 4.0.6 compiles fine....
Configure line (same between the 4.0.6 and the 4.1.2 attempts) is:
CFLAGS="-O2 -fomit-frame-pointer -ffast-math -fexpensive-optimizations" \
EAPI_MM=../mm-1.1.3 \
./configure \
--with-apache=../apache_1.3.23 \
--with-gd=../gd-1.8.4/ \
--with-mysql \
--with-gdbm \
--with-mhash \
--with-config-file-path=/etc \
--with-calendar=shared \
--enable-safe-mode \
--enable-magic-quotes \
--enable-trans-sid \
--enable-apc \
--enable-ftp \
--enable-debug=no \
--enable-memory-limit=yes \
--enable-xml \
--enable-track-vars
#exit
System is Redhat 5.something - patched all to hell....
Any help/direction appreciated...
--- End Message ---
--- Begin Message ---
Hi,
I want to turn some form data in to and XML document, and the HTTP Post that
data to another server. Is that possible from PHP.
As a challenge, I know it is possible in ASP!
Thanks In Advance
Quentin Bennett
mailto:[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
The way I see it, there are three options for maintaining state in php.
I've already taken the route of keeping a random session id and putting it
into a database to track a user/cart. So the only variable i need to track
is the session id. The three options I know of then are:
1. Putting the session id in the url
2. Putting the session id into a cookie
3. Putting the session id into a hidden input type and have every button be
a form
Option 3 sucks asthetically and coding wise. Option 1 is somewhat ugly
because now you have a big ole session id in your url (plus I don't think
search engines like these). Also, with option 1 you need to have a <?php
echo "?session_id=$session_id" ?> type line in every href which is a pain in
the ass. Option 2 is great, if the user uses cookies, if not, you cannot
track the user at all. Anyone have the perfect solution?
Thanks.
Jon
--- End Message ---
--- Begin Message ---
I just developed a new site and some of the users that I have go to visit the site are
prompted (under IE only) to download a language pack..... Not sure why and to top all
of that, the language pack it prompts them to download is blank.... Meaning the prompt
doesnt say what language pack.
So if the user downloads it, the page comes up, if not the page is blank (although the
source is there when they view it). Sound familiar to anyone? got any ideas what to
change/check?
Thanks!
Ben
--- End Message ---
--- Begin Message ---
Hmm.. Whats the web site address?
-GENESiS DESiGNS
-Sean Kennedy
-http://www.gdesigns.vcn.com
--- End Message ---
--- Begin Message ---
Thomas Brodkorb wrote:
> Hi folks,
>
> small problem with globals:
>
> I would like to set a variable global called "Language".
>
> This seems to be not a really problem, but it is.
>
> Index.php:
>
> <?php {
> session_start();
> if (!session_is_registered('Language')) {
> session_register('Language');
> $Language = 1031;
> }
> ...
> ?>
>
> But all other pages do not have really access to this variable without
> calling "start_session()" from within the other pages().
You must start session implicitly or explicitly. I suggest to start
session explicitly. Do not use auto start.
>
> If I call, it works.
>
> Now the real problem.
>
> I would like to set $Language by an Hyperlink with image hyperlinks, but it
> doesnt change anything.
> Within the hyperlink I call "setlanguage.php?lang=1033"
>
> <?php {
> session_start();
> if ( ($lang <> "1031") and ($lang <> "1033") ) {
> $lang= "1031"; }
> $Language = $lang;
> if (session_is_registered('Language')) {
> session_unregister('Language');
> }
> session_register('Language');
> } ?>
>
> But it doesnt change ANYTHING !!!!
What is not changed?
--
Yasuo Ohgaki
--- End Message ---
--- Begin Message ---
Mime problem.
I have my web form here www.toolmecindustries.com/submform.php
Now my email recieves all the contens thruogh [EMAIL PROTECTED] (fields
what customer filles out)
but attachment (picture fail) is shown like encrypted
here:
rewfg/wr;tlkmbwsl/kw;relktnh;wlkfdvbs.kdfnghb/asdfmgbn/.slfg
rewfg/wr;tlkmbwsl/kw;relktnh;wlkfdvbs.kdfnghb/asdfmgbn/.slfg
all like that.
Now I did an account with hotmail, yahoo and some other mail services
and sended this stuff through them - it works I recieve everything !!
Asked my ISP - they told that it is 100% my script's problem.
How is it possible?
Olev
--- End Message ---