php-general Digest 8 Jun 2004 08:33:31 -0000 Issue 2809

Topics (messages 187823 through 187861):

Re: A follow up on my question about good coding practice [isset]
        187823 by: Justin Patrin

Re: Best solution for creating variables from mysql statements
        187824 by: Justin Patrin

Re: image resize looks horrible..
        187825 by: Marek Kilimajer
        187826 by: Justin Patrin

getting the line number
        187827 by: Tim Traver
        187828 by: Adam Bregenzer
        187829 by: Chris W. Parker
        187830 by: Chris W. Parker
        187834 by: Tim Traver

Adding Attaching to the mail function
        187831 by: Paul Brasseur
        187832 by: Justin Patrin
        187837 by: Manuel Lemos

include_once changed behavior?
        187833 by: Mattias Thorslund
        187835 by: Jason Wong
        187836 by: Mattias Thorslund
        187841 by: Marek Kilimajer
        187843 by: Marek Kilimajer
        187847 by: Mattias Thorslund
        187850 by: Jason Wong
        187853 by: Mattias Thorslund

Update problem
        187838 by: Maldiv
        187839 by: Blake Schroeder
        187842 by: Marek Kilimajer
        187844 by: Blake Schroeder
        187846 by: Mattias Thorslund
        187851 by: Mattias Thorslund

[OFF] - Transparency in DHTML layers?
        187840 by: Brian Dunning
        187845 by: Marek Kilimajer
        187849 by: Jason Wong
        187855 by: Knightking
        187860 by: Evan Nemerson

Re: Coding productivity benchmarks?
        187848 by: Derrick fogle

an easy (perhaps dumb) question about PHP
        187852 by: Cere Davis
        187854 by: Chris W. Parker
        187856 by: Justin Patrin
        187859 by: Michael Sims

Squirrelmail Plug
        187857 by: Steve Douville

imagemagick
        187858 by: John

gpg/php problems ....
        187861 by: Jason Davis

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 ---
Al wrote:

I could use one additional clarification regarding good practice.

As I understand the php manual the following is acceptable.

$foo= TRUE;

if($foo) do..............  ;

where $foo is a binary; but not a variable.

$foo is a boolean in this case, but it is still a variable, just like any other.


--
paperCrane <Justin Patrin>

--- End Message ---
--- Begin Message ---
Nunners wrote:

I'm creating an application which has multiple users, with their own logins
etc etc.



From it, they have a number of links to external websites, to which I need
to pass certain details, e.g.



http://somewebsite.com/index.php?username=bob
<http://somewebsite.com/index.php?username=bob&password=fred> &password=fred



For management purposes, I am wanting to have the overall URL in a MySQL
table, and want to be able to use that to get the appropriate variables from
another table.



So I have:




Table: Websites


ID

Name

Website


1

Somewebsite

http://somewebsite.com/index.php?username=$username
<http://somewebsite.com/index.php?username=$username&password=$password>
&password=$password


2

Anotherwebsite

http://anotherwebsite.net/login.php?agent=$agent


3

Agreatwebsite

http://agreatwebsite.com/index.php?user=$user
<http://agreatwebsite.com/index.php?user=$user&id=$id> &id=$id




Table: User_Website_Details


User

Website_ID

Variable

Value


Bob

1

Username

Bob


Bob

1

Password

Fred


James

2

Agent

03658264


Greg

3

User

Bob_fred


Greg

3

Id

49y5h9-845yf9





How can I get the values from the user's individual details into the
required output?



Cheers

Nunners



If you're set on doing it that way, you can set those variables, then do:

$url = eval('return "'.$urlFromDb.'";');

but that's icky and a possible security hole. I would suggest removing the query string (variables and values) from the URL you store and just looking through the User_Website_Details for the URL.

while($user_web_det = ...) {
  $url .= $user_web_det['Variable'].'='.$user_web_det['Value'].'&';
}

Since you're storing the variables uppser-cased (why?) you may have to do strtyolower on the variable field.

--
paperCrane <Justin Patrin>

--- End Message ---
--- Begin Message ---
Is $gd2 set right?

Edward Peloke wrote:
Any ideas as to how I can fix this function???

