php-general Digest 7 Mar 2004 02:14:35 -0000 Issue 2631

Topics (messages 179647 through 179675):

Re: How to write this correctly?
        179647 by: Brian V Bonini
        179658 by: joel boonstra
        179665 by: Brian V Bonini
        179675 by: Tom Rogers

Re: UK Bank Holidays 2
        179648 by: Ryan A
        179650 by: Raditha Dissanayake
        179655 by: Ryan A
        179662 by: Ben Ramsey
        179663 by: Ryan A

Re: Let's start a php-advanced list!
        179649 by: Ryan A
        179657 by: Jason Davidson
        179670 by: Galen
        179671 by: Jason Davidson
        179672 by: Marc Greenstock

Scripts for customer - service provider web available?
        179651 by: Denis L. Menezes
        179656 by: Ryan A

PHP and Apache Using up all memory
        179652 by: Juan E Suris

Question of Charset
        179653 by: edwardspl.ita.org.mo

Changing Default Charset
        179654 by: Junaid Saeed Uppal
        179666 by: Brian V Bonini

Re: when is a PDF not a PDF?
        179659 by: Jeff Harris

extra breaks in sent out emails
        179660 by: Scott Taylor
        179661 by: Ben Ramsey

domain.org/?page=pageName method
        179664 by: Barış

Mail fifth parameter
        179667 by: Enrico Comini
        179668 by: Jason Davidson
        179669 by: Marek Kilimajer

imagecreatejpeg locks php
        179673 by: kringla

