php-general Digest 26 Dec 2002 23:14:22 -0000 Issue 1786

Topics (messages 129347 through 129387):

Open HTTPS connection
        129347 by: John W. Holmes

language internationalisation
        129348 by: Denis L. Menezes

Populating textboxes and listboxes from a query result of a database table
        129349 by: Denis L. Menezes
        129351 by: Rick Emery
        129381 by: Gerald Timothy Quimpo

Re: Problem with comma in mail form
        129350 by: Ben Edwards
        129356 by: Ben Edwards
        129357 by: John W. Holmes
        129360 by: Ben Edwards
        129361 by: Paul Roberts

PHP session logger
        129352 by: Francisco Vaucher
        129353 by: John W. Holmes
        129354 by: Francisco Vaucher

Re: Beginner examples?
        129355 by: Rick Widmer

Installing PHP on XP
        129358 by: Todd Cary

Finding # of weekdays between 2 dates..
        129359 by: Chad Day

OOP and object references, not copies - how to do?
        129362 by: Erik Franzén

Unable to set permissions
        129363 by: Alberto Brea

Re: Mass Mailing
        129364 by: peter a

Re: Apache
        129365 by: John Nichel

unpack() based on C struct
        129366 by: Tim Molendijk

Flow diagrams.
        129367 by: Sridhar Moparthy
        129380 by: Jimmy Brake
        129384 by: Manuel Lemos

Include Problems
        129368 by: Mike Bowers
        129369 by: Mike Bowers
        129370 by: John Nichel
        129371 by: John Nichel
        129372 by: Chris Hewitt
        129373 by: Mike Bowers
        129375 by: John Nichel
        129377 by: Chris Wesley
        129378 by: Mike Bowers
        129383 by: Gerald Timothy Quimpo

email
        129374 by: Anil Garg

e-mail
        129376 by: Anil Garg
        129379 by: Paul Roberts
        129382 by: James E Hicks III

Selecting what's for deletion
        129385 by: Cesar Aracena
        129386 by: John W. Holmes

Nested Arrays
        129387 by: Beauford.2002

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 ---
What are the different ways to open an HTTPS connection from within a
script and receive back the response into a variable? I know CURL can do
it, and PHP 4.3 with OpenSSL can use fopen() to do it. Can sockets be
used at all with PHP 4.2 to get the page or maybe a system call to a
simple program to do it? This is going to be on a Win2K machine. Thanks
for any info. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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

As the subject suggests I am looking for language capabilitie on my php webpages.

Can someone please tell me which is a good way? I thought that I could have a 
database, but if so, can MySQL: handle multiple languages in the fields(like chinese 
language)? if this is possible, what about the html output : does the user need to 
install some fonts etc ?

Thanks very much
Denis
--- End Message ---
--- Begin Message ---
Hello friends,

Can someone please tell me where I can find sample scripts for populating
textboxes and listboxes on a form(when the form opens) using the data from
fields in a table?

Thanks
Denis

--- End Message ---
--- Begin Message ---
Text box:
print "<INPUT type=text name=myname value=\"$data_value\">\n";

List box:
print "<SELECT name=myselect>\n";
while($row = mysql_fetch_array($result))
{
  extract($row);
  print "<OPTION value=\"$data_value\">$data_title</OPTION>\n";
}
print "</SELECT>\n";
----- Original Message ----- 
From: "Denis L. Menezes" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 26, 2002 6:13 AM
Subject: [PHP] Populating textboxes and listboxes from a query result of a database 
table


Hello friends,

Can someone please tell me where I can find sample scripts for populating
textboxes and listboxes on a form(when the form opens) using the data from
fields in a table?

Thanks
Denis



--- End Message ---
--- Begin Message ---
On Thursday 26 December 2002 06:59 am, Rick Emery wrote:
> Text box:
> print "<INPUT type=text name=myname value=\"$data_value\">\n";

i prefer to use templates.  i use my own template code, but there are 
good template systems online that you can use, 
e.g., http://smarty.php.net is powerful.

in a simple template system, assume that there is a file (the template)
that contains HTML (in my system, i use mixed php and html, with a
special function TemplateVirtual to make things work, but in this 
example let's assume it's straight HTML to keep it simple as possible).
we load the file and replace substrings in there with the data.  the
convention is:

database fieldname is, for example, dbfield.  corresponding input fieldname
is dbfield_name, corresponding input value template (in the HTML, to be
replaced with the actual contents of the dbfield) is {dbfield_value}.
so the HTML might look like:  
<INPUT name="dbfield_name" value="{dbfield_value"}>

function templateLoad($fn)      /* returns template as one long string */
{
        $fp=file($fn,1);
        /* insert error handling here, e.g., error might not exist or be 
           unreadable */

        $ret="";
        while(list(,$v)=each($tmp))
           $ret.=$v; /* or $ret.="$v\n" is nice too but might mangle
                           multiline HTML or PHP.*/

        return $ret;
}

/* convenience/naming-consistency function only.  use str_replace 
    directly if you want (i think the maintainability/consistency is more
    valuable than the trivial speed increase */
function templateReplace($templ,$from,$to)
{
        $templ=str_replace($from,$to,$templ);
        return $templ;
}

to use this:

/* first load data from database or cookies, contents are 
in  $field1_value, $field2_value, $field3_value, etc, for 
the database fields field1, field2, field3 */

$templ=templateLoad("mytemplate.inc");
if(!$templ)     /* error handling or something */
        die("Could not load template, aborting\n");
$templ=templateReplace($templ,"{field1_value}",$field1_value);
$templ=templateReplace($templ,"{field2_value}",$field2_value);
$templ=templateReplace($templ,"{field3_value}",$field3_value);

print($templ);

template systems have been discussed a lot online.  do a google
search on templates, php, separation of display data and 
programming logic.  templates look complicated when used with
simple/small projects.  however, they become much more 
useful on larger projects since the look of the project is not 
hardcoded in your PHP.  you can do multiple looks (skins
or themes) by just switching to a different set of templates.

you can also have graphic designers working on the "look"
of the pages without needing to have them understand PHP.
they can edit just the templates, and as long as they follow
your convention on templates to be replaced and field
naming, the programming group and the graphic designers
can work separately and in parallel.

tiger

-- 
Gerald Timothy Quimpo  tiger*quimpo*org gquimpo*sni-inc.com tiger*sni*ph
Public Key: "gpg --keyserver pgp.mit.edu --recv-keys 672F4C78"
                   Veritas liberabit vos.
                   Doveryai no proveryai.