-----Original Message-----
From: Edward Peloke [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 03, 2004 4:18 PM
To: Php-General
Subject: [PHP] image resize looks horrible..


I am using the below function which does seem to resize the image yet the colors in the resized image look horrible. How can I resize the image yet keep the colors in tact?

Thanks,
Eddie

Justin-I tried your code but it didn't seem to do anything...I will just use
this function if the color will work.



function createthumb($name,$filename,$new_w,$new_h){
        global $gd2;
        $system=explode(".",$name);
        $src_img=imagecreatefromjpeg($name);
        $old_x=imageSX($src_img);
        $old_y=imageSY($src_img);
        if ($old_x > $old_y) {
                $thumb_w=$new_w;
                $thumb_h=$old_y*($new_h/$old_x);
        }
        if ($old_x < $old_y) {
                $thumb_w=$old_x*($new_w/$old_y);
                $thumb_h=$new_h;
        }
        if ($old_x == $old_y) {
                $thumb_w=$new_w;
                $thumb_h=$new_h;
        }
        if ($gd2==""){
                        $dst_img=ImageCreate($thumb_w,$thumb_h);

imagecopyresized($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y);
        }else{
                $dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);

imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y
);
        }
        if (preg_match("/png/",$system[1])){
                imagepng($dst_img,$filename);
        } else {
                imagejpeg($dst_img,$filename);
        }
        imagedestroy($dst_img);
        imagedestroy($src_img);
}


--- End Message ---
--- Begin Message ---
Are you using gd2 or not? If you're not, that's probably your problem.

Edward Peloke wrote:

Any ideas as to how I can fix this function???

-----Original Message-----
From: Edward Peloke [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 03, 2004 4:18 PM
To: Php-General
Subject: [PHP] image resize looks horrible..


I am using the below function which does seem to resize the image yet the colors in the resized image look horrible. How can I resize the image yet keep the colors in tact?

Thanks,
Eddie

Justin-I tried your code but it didn't seem to do anything...I will just use
this function if the color will work.



function createthumb($name,$filename,$new_w,$new_h){
        global $gd2;
        $system=explode(".",$name);
        $src_img=imagecreatefromjpeg($name);
        $old_x=imageSX($src_img);
        $old_y=imageSY($src_img);
        if ($old_x > $old_y) {
                $thumb_w=$new_w;
                $thumb_h=$old_y*($new_h/$old_x);
        }
        if ($old_x < $old_y) {
                $thumb_w=$old_x*($new_w/$old_y);
                $thumb_h=$new_h;
        }
        if ($old_x == $old_y) {
                $thumb_w=$new_w;
                $thumb_h=$new_h;
        }
        if ($gd2==""){
                        $dst_img=ImageCreate($thumb_w,$thumb_h);

imagecopyresized($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y);
        }else{
                $dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);

imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y
);
        }
        if (preg_match("/png/",$system[1])){
                imagepng($dst_img,$filename);
        } else {
                imagejpeg($dst_img,$filename);
        }
        imagedestroy($dst_img);
        imagedestroy($src_img);
}


WARNING: The information contained in this message and any attachments is intended only for the use of the individual or entity to which it is addressed. This message may contain information that is privileged, confidential and exempt from disclosure under applicable law. It may also contain trade secrets and other proprietary information for which you and your employer may be held liable for disclosing. You are hereby notified that any unauthorized dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify [EMAIL PROTECTED] by E-Mail and then destroy this communication in a manner appropriate for privileged information.

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


--
paperCrane <Justin Patrin>

--- End Message ---
--- Begin Message ---
Hi all,

Is it possible to get the line number of the parent script of a subroutine ???

ok, let me explain that a little better.

I have a script that includes a separate file for functions.

In a particular function, if a query gets an error, write out a log file that explains the error.

The thing I am trying to determine is from what line the call was made from the parent script to the subroutine.

I know that I can get the line number of the current script, but that doesn't tell me where the function was called from...

Hope I explained that correctly,

Thanks,

Tim.






SimpleNet's Back ! http://www.simplenet.com/

--- End Message ---
--- Begin Message ---
On Mon, 2004-06-07 at 14:52, Tim Traver wrote:
> I have a script that includes a separate file for functions.
> 
> In a particular function, if a query gets an error,  write out a log file 
> that explains the error.
> 
> The thing I am trying to determine is from what line the call was made from 
> the parent script to the subroutine.
> 
> I know that I can get the line number of the current script, but that 
> doesn't tell me where the function was called from...