preg_split - spliting string
        179674 by: Bambero

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 Sat, 2004-03-06 at 08:50, Labunski wrote:
> // or example I have some link:
> 
> <a href='index.php?action=people'>About people</a>
> 
> // so this function will output the content of people.txt file:
> 
> if ($action=="people"){
> function output() {
>     $file = file("data/people.txt");
>     foreach($file as $value ) {
>         $output .= "$value<br>";
>     }
>     return $output;
> }
>     $content = output();
> }else{
> error ();
> }
> 
> // How can I improve this function so, that it will work automaticly with
> other links (below) too.
> 
> <a href='index.php?action=industry'>Factories</a>
> <a href='index.php?action=art'>Beautiful pictures</a>
> <a href='index.php?action=animals'>Zoo</a>
> <a href='index.php?action=contact'>Contact us</a>
> 
> P.S.
> I have tried to improve If tag and the name of .txt file this way:
> if ($action=="$action"){
> function output() {
>     $file = file("data/".$action.".txt");
> 
> .. but the syntax is incorrect.
> What to do?

function output($data_file)
{
    $file = file("data/$data_file.txt");

        foreach($file as $value ) {
            $output .= "$value<br>";
        }

    return $output;
}


switch($action) {
  case "people":
     output('people');
     break;
  case "industry":
     output('industry');
     break;
  case "art"
     output('art')
     break;
  case "animals":
     output('animal');
     break;
  case "contact":
     output('contact');
     break;
}



-- 
Brian V Bonini <[EMAIL PROTECTED]>

--- End Message ---
--- Begin Message ---
On Sat, Mar 06, 2004 at 09:34:26AM -0500, Brian V Bonini wrote:
> > What to do?
> 
> function output($data_file)
> {
>     $file = file("data/$data_file.txt");
> 
>         foreach($file as $value ) {
>             $output .= "$value<br>";
>         }
> 
>     return $output;
> }
> 
> 
> switch($action) {
>   case "people":
>      output('people');
>      break;
>   case "industry":
>      output('industry');
>      break;
>   case "art"
>      output('art')
>      break;
>   case "animals":
>      output('animal');
>      break;
>   case "contact":
>      output('contact');
>      break;
> }

Hrm... why the switch() statement?  I can see the need for validating
user-submitted data, but to make it a little more flexible, maybe
something like this:

   <?php 
   function output($data_file)
   {
   # this doesn't change
   }
  
   $valid_actions = array('people', 'industry', 'art', 'animal', 'contact');
   $action        = $_GET['action'];
   if (in_array($action, $valid_actions)) {
     output($action)
   }
   else { 
     # handle error somehow
   }
   ?>

To add more valid actions, you can just extend the array of valid
actions, rather than adding clauses to the switch statement.

joel

-- 
[ joel boonstra | gospelcom.net ]

--- End Message ---
--- Begin Message ---
On Sat, 2004-03-06 at 16:17, joel boonstra wrote:

> Hrm... why the switch() statement?

Ir seemed close to what he already had going.

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

Saturday, March 6, 2004, 11:50:04 PM, you wrote:
L> // or example I have some link:

L> <a href='index.php?action=people'>About people</a>

L> // so this function will output the content of people.txt file:

L> if ($action=="people"){
L> function output() {
L>     $file = file("data/people.txt");
L>     foreach($file as $value ) {
L>         $output .= "$value<br>";
L>     }
L>     return $output;
L> }
L>     $content = output();
L> }else{
L> error ();
L> }

L> // How can I improve this function so, that it will work automaticly with
L> other links (below) too.

L> <a href='index.php?action=industry'>Factories</a>
L> <a href='index.php?action=art'>Beautiful pictures</a>
L> <a href='index.php?action=animals'>Zoo</a>
L> <a href='index.php?action=contact'>Contact us</a>

L> P.S.
L> I have tried to improve If tag and the name of .txt file this way:
L> if ($action=="$action"){
L> function output() {
L>     $file = file("data/".$action.".txt");

L> .. but the syntax is incorrect.
L> What to do?

L> Thanks,
L> Roman


do something like this:

function output($action){
  $output = ''; //if no file we return an empty string
  $fname = 'data/'.$action.'.txt';
  if(file_exists($fname){
    $file = file($fname);
    foreach($file as $value ) {
      $output .= "$value<br>";
    }
  }
  return $output;
}
if(isset($_REQUEST['action'])){
  $out = output($_REQUEST['action']);
}

-- 
regards,
Tom

--- End Message ---
--- Begin Message ---
Wowee..Now isnt this a nice response with people taking sides and
everything. :-)
Shaun,

> Ryan, I may be getting out of my league here, but if the makers of PHP
> didn't care about us here in the UK then why was this function created:
> gmmktime();

I didnt say they didnt care about you in the UK, or any particular place,
I'm not in the
states (or from there) but from Sweden, read the below part and tell me how
it sounds:

"Hi, anybody know how php calculates Swedish postal holidays?"

The above will get me a couple of replies on reading smart questions or some
asking:
where the **** is Sweden?
( :-p maybe..depending on the lists mood)

Now this would get me answers:
Hi,
I have searched the archives and google for a function that lists Swedish
postal holidays,
I found nothing, anybody know if anybody wrote such a function?

(a couple of hours later)

Ok, since you guys didnt answer (or I got smartass answers)
I have noted down all the holidays, put then into an array (or the DB) and
now am
doing this to calcalute it blah blah blah...but the results I am getting is
blah blah blh heres
my code..any ideas on what i am doing wrong?


If you read the above you immd know that the person who wrote the above has
searched
and is trying to solve their problem, not hopeing we will write the code for
you, correct me if
I am wrong (anybody on the list) but the list is for people who have taken
the first step/s and
then need help, there are exceptions of course, like for instance someone
says: "I forgot the
function that does this: (description here) can someone remind me please?"
or "sometime back
(insert topic here) was discussed...I need to use that solution anybody
remember what it was?
I couldnt find it in the archives" etc etc

To block quote Jason Wong:

> And in any case reposting the exact same question will still annoy people
> no
> matter what the time interval. If you do repost try to bring something new
> to
> the table, some signs that you have been doing some work of your own
> whilst
> waiting for a response to the earlier post.

And for the record, I didnt "single you out" the post was just
irritating...the rest of you
who dont agree..thats your opinion..and the rest of you who got pissed at
me...bite me.

Cheers,
-Ryan





On 3/6/2004 10:29:47 AM, Jason Wong ([EMAIL PROTECTED]) wrote:
> On Saturday 06 March 2004 17:10, electroteque wrote:
>
> NB Your mail client is severely broken in the quoting department.
>
> > > Which is? In most cases reposting at such a short time interval will
> only
> > > annoy a lot people.
> >
> > I think it was 4 hours apart, one at 7am another at 11am but still ..
> > google first, ask list after.
>
> If you feel the need to repost, wait at least one day. This *is* an
> international list and people *do* live, work and play in different
> timezones.
>
> And in any case reposting the exact same question will still annoy people
> no
> matter what the time interval. If you do repost try to bring something new
> to
> the table, some signs that you have been doing some work of your own
> whilst
> waiting for a response to the earlier post.
>
> Something like ...
>
> I've read the manual, chapter X, section Y and haven't found an answer to
> my
> problem;
>
> OR:
>
> I've googled for "abc xyz" and haven't found anything useful.
>
> OR:
>
> I've tried "this", "that" and "other" and I still couldn't get it to work,
>
> because I was expecting "something" and got

--- End Message ---
--- Begin Message ---
And for the record, I didnt "single you out" the post was just
irritating...the rest of you
who dont agree..thats your opinion..and the rest of you who got pissed at
me...bite me.

Cheers,
-Ryan


What come all the way from Sri Lanka to Sweden just to bite you? Good thing the authors of PHP didn't try to add support for Sri Lankan holidays they would have given up on the language. We have 30+ and there's no guarantee that if March 6 2004 is a holiday (which in fact it is) march 06 2005 will be a holiday too. (Some holidays have a 28 day cycle)


-- Raditha Dissanayake. ------------------------------------------------------------------------ http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar.

--- End Message ---
--- Begin Message ---
On 3/6/2004 5:36:01 PM, Raditha Dissanayake ([EMAIL PROTECTED]) wrote:
> >And for the record, I didnt "single you out" the post was just
> >irritating...the rest of you
> >who dont agree..thats your opinion..and the rest of you who got pissed
> at
> >me...bite me.
> >
> >Cheers,
> >-Ryan
> >
> >
> What come all the way from Sri Lanka to Sweden just to bite you? Good
> thing the authors of PHP
> didn't try to add support for Sri Lankan
> holidays they would have given up on the language. We have 30+ and
> there's
> no guarantee that if March 6 2004 is a holiday (which in fact it
> is) march 06 2005 will be a holiday too. (Some holidays have a 28 day
> cycle)
>
>
> --
> Raditha Dissanayake.

Hey Raditha,
I think you misunderstood what I meant by:

>...the rest of you who dont agree..thats your opinion..the rest of you who
got pissed at me...bite me

No matter, have a nice day.
Cheers,
-Ryan

--- End Message ---
--- Begin Message --- Ryan A wrote:
Wowee..Now isnt this a nice response with people taking sides and
everything. :-)

Ryan, I want to officially apologize since it appears that I started this mess. To me, it just appeared that you were flaming someone, and while perhaps for good cause (since he posted two threads to the list about the same topic only a matter of a few hours apart), I just felt it was uncalled for on the list. However, I didn't mean to start a war or to act as a sort of police. So, I'm sorry.


--
Regards,
 Ben Ramsey
 http://benramsey.com
 http://www.phpcommunity.org/wiki/People/BenRamsey

--- End Message ---
--- Begin Message ---
> Ryan, I want to officially apologize since it appears that I started
> this mess.  To me, it just appeared that you were flaming someone, and
> while perhaps for good cause (since he posted two threads to the list
> about the same topic only a matter of a few hours apart), I just felt it
> was uncalled for on the list.  However, I
> didn't mean to start a war or
> to act as a sort of police.  So, I'm sorry.

Hey,
Apology not necessary, we help each other out here and like everything in
life there's
a difference of opinion sometimes...among friends, acquaintances,
relationships etc

No offense taken and no hard feelings.

Cheers,
-Ryan

--- End Message ---
--- Begin Message ---
> This has come up many times before and I really don't think it will work.
> Splitting advanced users from beginners means that there will be nobody to
> answer the beginner questions which means they will get posted to the
> advanced list where the people with the answers are.  It is a
> self-defeating separation.  Having everyone in one big lump means that
> both camps and all the camps in between learn from each other.

>The other question is who decides what is advanced?  Chances are what you
>think is advanced may seem trivial to me, or vice-versa.

>-Rasmus

True, When I started learning PHP one of the guys who answered most of the
questions
for me and a lot of people was Capt John Holmes, now that dude knows a
****load of
php (I mean that as a complement). If there was an advanced list he would
probably be
in it and very unlikely that he would also be in the "newbie" list to help
which would have
made my learning curve that much harder. Some other guys who are really
helpful and
advanced are Jason, Chris, Chris, David to name a few..take all of them out
and put them
in the advanced list...and the newbies, not-so-newbies etc will follow just
coz we have no
choice when we run into problems. If only newbies and average knowledge
dudes are in
the "not advance list" it wont work coz the blind leading the blind does not
work.

My $0.2

Cheers,
-Ryan

--- End Message ---
--- Begin Message ---
I definately agree with Rasmus, seperation will only cuase migration to
the advanced list anyways, you need 'advanced' users helping the
'less-advanced' users.  This is the purpose of the list. 

Jason

Rasmus Lerdorf <[EMAIL PROTECTED]> wrote:
> 
> On Fri, 5 Mar 2004, Galen wrote:
> 
> >  From my earlier post, I've had a number of people email me, on and off
> > list, that there isn't much in the way of an "advanced" php mailing
> > list. It also sounds like at least a few people are quite interested in
> > the possibility.
> >
> > Who runs the php official mailing lists? Can we ask them to start a
> > php-advanced list? Give it a description like "Ready to take you coding
> > to the next level? Got questions about high-level PHP code? This is the
> > list for you." Redirect people asking questions like "What is SQL" and
> > "What's wrong with this code" or "How do I <insert simple task>" (which
> > a search in the manual would have found the function to do this) to the
> > php-general list. That would leave our group free to discuss meaty
> > things and really get somewhere.
> >
> > Anybody else interested in this type of list?
> 
> This has come up many times before and I really don't think it will work.
> Splitting advanced users from beginners means that there will be nobody to
> answer the beginner questions which means they will get posted to the
> advanced list where the people with the answers are.  It is a
> self-defeating separation.  Having everyone in one big lump means that
> both camps and all the camps in between learn from each other.
> 
> The other question is who decides what is advanced?  Chances are what you
> think is advanced may seem trivial to me, or vice-versa.
> 
> -Rasmus
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

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

You do make some excellent points. Maybe an advanced list isn't the greatest idea. But at least listen to what I had envisioned:

My goal was to provide an area that fosters stretching PHP. Big projects, unusual projects, weird hacks... all kinds of advanced stuff. I have thought that providing an "advanced" area might make people more likely to post stuff like "Look at this..." and provide some intriguing discussion and such. Not that it's impossible with php-general, but reading 150 posts (or at least the subject) makes it easy for that type of thing to get lost.

Obviously, the community doesn't think this is a good idea, and I do see validity in many of your points, so I'll drop this topic unless someone else wants to pursue it.

-Galen
--- End Message ---
--- Begin Message ---
Sounds like you want to have more of a discussion list rather than help
list.. which is not a bad idea, regardless of expertise.

Jason

Galen <[EMAIL PROTECTED]> wrote:
> 
> Hello All,
> 
> You do make some excellent points. Maybe an advanced list isn't the 
> greatest idea. But at least listen to what I had envisioned:
> 
> My goal was to provide an area that fosters stretching PHP. Big 
> projects, unusual projects, weird hacks... all kinds of advanced stuff. 
> I have thought that providing an "advanced" area might make people more 
> likely to post stuff like "Look at this..." and provide some intriguing 
> discussion and such. Not that it's impossible with php-general, but 
> reading 150 posts (or at least the subject) makes it easy for that type 
> of thing to get lost.
> 
> Obviously, the community doesn't think this is a good idea, and I do 
> see validity in many of your points, so I'll drop this topic unless 
> someone else wants to pursue it.
> 
> -Galen
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

--- End Message ---
--- Begin Message --- Interesting topic,

However I don't necessarily agree that newbie's wont get their question answered.

There are a lot of helpfully people out there, a lot of them are advanced in their programing but find the satisfaction of helping, or mentoring someone into advanced programming who is less advanced. I know that when i started I posted messages at phpbuilder in the newbie area. I found more often than not I would get a response from someone who cared, and would treat a newbie for what he or she is rather than a just a plain old idiot.

My point is; yes advanced users would be separated from beginners, but most of the questions asked in the beginners list would be answered by advanced programmers looking for a bit of 'fuzzy wazzies' :)

Two thumbs up for the idea.

Marc

Ryan A wrote:
This has come up many times before and I really don't think it will work.
Splitting advanced users from beginners means that there will be nobody to
answer the beginner questions which means they will get posted to the
advanced list where the people with the answers are.  It is a
self-defeating separation.  Having everyone in one big lump means that
both camps and all the camps in between learn from each other.


The other question is who decides what is advanced?  Chances are what you
think is advanced may seem trivial to me, or vice-versa.


-Rasmus


True, When I started learning PHP one of the guys who answered most of the
questions
for me and a lot of people was Capt John Holmes, now that dude knows a
****load of
php (I mean that as a complement). If there was an advanced list he would
probably be
in it and very unlikely that he would also be in the "newbie" list to help
which would have
made my learning curve that much harder. Some other guys who are really
helpful and
advanced are Jason, Chris, Chris, David to name a few..take all of them out
and put them
in the advanced list...and the newbies, not-so-newbies etc will follow just
coz we have no
choice when we run into problems. If only newbies and average knowledge
dudes are in
the "not advance list" it wont work coz the blind leading the blind does not
work.

My $0.2

Cheers,
-Ryan

--- End Message ---
--- Begin Message ---
Hello friends.

I am in a hurry to make a website where suppliers can advertise their
products and services and customers can place their requirements so the
requirements can be matched with the service providers.
Also vistors should be able to seek suppliers and customers.

Can anyone tell me where I could find a ready made scripts program that does
the above?

Thanks
denis

--- End Message ---
--- Begin Message ---
Hey,
I have seen quite a few of these on Hotscripts and other script archive
sites..
they are mostly listed under auctions and classifieds.
Check out hotscripts and after that google if you dont find what you are
looking for.

Cheers,
-Ryan


On 3/6/2004 6:03:20 PM, Denis L. Menezes ([EMAIL PROTECTED]) wrote:
> Hello friends.
>
> I am in a hurry to make a website where suppliers can advertise their
> products and services and customers can place their requirements so the
> requirements can be matched with the service providers.
> Also vistors should be able to seek suppliers and customers.
>
> Can anyone tell me where I could find a ready made scripts program that
> does
> the above?
>
> Thanks
> denis
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
Hi!

I have a problem with PHP and Apache, where Apache uses up a huge amount of memory. 
What happens is that I have a PHP script that creates a file on the fly and sends it 
directly to the broswer (as an attachment, so that the user can save it). The problem 
is that when the file is big and the client download speed is slow, the Apache process 
uses up as much memory as the file size. My guess here is that PHP keeps writing data 
as fast as it can, and Apache caches it in memory until the user can download it all.

Is there any way to avoid this?

My apologies if this is an obvious question.

Thanks,
Juan 

--- End Message ---
--- Begin Message ---
Dear All,

How to control php ( programms on Linux System ) convert the charset of
unicode from MS-SQL 2000 ?

Very thank for your help !

Edward.

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

I am on a shared account server ( virtual hosting ) given by my provider. I
want to change my charset that php uses to utf-8 but the default setting is
some other charset. Can I put some local directives in the directory of my
proggie to force php to use charset( UTF-8 ) instead of the regular charset
defined in php.ini


Regards

~uppal

--- End Message ---
--- Begin Message ---
On Sat, 2004-03-06 at 12:19, Junaid Saeed Uppal wrote:
> Hello There,
> 
> I am on a shared account server ( virtual hosting ) given by my provider. I
> want to change my charset that php uses to utf-8 but the default setting is
> some other charset. Can I put some local directives in the directory of my
> proggie to force php to use charset( UTF-8 ) instead of the regular charset
> defined in php.ini


header('Content-type: text/html; charset=UTF-8');


-- 
Brian V Bonini <[EMAIL PROTECTED]>

--- End Message ---
--- Begin Message ---
On Mar 6, 2004, "Rick Fleischer" claimed that:

|The simple example from http://www.php.net/pdf (hard-wired to paper.pdf)
|just displayed the pdf data as a dump.  I can ftp the file and it's OK.  My
|hard-wired version is shown below.
|
|<?php
|$len = filesize("paper.pdf");
|header("Content-type: application/pdf");
|header("Content-Length: $len");
|header("Content-Disposition: inline; filename=paper.pdf");
|readfile("paper.pdf");
|?>
|
|// Thanks,
|// Rick

IF you're using IE, this might help you:
http://marc.theaimsgroup.com/?l=php-general&m=106001984503131&w=2

HTH
Jeff
-- 
Registered Linux user #304026.   |  52FC 20BD 025A 8C13 5FC6
gpg key: B0890FED                |  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.
[http://www.faqs.org/rfcs/rfc1855.html]
========================================================================
A: Because it messes up the conversation.
Q: Why is top posting bad?
A: Top posting.
Q: What's the most annoying thing on mailing lists?

--- End Message ---
--- Begin Message ---
I am entering some text into a webpage, then using $_POST on the next page to recieve it. It then should email the $_POST to an email address. The problem that I am encountering is that I am getting an extra line break on every line.


If I enter

a
b

into the textarea (which is the variable through POST) and do a character count it only shows 3 - the a, the \n, the b. Yet in the email address it comes out as:

a

b

Why is this?

BTW: I am on a windows computer but the server is a unix server.

Best Regards,

Scott
--- End Message ---
--- Begin Message --- Could you post the code you're using to write your $_POST variable to the e-mail message? I seem to remember coming across a problem like this in the past, and I'd like to see your code to see if it jogs my memory.

Thanks.

BTW, it shouldn't have anything to do with the fact that you're entering the data into a form from a Windows computer and processing it with a script on a UNIX machine.



Scott Taylor wrote:


I am entering some text into a webpage, then using $_POST on the next page to recieve it. It then should email the $_POST to an email address. The problem that I am encountering is that I am getting an extra line break on every line.


If I enter

a
b

into the textarea (which is the variable through POST) and do a character count it only shows 3 - the a, the \n, the b. Yet in the email address it comes out as:

a

b

Why is this?

BTW: I am on a windows computer but the server is a unix server.

Best Regards,

Scott

-- Regards, Ben Ramsey http://benramsey.com http://www.phpcommunity.org/wiki/People/BenRamsey

--- End Message ---
--- Begin Message ---
A general thing to do while coding a site is to
include header.php at the top of the file (and
footer.php at the end of file). Another method is to
put these header and footer files together in
index.php and including the desired page between them.
We get the desired page from the query string:
domain.org/?page=pageName
$page = $_GET['pagename'];
include $page.'.php';
Is there any important difference between these two
methods? What can you say about the advanteges or
disadvanteges of one to the other?
Assume that including undesired pages is prohibited. I
mean don't write about page=../../secretpage

Thanks...

__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

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

 I have to send a email to a server where is very important the
"Return-Path" to match the identity.

If I use mail("[EMAIL PROTECTED]", "object", $message,"From:
[EMAIL PROTECTED]".
"Reply-To:[EMAIL PROTECTED]"
."Return-Path: [EMAIL PROTECTED]);

I see in the received message that return-path Is not that I want.

I try to use the fifth parameter ( "[EMAIL PROTECTED])  but I am in
safe mode then I see the warning : the fifth parameter is disabled in safe
mode.
There is a workaround for this problem ? safe_mode = on is impossible for
this server !

--- End Message ---
--- Begin Message ---
check your logs !!!! sendmail mangles the headers, in particular
return-path.. this is a horrible thing, i had a hell of a time with
almost the same problem.. investigate sendmail.

Jason

"Enrico Comini" <[EMAIL PROTECTED]> wrote:
> 
> 
> 
>  I have to send a email to a server where is very important the
> "Return-Path" to match the identity.
> 
> If I use mail("[EMAIL PROTECTED]", "object", $message,"From:
> [EMAIL PROTECTED]".
> "Reply-To:[EMAIL PROTECTED]"
> ."Return-Path: [EMAIL PROTECTED]);
> 
> I see in the received message that return-path Is not that I want.
> 
> I try to use the fifth parameter ( "[EMAIL PROTECTED])  but I am in
> safe mode then I see the warning : the fifth parameter is disabled in safe
> mode.
> There is a workaround for this problem ? safe_mode = on is impossible for
> this server !
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

--- End Message ---
--- Begin Message --- Enrico Comini wrote:

I have to send a email to a server where is very important the "Return-Path" to match the identity.

If I use mail("[EMAIL PROTECTED]", "object", $message,"From:
[EMAIL PROTECTED]".
"Reply-To:[EMAIL PROTECTED]"
."Return-Path: [EMAIL PROTECTED]);

I see in the received message that return-path Is not that I want.

I try to use the fifth parameter ( "[EMAIL PROTECTED])  but I am in
safe mode then I see the warning : the fifth parameter is disabled in safe
mode.
There is a workaround for this problem ? safe_mode = on is impossible for
this server !


You need to connect to smtp server (port 25) and send the mail this way. There are classes that will help you, e.g. smtp_mail class from http://phpclasses.org/mimemessage

--- End Message ---
--- Begin Message --- First, some ranting about safe_mode.

Results from ini_get with safe_mode=On
[memory_limit] => Array
(
     [global_value] => 8M
     [local_value] => 8M
     [access] => 7
)

And the manual says:
PHP_INI_ALL - 7 - Entry can be set anywhere

So I figure I have access to change memory_limit?

But when I do that with ini_set("memory_limit", "32M") the memory change is ignored. I still have just 8M to play with. If i turn of safe mode, I am able to change the memory limit. Please tell me if this is correct behaviour or not.

My problem is that i uploaded an image, and when I try imagecreatefromjpeg, php dies with a warning about runing out of memory. I then turn off safe mode, restart apache which takes very long time, hit imagecreatefromjpg; and it then works. But not with 8M in safe_mode.

Is there any method in Linux to monitor the resource usage of php+apache. Yes, I have checked with top, ps, procmeter3 and free, but all seems fine and dandy. Absolutely normal. So is there some kind of 'php internal memory usage' measure i can do?

I would like to be able to resize big images without any hangs in php after call to imagecreatefromjpeg(...). Is functions in php supposed to 'stop and hang' the parsing of php-files until apache is restarted when they exceed their memory boundaries. I don't think so. Looks to me like gd have to do some asertions or something.

So I took some time and make all function calls call-by-reference and removed all stupid stuff like $image = adslashes($source_image); that allocated new variables (yes, i still call addslashes...) to lower the memory usage. Maybe it did, but I still am unable to resize images bigger than 200 kb.
--- End Message ---
--- Begin Message --- Hi
I need to split a string by the: , (comma) separator, but when the comma is beetwen ""
it should be skipped.


Ex:
test ts sasa, assas "sasa,asaas" dasdas, da

=> test ts sasa
=> assas "sasa,asaas" dasdas
=> da

Thx
Bambero

--- End Message ---

Reply via email to