--- End Message ---
--- Begin Message --- Here is the code with suggestion added, message still gets truncated after comma.

Ben

<?

include( "common.inc" );

$db = open_db();

html_header( "Contact Us" );

if(isset($doit))
{
$errors=array();

check_email( $email, $errors );

if(!isset ($message) || $message == '')
{
array_push($errors, "Message was empty");
}

if(sizeof($errors))
{
include($SESSION["libdir"] . "/show_errors.inc");
}
else
{

$admin_email =
"\"".lookup_domain( "PARAMETERS", "ADMIN_NAME", $db )."\" <".
lookup_domain( "PARAMETERS", "ADMIN_EMAIL", $db ).">";

if(!isset($subject)) {
$subject = "Message from email form on $SERVER_NAME";
}

table_top("Sending mail...");
table_middle();

$msg = trim( stripslashes( $_POST["message"] ) );

echo $msg;

mail( "$admin_email", "$subject", "$msg", "From: $email" );

echo "<center><span class=BigText><br><br>Your mail has been sent...<br><br>";
//echo redirect( $SESSION["homedir"]."/index.php", "Home Page", 3 );
echo "<br><br></span></center>";
table_bottom();
html_footer();
exit;
}
}

table_top("Contact Us");

//echo( "Contact Us" );

table_middle();

$admin_email = lookup_domain( "PARAMETERS", "ADMIN_EMAIL", $db );

?>

<center>
<br>
<b><span class=BigText>CultureShop.org, PO Box 29683, London E2 6XH</span></b>
<br><br><b>
To send us an email fill in this form and press submit</b><br><br>
<form method="post">
<input type=hidden name=doit value=1>
<b>Your Email Address:</b>
<br>
<input type="text" name="email" size=40 value="<?
if(isset($email)) { echo $email; }
?>">
<br><br>
<b>Subject:</b>
<br>
<input type=text name=subject size=40 value="<?
if(isset($subject)) { echo $subject; }
?>">
<br><br>
<b>Message:</b>
<br>
<textarea name="message" rows="10" cols="40"><?
if(isset($message)) { echo $message; }
?></textarea>
<br><br>
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Submit2" value="Reset">
</form>
<br></center>

<?php

table_bottom();

html_footer();

close_db( $db );

?>

At 11:47 25/12/2002 -0800, Chris Wesley wrote:

On Wed, 25 Dec 2002, Ben Edwards wrote:

> I have a fairly simple mail form which gets email, subject and message and
> posts to itself.
> It then use mail() function to send a email.
> mail( $admin_email, $subject, $message, "From: $email" );
> Problem is the message gets truncated if there is a comma in the message
> after the comma.

I have forms that have identical functionality, but don't exhibit that
erroneous behavior.  I can't tell what you've done to the arguments to
mail() before using them, but the only thing I do is run them through
stripslashes() and trim().  i.e. -

$message = trim( stripslashes( $_POST['message'] ) );

If that's what you do too ... weird!  If not, give it a try and see what
happens.

        g.luck & cheers!
        ~Chris


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
****************************************************************
* Ben Edwards                              +44 (0)117 9400 636 *
* Critical Site Builder    http://www.criticaldistribution.com *
* online collaborative web authoring content management system *
* Get alt news/views films online   http://www.cultureshop.org *
* i-Contact Progressive Video      http://www.videonetwork.org *
* Smashing the Corporate image       http://www.subvertise.org *
* Bristol Indymedia               http://bristol.indymedia.org *
* Bristol's radical news             http://www.bristle.org.uk *
* PGP : F0CA 42B8 D56F 28AD 169B  49F3 3056 C6DB 8538 EEF8     *
****************************************************************
--- End Message ---
--- Begin Message ---

I have actually discovered the problem is in fact that the message gets truncated after a Carriage Return.

The even wearder thing is that
$msg = ereg_replace( "\n", "NL", $msg );

Douse put NL where the carriage return was but also seems to leave some kind on new line character.

So when I run $mgs through the function, do echo $msg, and look in the source of the HTML $msg is still on a number of different lines,

Ben
****************************************************************
* Ben Edwards +44 (0)117 9400 636 *
* Critical Site Builder http://www.criticaldistribution.com *
* online collaborative web authoring content management system *
* Get alt news/views films online http://www.cultureshop.org *
* i-Contact Progressive Video http://www.videonetwork.org *
* Smashing the Corporate image http://www.subvertise.org *
* Bristol Indymedia http://bristol.indymedia.org *
* Bristol's radical news http://www.bristle.org.uk *
* PGP : F0CA 42B8 D56F 28AD 169B 49F3 3056 C6DB 8538 EEF8 *
****************************************************************
--- End Message ---
--- Begin Message ---
> I have actually discovered the problem is in fact that the message gets
> truncated after a Carriage Return.
>
> The even wearder thing is that
>        $msg = ereg_replace( "\n", "NL", $msg );
>
> Douse put NL where the carriage return was but also seems to leave some
> kind on new line character.
>
> So when I run $mgs through the function, do echo $msg, and look in the
> source of the HTML $msg is still on a number of different lines,

I'm still not sure why the message would be truncated, but try replacing
\r\n instead of just \n. Windows uses \r\n, *nix uses \n and I think MAC
uses \r.

What are you using to view the message?

---John Holmes...

--- End Message ---
--- Begin Message --- Sorted it out with

$message = ereg_replace("(\r\n|\n|\r)", "\n", trim( stripslashes( $message) ) );

trim and stripslashes not strictly speaking nessesery. Not 100% sure what happened here but guess \r\n or \r was causing problems.

Ben

At 11:11 26/12/2002 -0500, 1LT John W. Holmes wrote:

> I have actually discovered the problem is in fact that the message gets
> truncated after a Carriage Return.
>
> The even wearder thing is that
>        $msg = ereg_replace( "\n", "NL", $msg );
>
> Douse put NL where the carriage return was but also seems to leave some
> kind on new line character.
>
> So when I run $mgs through the function, do echo $msg, and look in the
> source of the HTML $msg is still on a number of different lines,

I'm still not sure why the message would be truncated, but try replacing
\r\n instead of just \n. Windows uses \r\n, *nix uses \n and I think MAC
uses \r.

What are you using to view the message?