debug_backtrace[1] should get you everything you want and then some.

[1] http://www.php.net/debug_backtrace

-- 
Adam Bregenzer
[EMAIL PROTECTED]
http://adam.bregenzer.net/

--- End Message ---
--- Begin Message ---
Tim Traver <mailto:[EMAIL PROTECTED]>
    on Monday, June 07, 2004 11:52 AM said:

> Is it possible to get the line number of the parent script of a
> subroutine ??? 

no, not like you want (afaik). i wanted this same thing too but ended up
just doing a workaround. it's a little kludgy but it's not *too* bad. i
just pass __LINE__ throughout all my db related functions.

(something like this)

$db = new Database;

$sql = "SELECT name FROM people";

$db->query($sql, __LINE__);

and $db->query() is setup so that when/if there is an error it will
print the line number.


hth,
chris.

--- End Message ---
--- Begin Message ---
Adam Bregenzer <mailto:[EMAIL PROTECTED]>
    on Monday, June 07, 2004 12:04 PM said:

> debug_backtrace[1] should get you everything you want and then some.
> 
> [1] http://www.php.net/debug_backtrace

that's what i get for using an older version. <trombone>mwa mwa
mwaaaaa</trombone>


chris.

--- End Message ---
--- Begin Message ---
That is exactly what I needed...

Thanks !

Tim.

At 12:04 PM 6/7/2004, Adam Bregenzer wrote:
On Mon, 2004-06-07 at 14:52, Tim Traver wrote:
> I have a script that includes a separate file for functions.
>
> In a particular function, if a query gets an error, write out a log file
> that explains the error.
>
> The thing I am trying to determine is from what line the call was made from
> the parent script to the subroutine.
>
> I know that I can get the line number of the current script, but that
> doesn't tell me where the function was called from...


debug_backtrace[1] should get you everything you want and then some.

[1] http://www.php.net/debug_backtrace

--
Adam Bregenzer
[EMAIL PROTECTED]
http://adam.bregenzer.net/

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

--- End Message ---
--- Begin Message ---

Hello:

        I am Virtual Volunteer developing a PHP Script that processes a Form
for a Youth Charity. Can anyone tell me how to add an attachment to the mail
function's fourth parameter or point me to a good tutorial on the subject ?


Regards,
Paul Brasseur
(Victoria, B.C.
Canada )

--- End Message ---
--- Begin Message ---
Paul Brasseur wrote:


Hello:

I am Virtual Volunteer developing a PHP Script that processes a Form
for a Youth Charity. Can anyone tell me how to add an attachment to the mail
function's fourth parameter or point me to a good tutorial on the subject ?



Regards, Paul Brasseur (Victoria, B.C. Canada )

You could do it yourself or use PEAR's Mail_mime package to create the mails for you. If you want to do it yourself, the source code of Mail_mime might also help. :-)


http://pear.php.net/package/Mail_mime

--
paperCrane <Justin Patrin>

--- End Message ---
--- Begin Message ---
Hello,

On 06/07/2004 04:18 PM, Paul Brasseur wrote:
I am Virtual Volunteer developing a PHP Script that processes a Form
for a Youth Charity. Can anyone tell me how to add an attachment to the mail
function's fourth parameter or point me to a good tutorial on the subject ?

You may want to try this class that you can use to compose and send messages with attachments. It comes with a specific step by step example to tell you how to use it for that purpose:


http://www.phpclasses.org/mimemessage


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

--- End Message ---
--- Begin Message ---
Hi,

In order to keep configuration files outside the web root I use:

include_once('../config.php');

This used to work also when running php scripts from the command line. Now I have a new server and I get "no such file or directory" when using this construct from the command line.

I have worked around this by doing this:

$main_folder = realpath(dirname($_SERVER['SCRIPT_FILENAME']).'/..');
include_once($main_folder . '/config.php');

The original, simpler construct still works when calling the page from a web browser, just not when I run it from the command line.

The new server has a more recent version of PHP (4.3.4). I don't have the php version of the old server but it was on RedHat 9 - now I'm on Mandrake 10.

What could be the difference that caused this?


/Mattias

--- End Message ---
--- Begin Message ---
On Tuesday 08 June 2004 03:21, Mattias Thorslund wrote:

> In order to keep configuration files outside the web root I use:
>
> include_once('../config.php');
>
> This used to work also when running php scripts from the command line.
> Now I have a new server and I get "no such file or directory" when using
> this construct from the command line.
>
> I have worked around this by doing this:
>
> $main_folder = realpath(dirname($_SERVER['SCRIPT_FILENAME']).'/..');
> include_once($main_folder . '/config.php');
>
> The original, simpler construct still works when calling the page from a
> web browser, just not when I run it from the command line.
>
> The new server has a more recent version of PHP (4.3.4). I don't have
> the php version of the old server but it was on RedHat 9 - now I'm on
> Mandrake 10.
>
> What could be the difference that caused this?

Possibly:

  manual > Using PHP from the command line > -c switch

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
You have many friends and very few living enemies.
*/

--- End Message ---
--- Begin Message ---


Jason Wong wrote:

On Tuesday 08 June 2004 03:21, Mattias Thorslund wrote:



In order to keep configuration files outside the web root I use:

include_once('../config.php');

This used to work also when running php scripts from the command line.
Now I have a new server and I get "no such file or directory" when using
this construct from the command line.

I have worked around this by doing this:

$main_folder = realpath(dirname($_SERVER['SCRIPT_FILENAME']).'/..');
include_once($main_folder . '/config.php');

The original, simpler construct still works when calling the page from a
web browser, just not when I run it from the command line.

The new server has a more recent version of PHP (4.3.4). I don't have
the php version of the old server but it was on RedHat 9 - now I'm on
Mandrake 10.

What could be the difference that caused this?



Possibly:

manual > Using PHP from the command line > -c switch



...except I don't use the -c switch?

--- End Message ---
--- Begin Message --- Mattias Thorslund wrote:
Hi,

In order to keep configuration files outside the web root I use:

include_once('../config.php');

This used to work also when running php scripts from the command line. Now I have a new server and I get "no such file or directory" when using this construct from the command line.

I have worked around this by doing this:

$main_folder = realpath(dirname($_SERVER['SCRIPT_FILENAME']).'/..');
include_once($main_folder . '/config.php');

The original, simpler construct still works when calling the page from a web browser, just not when I run it from the command line.
The new server has a more recent version of PHP (4.3.4). I don't have the php version of the old server but it was on RedHat 9 - now I'm on Mandrake 10.


What could be the difference that caused this?

/Mattias


cli php uses path relative to your current directory, cgi php uses path relative to the executing script.

--- End Message ---
--- Begin Message --- Marek Kilimajer wrote:
Mattias Thorslund wrote:

Hi,

In order to keep configuration files outside the web root I use:

include_once('../config.php');

This used to work also when running php scripts from the command line. Now I have a new server and I get "no such file or directory" when using this construct from the command line.

I have worked around this by doing this:

$main_folder = realpath(dirname($_SERVER['SCRIPT_FILENAME']).'/..');
include_once($main_folder . '/config.php');

The original, simpler construct still works when calling the page from a web browser, just not when I run it from the command line.
The new server has a more recent version of PHP (4.3.4). I don't have the php version of the old server but it was on RedHat 9 - now I'm on Mandrake 10.


What could be the difference that caused this?

/Mattias


cli php uses path relative to your current directory, cgi php uses path relative to the executing script.



You can use

ini_set('include_path', realpath(dirname($_SERVER['SCRIPT_FILENAME']).'/'));

at the beginning of your script as workaround
--- End Message ---
--- Begin Message ---

Marek Kilimajer wrote:

cli php uses path relative to your current directory, cgi php uses path relative to the executing script.

That IS interesting. That would explain why:

php /var/www/myproject/util/my-cli-script.php

... will break unless I execute it from that same directory.

I used to be able to do that from anywhere, though - that's why I passed the full path to the script. So it's got to be some configuration that's different, or that this behavior has changed.

/Mattias
--- End Message ---
--- Begin Message ---
On Tuesday 08 June 2004 04:14, Mattias Thorslund wrote:

> >>What could be the difference that caused this?

As Marek had pointed out the behaviour was changed ...

> >Possibly:
> >
> >  manual > Using PHP from the command line > -c switch
>
> ...except I don't  use the -c switch?