---John Holmes...


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
****************************************************************
* Ben Edwards                              +44 (0)117 9400 636 *
* Critical Site Builder    http://www.criticaldistribution.com *
* online collaborative web authoring content management system *
* Get alt news/views films online   http://www.cultureshop.org *
* i-Contact Progressive Video      http://www.videonetwork.org *
* Smashing the Corporate image       http://www.subvertise.org *
* Bristol Indymedia               http://bristol.indymedia.org *
* Bristol's radical news             http://www.bristle.org.uk *
* PGP : F0CA 42B8 D56F 28AD 169B  49F3 3056 C6DB 8538 EEF8     *
****************************************************************
--- End Message ---
--- Begin Message ---
what mailserver are you using and how is it called in php.ini?
and what else is in the message causing the problem.

Best Wishes & Happy New Year

Paul Roberts
[EMAIL PROTECTED]
++++++++++++++++++++++++

----- Original Message ----- 
From: "Ben Edwards" <[EMAIL PROTECTED]>
To: "1LT John W. Holmes" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, December 26, 2002 4:36 PM
Subject: Re: [PHP] Problem with comma in mail form


Sorted it out with

     $message = ereg_replace("(\r\n|\n|\r)", "\n", trim( stripslashes( 
$message) ) );

trim and stripslashes not strictly speaking nessesery.  Not 100% sure what 
happened here but guess \r\n or \r was causing problems.

Ben

At 11:11 26/12/2002 -0500, 1LT John W. Holmes wrote:

> > I have actually discovered the problem is in fact that the message gets
> > truncated after a Carriage Return.
> >
> > The even wearder thing is that
> >        $msg = ereg_replace( "\n", "NL", $msg );
> >
> > Douse put NL where the carriage return was but also seems to leave some
> > kind on new line character.
> >
> > So when I run $mgs through the function, do echo $msg, and look in the
> > source of the HTML $msg is still on a number of different lines,
>
>I'm still not sure why the message would be truncated, but try replacing
>\r\n instead of just \n. Windows uses \r\n, *nix uses \n and I think MAC
>uses \r.
>
>What are you using to view the message?
>
>---John Holmes...
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

****************************************************************
* Ben Edwards                              +44 (0)117 9400 636 *
* Critical Site Builder    http://www.criticaldistribution.com *
* online collaborative web authoring content management system *
* Get alt news/views films online   http://www.cultureshop.org *
* i-Contact Progressive Video      http://www.videonetwork.org *
* Smashing the Corporate image       http://www.subvertise.org *
* Bristol Indymedia               http://bristol.indymedia.org *
* Bristol's radical news             http://www.bristle.org.uk *
* PGP : F0CA 42B8 D56F 28AD 169B  49F3 3056 C6DB 8538 EEF8     *
****************************************************************




--------------------------------------------------------------------------------


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

--- End Message ---
--- Begin Message ---
Hi to all,
 
i'm trying to find a logger to watch the files in
/tmp/session_xxxxxxxxxxxxxxxxxxxxxxx
 
any help?

Francisco M. Vaucher


 
--- End Message ---
--- Begin Message ---
> i'm trying to find a logger to watch the files in
> /tmp/session_xxxxxxxxxxxxxxxxxxxxxxx

Watch them do what?

---John Holmes...
--- End Message ---
--- Begin Message ---
You have all the /tmp/session_xxxxxxxxxxx files that contain info about the
sessions variables... Well, I need a logger to watch them... nothing else


Francisco M. Vaucher
Departamento IT
Tyco / ADT Security Services
Buenos Aires - Argentina
mailto:[EMAIL PROTECTED]


-----Mensaje original-----
De: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]]
Enviado el: jueves, 26 de diciembre de 2002 12:18
Para: Francisco Vaucher; [EMAIL PROTECTED]
Asunto: Re: [PHP] PHP session logger


> i'm trying to find a logger to watch the files in
> /tmp/session_xxxxxxxxxxxxxxxxxxxxxxx

Watch them do what?

---John Holmes...
--- End Message ---
--- Begin Message ---
At 09:02 PM 12/23/02 -0800, Chris Rehm wrote:
John W. Holmes wrote:
http://www.google.com/search?sourceid=navclient&ie=UTF-8&oe=UTF-8&q=php+
mysql+tutorial
---John W. Holmes...
The Internet is a wealth of resources, but some of them aren't as good as others. If people here have had great success from some sites, I'd like to be able to pass on those recommendations.
Both of the tutorials that got me going with PHP & MySQL appear on the first page of the Google search John sent you. Those are Devshed and Webmonkey, but that was long ago, there may be better choices now. One thing to look for is a discussion of the "Register Globals" change and how it affects PHP programming. Older tutorials may have a problem with how they access form varibles.


> Did I make a valid suggestion?

Yes. PHP + MySQL are a very good way to solve the problem you posed. Certainly my first choice. I wouldn't send an email on every entry though. It is a waste. The entries are stored in the database, and you can look through them any time you want. Just build a password protected web page.

Picking a winner might be as easy as:

SELECT *
FROM Entries
ORDER BY RAND()
LIMIT 1

This picks one record from the Entries table at random. You may want to send your self an email with the results, as this is truly random.

May as well let the computers do the work...

Rick

--- End Message ---
--- Begin Message --- I have Apache running on Windows XP, however I am having problems installing PHP.  My PHP directory is C:\Active_Php and the documents say that I should add the following lines to httpd.conf:

   LoadModule php4_module c:/Active_PhP/sapi/php4apache.dll
   AddModule mod_php4.c
   AddType application/x-httpd-php .php

However, I get an error when Apache tries to load the dll.  Has any successfully installed PHP and Apache on Windows XP?  If so, what changes are made to the conf file?

Todd

--
Ariste Software, Petaluma, CA 94952
--- End Message ---
--- Begin Message ---
I found this function in the list archives while searching on how to find
the number of a weekday (say, Tuesdays) between 2 dates..

  function weekdaysBetween ($timestamp1, $timestamp2, $weekday)
  {
    return floor(intval(($timestamp2 - $timestamp1) / 86400) / 7)
      + ((date('w', $timestamp1) <= $weekday) ? 1 : 0);
  }

Sometimes it works, but I've come across a date while testing this that
doesn't work, which makes me think there is some bug in the function that
I'm not seeing.

The 2 dates I am trying are:

01-04-2002
and
02-05-2002

There should be 5 Tuesdays:

01-08-2002
01-15-2002
01-22-2002
01-29-2002
02-05-2002

Yet the script only returns 4, leaving off 02-05-2002.

        $nowdate = mktime(0, 0, 0, $STARTMONTH, $STARTDAY, $STARTYEAR);
        $futuredate = mktime(0, 0, 0, $ENDMONTH, $ENDDAY, $ENDYEAR);