... IIRC just after the change php-cli had a switch that allowed the old 
behaviour, apparently this is not documented in the manual anymore so you 
probably have to use an absolute path.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
The whole world is a scab.  The point is to pick it constructively.
                -- Peter Beard
*/

--- End Message ---
--- Begin Message ---

Jason Wong wrote:

Possibly:

manual > Using PHP from the command line > -c switch

From the manual:
"The CLI SAPI does not change the current directory to the directory of the executed script!"


"Note: The CGI SAPI supports the CLI SAPI behaviour by means of the -C switch when run from the command line. "

In other words, it's possible to make the CGI version work like the CLI version (using absolute paths only). There seems to be no support for making CLI work like CGI, however.


/Mattias

--- End Message ---
--- Begin Message ---
Hello,

I have a php update form which use $_POST and $_GET too. I call the update
like this update.php?id=1
And after the user submit the form with new data I use command like this:
UPDATE table SET id=$_POST['id'] WHERE $_GET['id']='1';

This code works on localhost with Apache 2, Win XP, and Php 4.3.5 but it
doesn't works on my real server(Php 4.3.3, Linux, Apache 1.??)
I debuged it and I realised that on localhost I have the correct value in
the $_GET but in remote $_GET is empty.

What can I do?

Thanks!

--- End Message ---
--- Begin Message ---
The form that is being submitted can only be a POST or a GET not both
example:
<form method="post" action="foo.php">
<input type="text" name="foo1">
<input type="submit">
</form>

How can you do both?

-Blake

Maldiv wrote:

Hello,

I have a php update form which use $_POST and $_GET too. I call the update
like this update.php?id=1
And after the user submit the form with new data I use command like this:
UPDATE table SET id=$_POST['id'] WHERE $_GET['id']='1';

This code works on localhost with Apache 2, Win XP, and Php 4.3.5 but it
doesn't works on my real server(Php 4.3.3, Linux, Apache 1.??)
I debuged it and I realised that on localhost I have the correct value in
the $_GET but in remote $_GET is empty.

What can I do?

Thanks!




--- End Message ---
--- Begin Message --- Blake Schroeder wrote:
The form that is being submitted can only be a POST or a GET not both
example:
<form method="post" action="foo.php">
<input type="text" name="foo1">
<input type="submit">
</form>

How can you do both?


<form method="post" action="foo.php?id=1">
<input type="text" name="foo1">
<input type="submit">
</form>

Hope that answers your question ;-)
--- End Message ---
--- Begin Message ---
Put a hidden field in your form named id.

-Blake

Blake Schroeder wrote:

The form that is being submitted can only be a POST or a GET not both
example:
<form method="post" action="foo.php">
<input type="text" name="foo1">
<input type="submit">
</form>

How can you do both?

-Blake

Maldiv wrote:

Hello,

I have a php update form which use $_POST and $_GET too. I call the update
like this update.php?id=1
And after the user submit the form with new data I use command like this:
UPDATE table SET id=$_POST['id'] WHERE $_GET['id']='1';


This code works on localhost with Apache 2, Win XP, and Php 4.3.5 but it
doesn't works on my real server(Php 4.3.3, Linux, Apache 1.??)
I debuged it and I realised that on localhost I have the correct value in
the $_GET but in remote $_GET is empty.


What can I do?

Thanks!





--- End Message ---
--- Begin Message --- That will work, but the below is really supposed to work. I use it in my apps.


Blake Schroeder wrote:

Put a hidden field in your form named id.

-Blake

Mattias Thorslund wrote:

Probably with

<form method="post" action="foo.php?id=123">



Blake Schroeder wrote:

The form that is being submitted can only be a POST or a GET not both
example:
<form method="post" action="foo.php">
<input type="text" name="foo1">
<input type="submit">
</form>

How can you do both?

-Blake

Maldiv wrote:

Hello,

I have a php update form which use $_POST and $_GET too. I call the update
like this update.php?id=1
And after the user submit the form with new data I use command like this:
UPDATE table SET id=$_POST['id'] WHERE $_GET['id']='1';


This code works on localhost with Apache 2, Win XP, and Php 4.3.5 but it
doesn't works on my real server(Php 4.3.3, Linux, Apache 1.??)
I debuged it and I realised that on localhost I have the correct value in
the $_GET but in remote $_GET is empty.


What can I do?

Thanks!













--- End Message ---
--- Begin Message ---
To reply to the original post (sorry for the confusion):

Maldiv wrote:

Hello,

I have a php update form which use $_POST and $_GET too. I call the update
like this update.php?id=1
And after the user submit the form with new data I use command like this:
UPDATE table SET id=$_POST['id'] WHERE $_GET['id']='1';

This code works on localhost with Apache 2, Win XP, and Php 4.3.5 but it
doesn't works on my real server(Php 4.3.3, Linux, Apache 1.??)
I debuged it and I realised that on localhost I have the correct value in
the $_GET but in remote $_GET is empty.

What can I do?

Thanks!



I wonder if "track_vars" is off in php.ini? But then, I suppose$_POST['id'] would be empty, too.


Anyway, I'd suggest using different names for the GET and POST variables. For instance "new_ID" for the POST variable.

/Mattias

/Mattias
--- End Message ---
--- Begin Message ---
Hi,

Does anyone know if there is a spec that permits transparency of graphics in DHTML layers? I have a bottom layer which is a picture of fabric, and I have a grayscale image of wrinkles & shadows that I'd like to overlay on top of the fabric, with a certain level of transparency so the fabric is still visible in the shaded areas.

Or, if anyone knows another technology that might accomplish that, I'd appreciate those suggestions too. :)

Thanks,

Brian Dunning
http://www.briandunning.com/

--- End Message ---
--- Begin Message --- Brian Dunning wrote:
Hi,

Does anyone know if there is a spec that permits transparency of graphics in DHTML layers? I have a bottom layer which is a picture of fabric, and I have a grayscale image of wrinkles & shadows that I'd like to overlay on top of the fabric, with a certain level of transparency so the fabric is still visible in the shaded areas.

Or, if anyone knows another technology that might accomplish that, I'd appreciate those suggestions too. :)

Thanks,

Brian Dunning
http://www.briandunning.com/


Semitransparent PNGs, but that does not work in IE

http://www.petitiononline.com/msiepng/petition.html
--- End Message ---
--- Begin Message ---
On Tuesday 08 June 2004 05:51, Marek Kilimajer wrote:

> Semitransparent PNGs, but that does not work in IE
>
> http://www.petitiononline.com/msiepng/petition.html

What's the point? MS has already killed Netscape, they aren't going to improve 
IE anymore than necessary.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
If I knew what brand [of whiskey] he drinks, I would send a barrel or
so to my other generals.
                -- Abraham Lincoln, on General Grant
*/

--- End Message ---
--- Begin Message --- On Tue, 8 Jun 2004 06:17:34 +0800, Jason Wong <[EMAIL PROTECTED]> wrote:

On Tuesday 08 June 2004 05:51, Marek Kilimajer wrote:

Semitransparent PNGs, but that does not work in IE

http://www.petitiononline.com/msiepng/petition.html

What's the point? MS has already killed Netscape, they aren't going to improve
IE anymore than necessary.



There are browsers other than IE and Netscape.

--

Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--- End Message ---
--- Begin Message ---
On Monday 07 June 2004 02:51 pm, Marek Kilimajer wrote:
> Brian Dunning wrote:
> > Hi,
> >
> > Does anyone know if there is a spec that permits transparency of
> > graphics in DHTML layers? I have a bottom layer which is a picture of
> > fabric, and I have a grayscale image of wrinkles & shadows that I'd like
> > to overlay on top of the fabric, with a certain level of transparency so
> > the fabric is still visible in the shaded areas.
> >
> > Or, if anyone knows another technology that might accomplish that, I'd
> > appreciate those suggestions too.  :)
> >
> > Thanks,
> >
> > Brian Dunning
> > http://www.briandunning.com/
>
> Semitransparent PNGs, but that does not work in IE
>
> http://www.petitiononline.com/msiepng/petition.html

I never got it quite perfect, but it shouldn't take too long. I just lost 
interest after about five minutes ;)