That's how I'm generating the time stamps to pass to the function, and I've
confirmed the dates I've entered are correct..

        echo weekdaysBetween($nowdate, $futuredate, 2);

Returns 4 ..


can anyone assist?

Thanks,
Chad

--- End Message ---
--- Begin Message ---
Say the you are going to create a simple forum and you want to have a number
of classes:

Class Sql - handles the DB interface
Class User - handles users
Class Messages - handles messages

When you are writing the code, you first creates a new sql object in order
to read or write data from or to the database.

Secondly you create a user object in order to handle users, for an example,
to authenticate the user which is going to write a new message in your
forum.

The user object have a method which reads user information from the
database.
 Since you alread have created a sql object, this method should use the sql
object in order to fecth data from the database.

I nice way to do this, would be to send the sql object as an reference to
the user object constructor and store the object reference to the sql object
in the user object.

This is not working very well in PHP yet because PHP cannot treat objects as
references. When you send the sql object to the user object constructor
method, it will be a copy, not a reference!

How do I get around this? There must be a way to handle this and create nice
OOO PHP-code? I don't like using global variables as object handles.

Best regards
Erik


--- End Message ---
--- Begin Message ---
When I upload php and other files and set the permissions on my ISP's (CPanel) file 
manager screen, sometimes the new permissions are set, other times they reset back to 
644 without my knowing (so a visitor is unable to access the website, as the php 
scripts don't execute), and others the screen just refuses to save the new settings.
Could anybody tell me why is this?
Thanks in advance and merry Xmas and new year to everyone.

Alberto Brea
--- End Message ---
--- Begin Message ---
Hi.
I have myself written a rather clumsy mass mailer in
php which queues mail via the sendmail-command.
I have found this to be rather slow and ineffective.

You are talking about queueing mail directly to the
mailqueue, and I wonder, how is that done with php?

About making mails not rejected by spam-filters I have
experienced that there should be something in the to
field, many servers are rejecting mails that it empty in
that header. Also, if you are sending out html letters,
try and attach a plain text version as well, or emails
will be rejected as well. I have a rather neat script
for the latter if anybody is interested.

But please get back with some tips how to queue mail
straight to the mail queue for fast delievery.

      /peter a



At 2002-12-22 20:52, Manuel Lemos wrote:
>Hello,
>
>On 12/22/2002 02:52 PM, Jonathan Chum wrote:
>>>>I was considering of writing the mass mailing application in PHP instead
>>>>though.
>>>>
>>>>If anyone has eperience writing such applications with this amount of
>>>>emails, I'd like to know what you've done.
>>>
>>>If you do not need to send personalized messages (messages that differ
>>>for each recipient), just put all recipients in a BCc: header and send a
>>>single message to the local mailer queue (not via SMTP).
>>>
>>>If you do not care for the users that bounce messages, just make the
>>>return path be black hole email address. OTOH, if you care about bounces
>>>(you should if you mailing list is large or is not clean), consider
>>>using ezmlm, which is a mailing list manager than among other things
>>>takes care of bounce messages thanks to qmail VERP. I was told that is
>>>the one that eGroups hacked to use in the now known YahooGroups site.
>>>
>>>Once I built a small Web interface for ezmlm. It was meant just to
>>>create and edit several mailing lists meant to be used as newsletter for
>>>a portal with many sites. Is simple but it already comes with a SOAP
>>>interface to manage the mailing list subscribers remotely.
>>>
>>>http://www.phpclasses.org/ezmlmmanager
>>
>>I heard that using BCC, it can only handle a certain amount of receipients.
>
>No, if you look in the archives of this list you will notice that this was explained 
>several times. What happens is that some ISP of shared hosting limit the number of 
>recipients of the messages you can send because they do not want you to do mass 
>mailing at all. You should check your ISP Acceptable Use Policy before trying to do 
>any mass mailing. Trying to queue individual messages to each recipient may fool the 
>server limitations but you may still be against the AUP.
>
>
>>Also, messages that are BCC'd are also tend to be blocked by mail servers
>>and clients.
>
>Any server owners that do that are dumb because while they think they are blocking 
>spammers, what they get is they are simply blocking opt-in mailing lists for instance 
>like this one you are getting. At the same time you still keep getting most of the 
>spam because real spammers use dedicated machines make the recipients addresses show 
>in the messages as needed to defeat that silly anti-spam criteria. So, what they get 
>is to block solicited e-mail.
>
>Anyway, the problem of personalizing messages is that makes your mailings take much 
>longer to generate and queue because you need to create separate message for each 
>recipient.
>
>
>>>No, queuing via SMTP is the slowest way to send messages. Your script
>>>should not bother to deliver the messages to the recipients SMTP
>>>servers.  Delivery can take hours or days to finish due to network
>>>congestions and hard to conect SMTP servers. Just queue the messages in
>>>the local mailer and let it take care the actual delivery.
>>>
>>>I would recommend a qmail based system anytime, with or without ezmlm on
>>>top. In a production system that I manage, it just takes 3 seconds to
>>>queue a alert message to be sent to 50,000 via a local qmail server.
>>>
>>>You can also use sendmail almost as fast using the queue only mode. Some
>>>people think that sendmail is slow and many forks processes because they
>>>are not aware of how to configure it to queue the messages the fastest
>>>way that is possible.
>>>
>>>You may want to look into this class that has a sub-classes for
>>>delivering with sendmail program directly instead of using the mail().
>>>It lets you configure the sendmail delivery mode. There is also a
>>>sub-class for delivering with qmail.
>>>
>>>http://www.phpclasses.org/mimemessage
>>
>>I was looking at a variety of methods, and seems that everyone thinks for
>>best performance, you would inject the email in to Qmail or Sendmail's queue
>
>That is because it is really the best.
>
>
>>and run it every hour.
>
>With qmail you do not have to run the queue like sendmail. You just inject the 
>messages and it will deliver them when possible.
>
>
>
>
>>As for SMTP, I meant sending the email through your outbound SMTP server
>>which in our case, a server we build specifically for handling that sort of
>
>Of course all e-mail is delivered to each recipient via SMTP, but that you can relay 
>to your local mailer.
>
>
>>volume. I was reading through Perl's BulkMail module,
>>http://mojo.skazat.com/support/documentation/Bulkmail.pm.html
>>They are using SMTP to delivery their emails. Using envelopes and sorting
>>the emails by their host meant even faster delivery. Though the envelope
>
>That would be a good idea if you have messages to be sent to many recipients of the 
>same domain but in reality it is more problematic. Some servers indeed reject 
>messages to be sent many recipients at once. Although that is not illegal, it is a 
>pattern of spamming. Another problem, is that you will have an hard time 
>distinguishing which addresses of a same domain are bouncing and which are not 
>bouncing.
>
>
>>method seems to be like BCC as you can't personalized each email To:
>>recepient.
>
>If you want delivery efficiency, forget personalization.
>
>
>>Your Mime Message class seems to be better for sending mass mailings as it
>>queues up the email into Sendmail without opening/closing the connection for
>
>Actually the class provides different delivery methods that maybe appropriate in 
>different circunstances: mail(), sendmail, qmail and SMTP.
>
>SMTP is the slowest for queuing but it is the fastest for direct delivery. My SMTP 
>class supports direct deliveries which is great to deliver urgent messages as they 
>are not relayed to the local mailer. It delivers to the recipient SMTP server and you 
>will know if the message was accepted right away. I use this to deliver password 
>reminder and other messages that users of my sites are anxious to receive because the 
>local mailer queue may be loaded at the moment with some long delivery.
>
>
>>each recepient. phpmailer.sourceforget.net has that problem of opening and
>>closing a connection, yet they claim to receive good results of up to 40,000
>>emails per hour. Another software using that class was able to send 500,000
>>emails in 10 hours.
>
>You should not consider any delivery statistics because all depends on factors that 
>have nothing to do with the software you use, like the outbound bandwidth, remote 
>server reachability, anti-spam reception delays, temporary messages refusals (mailbox 
>full, blocked account, etc..).
>
>
>>If injecting the emails directly into Qmail (Sounds to me that Qmail is far
>>better for email deliver than to be using Sendmail) vs using SMTP, then
>
>DJB software rules! BTW, consider using DJBDNS cache to reduce DNS server lookup time.
>
>
>>that'll be the approach. The only reason I'd would be using SMTP is to keep
>>the code and data (on MySQL) stored on one machine and when it's time to
>>blast out an email, it'll establish a connection to a SMTP server assigned
>>to the list to deliver the email.
>
>In that case, you may consider QMQP relay which is a protocol that lets you rely 
>entire mail queues from a server to another. This is recommended when you have many 
>busy mailing lists served from one machine and you can use more servers do the actual 
>delivery. I think only qmail and ezmlm support QMQP.
>
>
>>Though if the code was written to sit on each server that scans for pending
>>tasks, it'll pick up it's job from a master database server and then
>>directly injecting Qmail locally.
>
>That is what qmail does.
>
>
>>The software app I'm writing is expected to have many users with small to
>>very large lists. I'm trying to spec this out so that it scales well and
>>with the fastest delivery. From what I'm hearing from you and from the first
>>guy's reply to this thread, inject the email into Qmail is the quickest way.
>
>Yes, qmail was thought for that. Yahoogroups use it and I have also used when I 
>worked in a large portal with many subscriber newsletters as I mentioned. We had some 
>very large like for MTV Brasil that had almost 400,000 subscribers.
>
>The greatest problem that made me learn some hard lessons is that it is very 
>problematic if you start with subscribers list that are not clean up of no longer 
>valid users. Once you start delivering messages to those addresses, you get a flood 
>of bounces that pratically stop your server queue.
>
>The MTV newsletter was weekly, but that affected the newsletters of other sites that 
>were stopped during the MTV newsletter bounces. Since ezmlm does not unsubscribe 
>bouncing addresses right away, the solution was to remove bouncing subscribers using 
>an external validation procedure. I used this other class for the cleanup. After that 
>it was a breeze. We had peaks of 10,000 messages sent per minute.
>
>http://www.phpclasses.org/emailvalidation
>
>
>-- 
>
>Regards,
>Manuel Lemos
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
http://httpd.apache.org/docs/misc/FAQ.html#set-servername

Mantas Kriauciunas wrote:
Hey!
I'm using FreeBSD 4.5 as my server and I have loaded Apache 1.3.2 and
PHP 4.x . hare goes the question, sorry it isn't about php but still
maybe you can help me. When I type Http://www.example.com/~user the page
says that it doesn't exist.. But when I type in
Http://www.example.com/~user/ then it works. Well when I had PHPTriad
loaded on my windows I didn't have any problems. Why now it isn't
working without / ??
Thanks!


--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

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

Assume we've got a binary data file 'profile' which stores the data of a C
struct. The struct is as follows:

struct s_profile {
    char id[32];
    char vala:3;
    char valb:1;
    char valc:7;
}

Now I would like to read 'profile' using PHP's unpack(). So like this:
$f = fopen('profile', 'r');
$binaryData = fread($f, filesize('profile'));
$data = unpack('a32id/[...etc]', $binaryData);

My problem is: which formats should I use for char vala:3, char valb:1 &
char valc:7 ? In other words: what should be on the spot of [...etc] ?
cvala/cvalb/cvalc doesn't work.

Thanks,
Tim Molendijk


--- End Message ---
--- Begin Message ---
Hi Every one,

Do you know how to prepare and display process flow diagrams dynamically
based on some data from database. I have information about some processes in
the database that tells different process dependencies. I need to display
that information as a process flow diagram.

I am using PHP 4.xx and IIS on Win NT platform. Please help me if you know
how to do.


Thank You,
Sridhar Moparthy

--- End Message ---
--- Begin Message ---
to my knowledge there is nothing in php that does that

good luck

On Thu, 2002-12-26 at 11:17, Sridhar Moparthy wrote:
> Hi Every one,
> 
> Do you know how to prepare and display process flow diagrams dynamically
> based on some data from database. I have information about some processes in
> the database that tells different process dependencies. I need to display
> that information as a process flow diagram.
> 
> I am using PHP 4.xx and IIS on Win NT platform. Please help me if you know
> how to do.
> 
> 
> Thank You,
> Sridhar Moparthy

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

On 12/26/2002 05:18 PM, Sridhar Moparthy wrote:
> Do you know how to prepare and display process flow diagrams dynamically
> based on some data from database. I have information about some processes in
> the database that tells different process dependencies. I need to display
> that information as a process flow diagram.

You may want to look at Metastorage that draws graphs of classes of
objects that are stored in a database:

http://www.meta-language.net/news-2002-12-09-metastorage.html

http://www.meta-language.net/metastorage.html


--

Regards,
Manuel Lemos

--- End Message ---
--- Begin Message ---
Title: Message
I have a file named header.php stored in the includes folder:
Inside includes is anohter folder called editable.
When I open my page for the first time (before it is cached) or after I edit my header file I get these errors:
Warning: Failed opening 'editable/meta.php' for inclusion (include_path='') in /home/groups/v/vw/vwportal/htdocs/includes/header.php on line 52

Warning: Failed opening 'javascript.php' for inclusion (include_path='') in /home/groups/v/vw/vwportal/htdocs/includes/header.php on line 53

Warning: Failed opening 'editable/my_header.php' for inclusion (include_path='') in /home/groups/v/vw/vwportal/htdocs/includes/header.php on line 56
 
Is there any other command I can run iside my header.php file instead of include that will print the contents of the includes that the header has?
 
Mike Bowers
PlanetModz Gaming Network Webmaster
ViperWeb Hosting Server Manager
All outgoing messages scanned for viruses
using Norton AV 2002
--- End Message ---
--- Begin Message ---
Isnt this supposed to be a friendly place where people who are having
problem with PHP can ask questions without people like u throwing
insults?
 
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, December 26, 2002 12:47 PM
To: Mike Bowers
Subject: Re: [PHP] Include Problems



Learn to quote GAMER

----- Original Message ----- 
From: Mike Bowers <mailto:[EMAIL PROTECTED]>  
To: [EMAIL PROTECTED] 
Sent: Thursday, December 26, 2002 8:42 PM
Subject: [PHP] Include Problems

I have a file named header.php stored in the includes folder:
Inside includes is anohter folder called editable.
When I open my page for the first time (before it is cached) or after I
edit my header file I get these errors:
Warning: Failed opening 'editable/meta.php' for inclusion
(include_path='') in
/home/groups/v/vw/vwportal/htdocs/includes/header.php on line 52

Warning: Failed opening 'javascript.php' for inclusion (include_path='')
in /home/groups/v/vw/vwportal/htdocs/includes/header.php on line 53


Warning: Failed opening 'editable/my_header.php' for inclusion
(include_path='') in
/home/groups/v/vw/vwportal/htdocs/includes/header.php on line 56
 
Is there any other command I can run iside my header.php file instead of
include that will print the contents of the includes that the header
has?
 
Mike Bowers
PlanetModz Gaming Network Webmaster
[EMAIL PROTECTED]
ViperWeb Hosting Server Manager
[EMAIL PROTECTED]
[EMAIL PROTECTED]
All outgoing messages scanned for viruses
using Norton AV 2002

--- End Message ---
--- Begin Message ---
Post the include statements from your header.php file.

Mike Bowers wrote:
Isnt this supposed to be a friendly place where people who are having
problem with PHP can ask questions without people like u throwing
insults?
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 26, 2002 12:47 PM
To: Mike Bowers
Subject: Re: [PHP] Include Problems



Learn to quote GAMER

----- Original Message ----- From: Mike Bowers <mailto:[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Sent: Thursday, December 26, 2002 8:42 PM
Subject: [PHP] Include Problems

I have a file named header.php stored in the includes folder:
Inside includes is anohter folder called editable.
When I open my page for the first time (before it is cached) or after I
edit my header file I get these errors:
Warning: Failed opening 'editable/meta.php' for inclusion
(include_path='') in
/home/groups/v/vw/vwportal/htdocs/includes/header.php on line 52

Warning: Failed opening 'javascript.php' for inclusion (include_path='')
in /home/groups/v/vw/vwportal/htdocs/includes/header.php on line 53


Warning: Failed opening 'editable/my_header.php' for inclusion
(include_path='') in
/home/groups/v/vw/vwportal/htdocs/includes/header.php on line 56
Is there any other command I can run iside my header.php file instead of
include that will print the contents of the includes that the header
has?
Mike Bowers
PlanetModz Gaming Network Webmaster
[EMAIL PROTECTED]
ViperWeb Hosting Server Manager
[EMAIL PROTECTED]
[EMAIL PROTECTED]
All outgoing messages scanned for viruses
using Norton AV 2002



--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message --- A couple of items which will help you get a better / friendlier response here.

Don't send mail to the list in HTML format, and don't request a return reciept.

HTH

Mike Bowers wrote:
Isnt this supposed to be a friendly place where people who are having
problem with PHP can ask questions without people like u throwing
insults?
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 26, 2002 12:47 PM
To: Mike Bowers
Subject: Re: [PHP] Include Problems



Learn to quote GAMER

----- Original Message ----- From: Mike Bowers <mailto:[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Sent: Thursday, December 26, 2002 8:42 PM
Subject: [PHP] Include Problems

I have a file named header.php stored in the includes folder:
Inside includes is anohter folder called editable.
When I open my page for the first time (before it is cached) or after I
edit my header file I get these errors:
Warning: Failed opening 'editable/meta.php' for inclusion
(include_path='') in
/home/groups/v/vw/vwportal/htdocs/includes/header.php on line 52

Warning: Failed opening 'javascript.php' for inclusion (include_path='')
in /home/groups/v/vw/vwportal/htdocs/includes/header.php on line 53


Warning: Failed opening 'editable/my_header.php' for inclusion
(include_path='') in
/home/groups/v/vw/vwportal/htdocs/includes/header.php on line 56
Is there any other command I can run iside my header.php file instead of
include that will print the contents of the includes that the header
has?
Mike Bowers
PlanetModz Gaming Network Webmaster
[EMAIL PROTECTED]
ViperWeb Hosting Server Manager
[EMAIL PROTECTED]
[EMAIL PROTECTED]
All outgoing messages scanned for viruses
using Norton AV 2002



--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message ---
Mike Bowers wrote:

I have a file named header.php stored in the includes folder:

Inside includes is anohter folder called editable.

When I open my page for the first time (before it is cached) or after I edit my header file I get these errors:

*Warning*: Failed opening 'editable/meta.php' for inclusion (include_path='') in */home/groups/v/vw/vwportal/htdocs/includes/header.php* on line *52*

Perhaps it is a permissions problem, after editing it (as whatever user you use to edit files), is the file readable by the user the webserver runs as?

HTH
Chris
PS I'm sure it would be appreciated if you would be kind enough to post in plain text (not html), someone has to pay for archiving it.

--- End Message ---
--- Begin Message ---
It's not permissions. The files to be read as well as folders are all
CHMOD 777 as I thought it was this originally. Thanks for your
suggestion though.


-----Original Message-----
From: Chris Hewitt [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, December 26, 2002 1:11 PM
To: Mike Bowers
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Include Problems


Mike Bowers wrote:

> I have a file named header.php stored in the includes folder:
>
> Inside includes is anohter folder called editable.
>
> When I open my page for the first time (before it is cached) or after
> I edit my header file I get these errors:
>
> *Warning*: Failed opening 'editable/meta.php' for inclusion
> (include_path='') in 
> */home/groups/v/vw/vwportal/htdocs/includes/header.php* on line *52*
>
Perhaps it is a permissions problem, after editing it (as whatever user 
you use to edit files), is the file readable by the user the webserver 
runs as?

HTH
Chris
PS I'm sure it would be appreciated if you would be kind enough to post 
in plain text (not html), someone has to pay for archiving it.


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

--- End Message ---
--- Begin Message --- You can try setting your include path in a .htaccess file in your web root, like this....

php_value include_path ".:/path/to/include/directory"

Mike Bowers wrote:
The includes are as follows:
Include("editable/meta.php");
Include("javascript.php");
Include("editable/my_header.php");



-----Original Message-----
From: John Nichel [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 26, 2002 12:58 PM
To: Mike Bowers
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Include Problems


Post the include statements from your header.php file.

Mike Bowers wrote:

Isnt this supposed to be a friendly place where people who are having problem with PHP can ask questions without people like u throwing insults?


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 26, 2002 12:47 PM
To: Mike Bowers
Subject: Re: [PHP] Include Problems



Learn to quote GAMER

----- Original Message -----
From: Mike Bowers <mailto:[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Sent: Thursday, December 26, 2002 8:42 PM
Subject: [PHP] Include Problems

I have a file named header.php stored in the includes folder: Inside includes is anohter folder called editable. When I open my page for the first time (before it is cached) or after I edit my header file I get these errors:
Warning: Failed opening 'editable/meta.php' for inclusion
(include_path='') in /home/groups/v/vw/vwportal/htdocs/includes/header.php on line 52

Warning: Failed opening 'javascript.php' for inclusion (include_path='') in /home/groups/v/vw/vwportal/htdocs/includes/header.php on line 53


Warning: Failed opening 'editable/my_header.php' for inclusion
(include_path='') in /home/groups/v/vw/vwportal/htdocs/includes/header.php on line 56

Is there any other command I can run iside my header.php file instead of include that will print the contents of the includes that the header has?

Mike Bowers
PlanetModz Gaming Network Webmaster
[EMAIL PROTECTED]
ViperWeb Hosting Server Manager [EMAIL PROTECTED]
[EMAIL PROTECTED]
All outgoing messages scanned for viruses
using Norton AV 2002





--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message ---
On Thu, 26 Dec 2002, Mike Bowers wrote:

> I have a file named header.php stored in the includes folder:
> Inside includes is anohter folder called editable.
> When I open my page for the first time (before it is cached) or after I
> edit my header file I get these errors:
> Warning: Failed opening 'editable/meta.php' for inclusion
> (include_path='') in

Your include_path in php.ini is null, as indicated by the line above.

What you're assuming will happen is that include will automatically look
in the "includes" dir for files, so you have to set this:
include_path="./includes"

I set mine:
include_path = ".:./:../:./include:../include"

        g.luck,
        ~Chris

--- End Message ---
--- Begin Message ---
This has worked.
Thanks for your inout and help everybody.


-----Original Message-----
From: John Nichel [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, December 26, 2002 1:13 PM
To: Mike Bowers; [EMAIL PROTECTED]
Subject: Re: [PHP] Include Problems


You can try setting your include path in a .htaccess file in your web 
root, like this....

php_value include_path ".:/path/to/include/directory"

Mike Bowers wrote:
> The includes are as follows:
> Include("editable/meta.php");
> Include("javascript.php");
> Include("editable/my_header.php");
> 
> 
> 
> -----Original Message-----
> From: John Nichel [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, December 26, 2002 12:58 PM
> To: Mike Bowers
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Include Problems
> 
> 
> Post the include statements from your header.php file.
> 
> Mike Bowers wrote:
> 
>>Isnt this supposed to be a friendly place where people who are having
>>problem with PHP can ask questions without people like u throwing 
>>insults?
>> 
>> 
>>-----Original Message-----
>>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
>>Sent: Thursday, December 26, 2002 12:47 PM
>>To: Mike Bowers
>>Subject: Re: [PHP] Include Problems
>>
>>
>>
>>Learn to quote GAMER
>>
>>----- Original Message -----
>>From: Mike Bowers <mailto:[EMAIL PROTECTED]>
>>To: [EMAIL PROTECTED] 
>>Sent: Thursday, December 26, 2002 8:42 PM
>>Subject: [PHP] Include Problems
>>
>>I have a file named header.php stored in the includes folder: Inside
>>includes is anohter folder called editable. When I open my page for 
>>the first time (before it is cached) or after I edit my header file I 
>>get these errors:
>>Warning: Failed opening 'editable/meta.php' for inclusion
>>(include_path='') in 
>>/home/groups/v/vw/vwportal/htdocs/includes/header.php on line 52
>>
>>Warning: Failed opening 'javascript.php' for inclusion
>>(include_path='') in 
>>/home/groups/v/vw/vwportal/htdocs/includes/header.php on line 53
>>
>>
>>Warning: Failed opening 'editable/my_header.php' for inclusion
>>(include_path='') in
>>/home/groups/v/vw/vwportal/htdocs/includes/header.php on line 56
>> 
>>Is there any other command I can run iside my header.php file instead
>>of include that will print the contents of the includes that the 
>>header has?
>> 
>>Mike Bowers
>>PlanetModz Gaming Network Webmaster
>>[EMAIL PROTECTED]
>>ViperWeb Hosting Server Manager [EMAIL PROTECTED] 
>>[EMAIL PROTECTED] All outgoing messages scanned for viruses
>>using Norton AV 2002
>>
>>
> 
> 
> 


-- 
By-Tor.com
It's all about the Rush
http://www.by-tor.com


--- End Message ---
--- Begin Message ---
On Thursday 26 December 2002 12:06 pm, Mike Bowers wrote:
> It's not permissions. The files to be read as well as folders are all
> CHMOD 777 as I thought it was this originally. 

don't use 777.  that makes the scripts writeable for everyone. any
other user who can run scripts on that server can delete those
scripts or replace them with something malicious.  if any scripts
on that server can be tricked into executing code as the webserver
user (nobody, apache, www, whatever) then those files of yours
can also be modified.

you're probably just testing on a private server, in which case 
777 is convenient (still a bad habit, but convenient).  but remember to 
fix the permissions when you upload to a real server.  better yet,
switch to saner permissions even if only testing on a private server.

> > *Warning*: Failed opening 'editable/meta.php' for inclusion
> > (include_path='') in
> > */home/groups/v/vw/vwportal/htdocs/includes/header.php* on line *52*

looks like include_path in your php.ini is empty.  if you have:

<?php
   phpinfo();
?>

what does the include_path section say?  normally, you should have
entries in there corresponding to directories where include files can
be found.  e.g., a good minimal include_path might be:

include_path=".:..:/var/lib/www/standard_php_includes"

or something similar (i made up the last part, replace with wherever you
put standard includes that you use).  i like having the current directory
and .. in there for obvious reasons.

tiger

-- 
Gerald Timothy Quimpo  tiger*quimpo*org gquimpo*sni-inc.com tiger*sni*ph
Public Key: "gpg --keyserver pgp.mit.edu --recv-keys 672F4C78"
                   Veritas liberabit vos.
                   Doveryai no proveryai.
--- End Message ---
--- Begin Message ---
hi
i found a 'formmail' scripts from somewhere..
the problem is....the email which i get from this scripts has 'unprivilaged
user' in the 'from' field.

mail($form['recipient'], $form['sublect'],$mailbody, "From:Web User");

if i use this...in the from field..it says '[EMAIL PROTECTED]'

I just need the from field to show 'Web User' (instead of 'unprivilaged
user')
Can i do this!!
plz help

thanks and regards
anil

--- End Message ---
--- Begin Message ---
hi
i found a 'formmail' scripts from somewhere..
the problem is....the email which i get from this scripts has 'unprivilaged
user' in the 'from' field.

mail($form['recipient'], $form['sublect'],$mailbody, "From:Web User");

if i use this...in the from field..it says '[EMAIL PROTECTED]'

I just need the from field to show 'Web User' (instead of 'unprivilaged
user')
Can i do this!!
plz help

thanks and regards
anil

--- End Message ---
--- Begin Message ---
try this

mail($form['recipient'], $form['sublect'],$mailbody, "From:Web User 
<[EMAIL PROTECTED]'>");

Best Wishes & Happy New Year

Paul Roberts
[EMAIL PROTECTED]
++++++++++++++++++++++++
----- Original Message ----- 
From: "Anil Garg" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 26, 2002 7:06 PM
Subject: [PHP] e-mail


hi
i found a 'formmail' scripts from somewhere..
the problem is....the email which i get from this scripts has 'unprivilaged
user' in the 'from' field.

mail($form['recipient'], $form['sublect'],$mailbody, "From:Web User");

if i use this...in the from field..it says '[EMAIL PROTECTED]'

I just need the from field to show 'Web User' (instead of 'unprivilaged
user')
Can i do this!!
plz help

thanks and regards
anil


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




--- End Message ---
--- Begin Message ---
Maybe you need to add the -f to your sendmail command?

James

-----Original Message-----
From: Anil Garg [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 26, 2002 2:06 PM
To: [EMAIL PROTECTED]
Subject: [PHP] e-mail


hi
i found a 'formmail' scripts from somewhere..
the problem is....the email which i get from this scripts has 'unprivilaged
user' in the 'from' field.

mail($form['recipient'], $form['sublect'],$mailbody, "From:Web User");

if i use this...in the from field..it says '[EMAIL PROTECTED]'

I just need the from field to show 'Web User' (instead of 'unprivilaged
user')
Can i do this!!
plz help

thanks and regards
anil


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

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

I'm making the administration part of a site which handles categories,
sub categories and products. Inside the "Categories" part, there's a
"List categories" button which gives a list of the categories and sub
categories when pressed. Along with each category, there's a "Delete"
button that, when pressed, it's supposed to delete that category from
the DB. The problem here is that the lists is made dynamically using a
FOR loop and is being placed inside a FORM so the action is handled
through an ACTION="" tag.

Now, the ACTION tag points to a php file which deletes the desired row
in the DB. The question is how to tell that php file (through GET or
POST) which row to delete... My first shot was to name each "Delete" or
submit button inside form like "delcategory?catid=0001" but then the
POST wasn't reading that...

Any thoughts? Thanks in advance,

Cesar L. Aracena
[EMAIL PROTECTED]
[EMAIL PROTECTED]
(0299) 156-356688
Neuquén (8300) Capital
Argentina



--- End Message ---
--- Begin Message ---
> I'm making the administration part of a site which handles categories,
> sub categories and products. Inside the "Categories" part, there's a
> "List categories" button which gives a list of the categories and sub
> categories when pressed. Along with each category, there's a "Delete"
> button that, when pressed, it's supposed to delete that category from
> the DB. The problem here is that the lists is made dynamically using a
> FOR loop and is being placed inside a FORM so the action is handled
> through an ACTION="" tag.
> 
> Now, the ACTION tag points to a php file which deletes the desired row
> in the DB. The question is how to tell that php file (through GET or
> POST) which row to delete... My first shot was to name each "Delete"
or
> submit button inside form like "delcategory?catid=0001" but then the
> POST wasn't reading that...
> 
> Any thoughts? Thanks in advance,

You could use a bunch of forms, if you want to use a button. Since
you're using a while() loop, it wouldn't be a big deal...

While(fetching_from_db)
{
  <form>
  <hidden cat_id>
  Other data
  <submit button>
  </form>
}

Then the delete button on each row is for it's own form with a hidden
cat_id element that you can use to tell which row to delete.

Even better would be to use checkboxes, so you can delete multiple rows
at one. Name them <input type="checkbox" name="delete[]"
value="<?=$cat_id?>">

And when it's submitted all of the checked boxes will be in
$_POST['delete'], so you can do this:

$delete_ids = implode(",",$_POST['delete']);
$query = "DELETE FROM table WHERE ID IN ($delete_ids)";

Add in your own validation, of course...

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/


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

Is there anyway to do a nested array, I have looked at the various array
functions and can't figure this out (if possible).

I want to be able to put each field of  a row into an array, and then put
that entire row and into another array.

so when I display it, I would have:

row1 - col1  col2  col3 col4 col5
row2 - col1  col2  col3 col4 col5
row3 - col1  col2  col3 col4 col5
row4 - col1  col2  col3 col4 col5
row5 - col1  col2  col3 col4 col5

etc. (depending on how many rows there are).

TIA


--- End Message ---

Reply via email to