function exploderPNGhack() {
  /* Internet Explorer PNG transparency hack
   * Evan Nemerson <[EMAIL PROTECTED]>
   *
   * This should allow MSIE to properly display transparent PNGs.
   *
   * Thanks to:
   *   http://www.alistapart.com/articles/pngopacity/
   *   http://webfx.eae.net/dhtml/pngbehavior/pngbehavior.html
  */
  if ( /MSIE (5\.5)|[6789]/.test(navigator.userAgent) && navigator.platform == 
"Win32" ) {
    var imgs = document.getElementsByTagName("img");
    var imgObjs = new Array();
    for ( x = 0 ; x < imgs.length ; x++ ) {
      if ( /\.png$/i.test(imgs.item(x).src) ) {
        imgObjs[imgObjs.length] = imgs.item(x);

        var span = document.createElement("span");
        span.mergeAttributes(imgs.item(x));

        span.style.width = imgs.item(x).width;
        span.style.height = imgs.item(x).height;
        span.style.filter = 
"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" +
        imgs.item(x).src + "',sizingMethod='scale')";

        imgs.item(x).parentNode.insertBefore(span, imgs.item(x));
      }
    }
  }
}

-- 
Evan Nemerson
[EMAIL PROTECTED]
http://coeusgroup.com/en

--
"They that can give up essential liberty to obtain a little temporary safety 
deserve neither liberty nor safety."

-Benjamin Franklin

--- End Message ---
--- Begin Message ---
On Jun 7, 2004, at 11:39 AM, Tyler Replogle wrote:

I just did all of that and it took me 1 hour and 35 mins

Just for grins and giggles, why don't I post the exact assignment specs?

FYI, I've never really had to deal with file uploads and downloads before. It probably took me to an hour to research PHP file upload/download/MySQL storage, and get that part working. I could do it much faster next time ;-)

As for the layout issue, I suppose that's my big 'weak point' as a developer. The templates I started from have a basic interface structure already, so I went ahead and developed the code and the basic interface together. That took extra time beyond just puking out the bare minimum. I've spent so many years doing database development for customers that I view the real functionality of an application by how the interface looks and acts more than how the underlying code is written. I just can't see the forest for the trees, and I can't see a functional web app without an interface that matches the workflow.

Anyway, here's the actual assignment specs:

--------------------
XXX Company is publishing an on-line journal and needs to provide a system for electronic manuscript management with the following features:
1. All submitted documents should be able to be uploaded and downloaded in word format.
2. There should be 3 user roles: Author, Reviewer and Editor
3. There should be a way for a new user to register as either one of the 3 roles. During registration, the new user should be able to enter first and last name, e-mail address and what kind of user he wishes to be (author, reviewer or editor).
4. When a user logs in to the system, he should be presented with a screen, depending on what role he has in the system.
a. As an editor, the user should be able to delete a user, change registration information of any user, view the status of each submitted article, view reviewer suggestions, accept or decline an article for publication, or assign it to a reviewer for review.
b. As a reviewer, the user should be able to download a submitted article to review and recommend the article for publication or not.
c. As an author, the user should be able to submit a file.
5. An article can have one of these states:
a. Submitted (after submission)
b. In review (after reviewers are assigned)
c. Accepted (if accepted by the editor)
d. Declined (if declined by the editor)
6. A typical workflow should consist of the following states:
a. An author submits an article. The article status becomes “submitted”. The editor may view the article (by downloading it) or assign it to a reviewer.
b. An editor assigns an article to a reviewer. The article status becomes “in review”. The reviewer may now download the article and he may also suggest accepting it or declining it.
c. A reviewer makes a suggestion. The article status remains “in review”. The editor may now view the suggestion of the reviewer and he may also accept or decline the article.
d. An editor accepts or declines an article. The article status becomes “accepted” or “declined” accordingly.
--------------------


Thanks,

-Derrick
--- End Message ---
--- Begin Message ---
I haven't been able to glean anything about this from the Oreilly books, php web site, or anywhere else so I am breaking down and asking on this list.


In other scripting languages like Perl/Ruby/Python (that aren't meant to live in the web environment exclusively) there usually have a web library that writes basic html form input html types for like radio_button(name,val) and checkbox(name,val) type functions. I can't see that php has this type of feature. Perhaps this is deliberate as not having something preset affords more flexability in a way, I just want to be sure I am not missing something... does this kind of thing exist in PHP? Thanks.

-Cere
--- End Message ---
--- Begin Message ---
Cere Davis <mailto:[EMAIL PROTECTED]>
    on Monday, June 07, 2004 3:28 PM said:

[snip]
> ...have a web
> library that writes basic html form input html types for like
> radio_button(name,val) and checkbox(name,val) type functions.  I can't
> see that php has this type of feature.

i'm pretty sure that a class within the PEAR library will do this. but
you could easily and very quickly write your own functions.

function radio_button($name, $value)
{
        echo "<input id=\"$name\" type=\"radio\" name=\"$name\"
value=\"$value\" />";
}

etc.



hth,
chris.

--- End Message ---
--- Begin Message --- Cere Davis wrote:

I haven't been able to glean anything about this from the Oreilly books, php web site, or anywhere else so I am breaking down and asking on this list.


In other scripting languages like Perl/Ruby/Python (that aren't meant to live in the web environment exclusively) there usually have a web library that writes basic html form input html types for like radio_button(name,val) and checkbox(name,val) type functions. I can't see that php has this type of feature. Perhaps this is deliberate as not having something preset affords more flexability in a way, I just want to be sure I am not missing something... does this kind of thing exist in PHP? Thanks.

-Cere

There are many libraries out there that do this sort of thing, it's just not distributed with PHP. Try looking in PEAR's HTML section for some HTML generating classes.


http://pear.php.net

--
paperCrane <Justin Patrin>

--- End Message ---
--- Begin Message ---
Cere Davis wrote:
> In other scripting languages like Perl/Ruby/Python (that aren't meant
> to live in the web environment exclusively) there usually have a web
> library that writes basic html form input html types for like
> radio_button(name,val) and checkbox(name,val) type functions.  I can't
> see that php has this type of feature.

A bit overkill perhaps, but pretty nifty IMHO:

http://phphtmllib.newsblob.com/

--- End Message ---
--- Begin Message ---
Kudos, kudos, kudos to the people who developed this webmail application and
kudos to people who contributed plugins. Truly an easy program to install.
The plugins are endless and also simple to install and configure.

An excellent PHP application, highly recommended for anyone that needs a
powerful, but easy to install webmail system.

--- End Message ---
--- Begin Message ---
this might be a small bit o f f t o p i c but im trying to install
imagemagick and running into a problem. im trying to crop JPEGs but
imagemagick says it has no 'image decode' for that file type! upon closer
inspection, it looks like youve to enable jpeg while configuring an install.
but could anyone tell me how to do this? im trying to install on a standard
red hat linux 8 box.
thanks

--- End Message ---
--- Begin Message ---
the code below encrypts a phrase using gpg and sends out via email ...
i get the data ok ... but my mail client does not show it ... if i "view
email sorce"  i can see the encrypted message ... what am i doing wrong?

thanks,
jd


    $username = "mohadib"; 
        $pgp="/usr/bin/gpg"; 
        $user="Zend Commerce <[EMAIL PROTECTED]>"; 
        $recp="[EMAIL PROTECTED]"; 
        //$data=$oneOrder; 
        $command = 'echo "hello word" | '.$pgp.' -a --always-trust
--batch --no-secmem-warning -e -u "'.$user.'" -r "'.$recp.'"'; 
        $oldhome = getEnv("HOME"); 
        putenv("HOME=/home/$username"); 
        $result = exec($command, $encrypted, $errorcode); 
        putenv("HOME=$oldhome"); 

        $subject="Test message"; 

        $headers  = "MIME-Version: 1.0\r\n"; 
        $headers .= "Content-Type: multipart/encrypted;
protocol=\"application/pgp-encrypted\";
boundary=\"=-uc4rTrDFZtVQGtcexwyv\"\r\n"; 

        $message = "--=-uc4rTrDFZtVQGtcexwyv 
Content-Type: application/pgp-encrypted 
Content-Transfer-Encoding: 7bit 

Version: 1 

--=-uc4rTrDFZtVQGtcexwyv 
Content-Type: application/octet-stream; name=encrypted.asc 
Content-Transfer-Encoding: 7bit\n\n"; 

        $message .= implode("\n", $encrypted); 
        $message .= "\n\n--=-uc4rTrDFZtVQGtcexwyv--"; 
        mail($recp,$subject,$message,$headers);

--- End Message ---

Reply via email to