php-general Digest 23 Dec 2002 03:28:02 -0000 Issue 1779

Topics (messages 129115 through 129135):

Re: Email problems.
        129115 by: Rick Emery
        129121 by: Manuel Lemos

Re: Mass Mailing
        129116 by: Jonathan Chum
        129119 by: Manuel Lemos

Re: Forms and PHP variables
        129117 by: Philip Olson

Re: session life
        129118 by: John W. Holmes

dropping the resource fork
        129120 by: James Brennan
        129127 by: David Rice

problems with uploading files
        129122 by: Oliver Witt
        129123 by: rw.xend.net
        129124 by: rw.xend.net

Which one to use..
        129125 by: Peter Houchin
        129130 by: Justin French

Re: php/dreamweaver mx/mysql server question...
        129126 by: Peter Houchin

Tutorials on OOP
        129128 by: Davy Obdam
        129129 by: Justin French
        129131 by: Davy Obdam
        129133 by: Wee Keat
        129134 by: Philip Olson
        129135 by: Stephen

register globals off ...problems
        129132 by: Mack

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 ---
This is not realy a PHP question; rather, it is an OutLook question.
Regardless...when you opened the OutLook window to create your mail, did you go to the
Menu->Format and select "Rich Text (HTML)""
----- Original Message -----
From: "Steve Jackson" <[EMAIL PROTECTED]>
To: "Php-General" <[EMAIL PROTECTED]>
Sent: Sunday, December 22, 2002 7:29 AM
Subject: [PHP] Email problems.


> I have generated a page on our server using PHP (from within a CMS system)
> which I renamed the output .html to use in an html email.
> My problem is when I cut and paste the HTML into the email (Outlook) it
> either:
> displays the code,
> displays the html email and then when it's sent, sends it as an attachment
> or sends it as a bunch of html links and  badly formatted text.
>
> I assumed (badly) that Outlook would simply send HTML emails if you
> formatted the program to send html emails but this seems almost impossible.
>
> Anyone have any suggestions?
>
> This is the page I want to send:
> http://www.violasystems.com/e-news/template.html
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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

On 12/22/2002 11:29 AM, Steve Jackson wrote:
I have generated a page on our server using PHP (from within a CMS system)
which I renamed the output .html to use in an html email.
My problem is when I cut and paste the HTML into the email (Outlook) it
either:
displays the code,
displays the html email and then when it's sent, sends it as an attachment
or sends it as a bunch of html links and  badly formatted text.

I assumed (badly) that Outlook would simply send HTML emails if you
formatted the program to send html emails but this seems almost impossible.

Anyone have any suggestions?

This is the page I want to send:
http://www.violasystems.com/e-news/template.html
You may want to try this class for composing messages that lets you add parts from files. Just specify the URL as filename:

http://www.phpclasses.org/mimemessage

--

Regards,
Manuel Lemos

--- End Message ---
--- Begin Message ---
Thanks Manuel,

"Manuel Lemos" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
> On 12/21/2002 08:10 PM, Jonathan Chum wrote:
> > An upcoming project I'm working and spec'ing out is a mass mailing
> > application. Initially, I was looking at Mailman which was written in
Python
> > since it looks like it handles delivering emails efficiently without
killing
> > the server. We have 1 client able to send 110,000 emails at 6.5K avg per
> > week on PIII 800 with 128 MB RAM using Mailman. The inteface however is
very
> > bad and we'd like to develop other features like text ads, tracking,
> > templates, etc. This would require writing a wrapper around Mailman in
PHP.
> > 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.
Also, messages that are BCC'd are also tend to be blocked by mail servers
and clients.

> > I'm thinking of coding the front end in PHP that will put the email into
a
> > queue table that will force a command line PHP script listening on a
> > particular port to scan the database for this new task in queue. Once it
> > picks up the task, the timeout for this application to run will be set
to
> > infinite. It'll establish a SMTP socket either to a really beefed up
mailing
> > list server or the localhost SMTP server to begin blasting out these
emails.
> >
> > From what I understand, it's better to blast emails via an open socket
> > connection to SMTP rather than looping through Sendmail. Is this the
right
> > thing todo?
>
> 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
and run it every hour.

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
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
method seems to be like BCC as you can't personalized each email To:
recepient.

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
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.

> > I've also heard that PHP is not good for writing mailing lists
application,
> > but Mailman is written in Python and it's able to send thousands of
email
> > just fine. Any thoughts on this?
>
> When people do not know how to do it properly, they blame it on the
> software. Note down: *smart software always beats fast software*. Sure
> you can use a faster language like C  (not Python), but if you develop
> smart software in PHP it can be almost as fast as a similar solution in
> C and does not take an etternity to develop and debug.

That's what I figure :)

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
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.

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.

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.


--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
is_numeric() will work with variables just fine. So:

  if (is_numeric($var)) {
      print "Yep, it's numeric";
  } else {
      print "Nope, it sure isn't a number";
  }

Make sure $var is defined.  If it's coming from a
form then use $_POST['var'] or similar instead for
reasons described here:

  http://www.php.net/variables.external

Regards,
Philip Olson

On Sat, 21 Dec 2002, Beauford.2002 wrote:

> Thanks for the info, but ..... is_numeric does not appear to accept
> variables  i.e. is_numeric($num) and ctype gives me the following.
> 
> Fatal error: Call to undefined function: ctype_digit() in
> /usr/local/apache/htdocs/.............. on line 6
> 
> 
> 
> 
> ----- Original Message -----
> From: "Philip Olson" <[EMAIL PROTECTED]>
> To: "Beauford.2002" <[EMAIL PROTECTED]>
> Cc: "PHP General" <[EMAIL PROTECTED]>
> Sent: Saturday, December 21, 2002 9:50 PM
> Subject: Re: [PHP] Forms and PHP variables
> 
> 
> >
> > Use is_numeric()
> >
> >   http://www.php.net/is_numeric
> >
> > See also the ctype functions which can
> > be read about here:
> >
> >   http://www.php.net/ctype
> >
> > And yes, regular expressions are another
> > option but aren't needed here.
> >
> > Regards,
> > Philip Olson
> >
> >
> > On Sat, 21 Dec 2002, Beauford.2002 wrote:
> >
> > > Hi,
> > >
> > > First off, thanks to all those that helped out with my other questions.
> Not
> > > all my problems were solved, but I'm certainly closer. Still working on
> the
> > > same project I need to do the following.
> > >
> > > I have a form where users input numbers only, is there a way I can have
> php
> > > check to make sure a letter or other character didn't get put in by
> > > accident. I was looking at ereg, but not to familiar with this or if it
> > > would work in this case.
> > >
> > > TIA
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
> On Sat, 2002-12-21 at 08:03, John W. Holmes wrote:
> > > I'm setting a session with
> > > session_set_cookie_params (time()+6480000);
> > > so the cookie should last 70 days+ but the data wasn't
> > > returned.
> > >
> > > from looking in the manual i see that session_cache_expire is used
to
> > set
> > > or print the current value of the expire. Its set in php.ini by
> > default to
> > > 180 minutes.
> > >
> > > So it seems that the garbage collector will clean up the session
file
> > > after 180 mins or 10800 seconds which is less then i was expecting
> > after
> > > setting the cookie life.
> > >
> > > do i need to set
> > >
> > > session_set_cookie_params (time()+6480000);
> > > session_cache_expire (6480000);
> > >
> > > for the data to still be available if the user returns during the
> > cookies
> > > life and is this on a per session basis.
> >
> > Well, first of all, session cookies are deleted when the user closes
> > their browser. So unless the user is leaving the browser open for 70
> > days, this setting won't matter.
> 
> This is incorrect, by default session cookies have a lifetime of 0
which
> means they are peresistent until the browser is closed.  If you set
the
> ini directive session.cookie_lifetime to something other than 0, for
> example 86400 then the session will for the number of seconds
specified,
> in this case 1 day, even after the browser has been closed.

Okay, I should have known that, but thanks for pointing it out. So for
the original question, you would want to increase the
session.gc_maxlifetime to match the session.cookie_lifetime, right?
Otherwise the cookie will persist but the data within the session will
be erased.

---John W. Holmes...

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


--- End Message ---
--- Begin Message --- It's a new day and I'm still trying to figure my flat-text database update problem out. I am uploading from mac to unix . Does a .txt file have a resource fork? Is the resource fork from the mac file automatically scraped by unix, or do I have to do that? Would it be efficient to strip the resource fork with PHP? Has anyone written anything to deal with this? If not, any resources to help me figure out how to do it would be appreciated.

Thanks,
loop



----- snip snip -----
I'm using a HTML form to submit flat text files to a MySQL database. When I upload the text file by FTP the script that loads it's contents into the database works as expected. When I upload using the HTML form it seems to ignore the new line in the text file. As a result it only creates one row in the table with some overflow in the last cell. Does anyone know how to deal with this?


_________________________________________________________________
The new MSN 8: smart spam protection and 3 months FREE*. http://join.msn.com/?page=features/junkmail&xAPID=42&PS=47575&PI=7324&DI=7474&SU= http://www.hotmail.msn.com/cgi-bin/getmsg&HL=1216hotmailtaglines_smartspamprotection_3mf

--- End Message ---
--- Begin Message ---
Hey loop:

On Sunday, December 22, 2002, at 03:35 PM, James Brennan wrote:

It's a new day and I'm still trying to figure my flat-text database update problem out. I am uploading from mac to unix .
I Assume you are uploading from Mac OS 9 or earlier, 'cause OS X is UNIX :)
(Although OS X is able handle Windows, Mac OS 9 and UNIX line endings).

 Does a .txt file have a resource fork?
File name extensions in Mac OS 9 have little meaning so I assume you mean a file with a file type of 'TEXT'. Text Files created with MS Word, for example, in fact do have a resource fork, but if uploaded in "raw" form, the resource fork is left behind and what is sent is just the text, or the contents of the data fork.

Keep in mind that a file with a file extension of .txt could be any kind of file.

Is the resource fork from the mac file automatically scraped by unix, or do I have to do that?
The resource fork is not sent unless the file is BINHEXed i.e converted to a binary file with the resource fork and data fork munged together. The receiving end has to be able to decode this type of file, which is _not_ text.

When your file is uploaded via HTML form, if it is text, perhaps in PHP you could look for \r or \n and make sure that the UNIX line ending is there - not sure which MacOS 9 uses.

HTH somewhat.
David

Would it be efficient to strip the resource fork with PHP? Has anyone written anything to deal with this? If not, any resources to help me figure out how to do it would be appreciated.

Thanks,
loop



----- snip snip -----
I'm using a HTML form to submit flat text files to a MySQL database. When I upload the text file by FTP the script that loads it's contents into the database works as expected. When I upload using the HTML form it seems to ignore the new line in the text file. As a result it only creates one row in the table with some overflow in the last cell. Does anyone know how to deal with this?


_________________________________________________________________
The new MSN 8: smart spam protection and 3 months FREE*. http://join.msn.com/?page=features/ junkmail&xAPID=42&PS=47575&PI=7324&DI=7474&SU= http://www.hotmail.msn.com/cgi-bin/ getmsg&HL=1216hotmailtaglines_smartspamprotection_3mf


--
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 a php script that enables people to upload files
on my server. I don't know if this is a general problem or if you need
to see the script. It works fine with small files, but as soon as I try
to upload files with a size of a couple of MB, if
(is_uploaded_file($file)) returns false. I wonder why that is!
Kind regards,
Oliver

--- End Message ---
--- Begin Message ---
You need to set your php memory limit to twice the amount of any given file you
upload.  If your memory limit (default 8M) is not twice the size of the file(s)
being uploaded it will not work.

look in php,ini

HTH

Quoting Oliver Witt <[EMAIL PROTECTED]>:

### Hi,
### I have a problem with a php script that enables people to upload files
### on my server. I don't know if this is a general problem or if you need
### to see the script. It works fine with small files, but as soon as I try
### to upload files with a size of a couple of MB, if
### (is_uploaded_file($file)) returns false. I wonder why that is!
### Kind regards,
### Oliver
### 
### 
### -- 
### PHP General Mailing List (http://www.php.net/)
### To unsubscribe, visit: http://www.php.net/unsub.php
### 
### 



--- End Message ---
--- Begin Message ---
You need to set your php memory limit to twice the amount of any given file you
upload.  If your memory limit (default 8M) is not twice the size of the file(s)
being uploaded it will not work.

look in php.ini

HTH

Quoting Oliver Witt <[EMAIL PROTECTED]>:

### Hi,
### I have a problem with a php script that enables people to upload files
### on my server. I don't know if this is a general problem or if you need
### to see the script. It works fine with small files, but as soon as I try
### to upload files with a size of a couple of MB, if
### (is_uploaded_file($file)) returns false. I wonder why that is!
### Kind regards,
### Oliver
### 
### 
### -- 
### PHP General Mailing List (http://www.php.net/)
### To unsubscribe, visit: http://www.php.net/unsub.php
### 
### 



--- End Message ---
--- Begin Message ---
Howdy,

in my header page that I include I have a lil script that basically welcomes
a user to the site.. I've been asked if I can only get this to show up on
the 1st page of the site ( index.php ) now rather than have a whole new
header page I want to see if i can go  something like this

if page = index.php
do this
else
do that

now to my actual question which way/function would be the better option to
use for this..

$_SERVER["REQUEST_URI"], $_SERVER["SCRIPT_NAME"] or try and do something
with $_SERVER["PHP_INFO"], or is the one that I am missing .. ?

Cheers

Peter
"the only dumb question is the one that wasn't asked"


--- End Message ---
--- Begin Message ---
I use:

if(eregi('index.php', $_SERVER['PHP_SELF']))
    {
    include('welcome_thing.txt');
    }

although it'd be quicker without the eregi() call, as long as you knew the
full value that PHP_SELF would return.


Cheers,

Justin


on 23/12/02 11:30 AM, Peter Houchin ([EMAIL PROTECTED]) wrote:

> Howdy,
> 
> in my header page that I include I have a lil script that basically welcomes
> a user to the site.. I've been asked if I can only get this to show up on
> the 1st page of the site ( index.php ) now rather than have a whole new
> header page I want to see if i can go  something like this
> 
> if page = index.php
> do this
> else
> do that
> 
> now to my actual question which way/function would be the better option to
> use for this..
> 
> $_SERVER["REQUEST_URI"], $_SERVER["SCRIPT_NAME"] or try and do something
> with $_SERVER["PHP_INFO"], or is the one that I am missing .. ?
> 
> Cheers
> 
> Peter
> "the only dumb question is the one that wasn't asked"
> 
> 

--- End Message ---
--- Begin Message ---
localhost refferes to the actual machine your are on .. what is the remote
server's host name or ip number .. use one of them instead of local host

> -----Original Message-----
> From: Kelly Meeks [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, 21 December 2002 10:00 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] php/dreamweaver mx/mysql server question...
>
>
> I'm trying to get dreamweaver mx working with php/mysql and a
> remote server.
>
> My remote server is named localhost.  How can I change it's name?
>  Is it as simple as change the host value for the user's login?
> I've tried several things to no avail.
>
> TIA,
>
> Kelly
>

--- End Message ---
--- Begin Message --- Hi people,.

I have to build several classes for a project i am doing, but i am quite new to OOP programming. I need to make a database abstraction layer class and a user login class.. Does anyone know some good tutorials about these things and OOP in general. Thanks in advance..

Best regards,

Davy Obdam
mailto:[EMAIL PROTECTED]


--- End Message ---
--- Begin Message ---
Both of those classes would already exist on a site like phpclasses.org...
do you have to BUILD them, or do you NEED them?

Justin


on 23/12/02 11:43 AM, Davy Obdam ([EMAIL PROTECTED]) wrote:

> Hi people,.
> 
> I have to build several classes for a project i am doing, but i am quite
> new to OOP programming. I need to make a database abstraction layer
> class and a user login class.. Does anyone know some good tutorials
> about these things and OOP in general. Thanks in advance..
> 
> Best regards,
> 
> Davy Obdam
> mailto:[EMAIL PROTECTED]
> 
> 

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

Thanks for your quick reply.. Well in this case i needs to build em myself, because i am doing a course called Masterclass PHP and i have to learn OOP.. So i am looking for some good OOP tutorials/examples on the web.... I am very interested in creating a user login class using sessions....Do u know any good sites where i can find tutorials/examples about this.?

Best regards,

Davy Obdam
mailto:[EMAIL PROTECTED]

Justin French wrote:

Both of those classes would already exist on a site like phpclasses.org...
do you have to BUILD them, or do you NEED them?

Justin


on 23/12/02 11:43 AM, Davy Obdam ([EMAIL PROTECTED]) wrote:


Hi people,.

I have to build several classes for a project i am doing, but i am quite
new to OOP programming. I need to make a database abstraction layer
class and a user login class.. Does anyone know some good tutorials
about these things and OOP in general. Thanks in advance..

Best regards,

Davy Obdam
mailto:[EMAIL PROTECTED]







--- End Message ---
--- Begin Message ---
> Hi Justin,
>
> Thanks for your quick reply.. Well in this case i needs to build em
> myself, because i am doing a course called Masterclass PHP and i have to
> learn OOP.. So i am looking for some good OOP tutorials/examples on the
> web.... I am very interested in creating a user login class using
> sessions....Do u know any good sites where i can find tutorials/examples
> about this.?
>

If that's the case... u can try looking at these tutorials on Zend.com...

http://www.zend.com/zend/tut/tutorial-johnson.php
http://www.zend.com/zend/tut/tutorial-johnson2.php

As well as these ones on DevArticles.com

http://www.devarticles.com/art/1/241
http://www.devarticles.com/art/1/245
http://www.devarticles.com/art/1/262
http://www.devarticles.com/art/1/285

HTH!

Yours,
Wee Keat

------------------------------------------------------------
"Good timber does not grow with ease; the stronger the wind, the stronger
the trees."


--- End Message ---
--- Begin Message ---
This tutorial lists many oop tutorials:

  Know of any basic tutorials on PHP Classes and OOP?
  -------------------------------------------------------
  http://www.faqts.com/knowledge_base/view.phtml/aid/7569

Regards,
Philip Olson


On Mon, 23 Dec 2002, Wee Keat wrote:

> 
> > Hi Justin,
> >
> > Thanks for your quick reply.. Well in this case i needs to build em
> > myself, because i am doing a course called Masterclass PHP and i have to
> > learn OOP.. So i am looking for some good OOP tutorials/examples on the
> > web.... I am very interested in creating a user login class using
> > sessions....Do u know any good sites where i can find tutorials/examples
> > about this.?
> >
> 
> If that's the case... u can try looking at these tutorials on Zend.com...
> 
> http://www.zend.com/zend/tut/tutorial-johnson.php
> http://www.zend.com/zend/tut/tutorial-johnson2.php
> 
> As well as these ones on DevArticles.com
> 
> http://www.devarticles.com/art/1/241
> http://www.devarticles.com/art/1/245
> http://www.devarticles.com/art/1/262
> http://www.devarticles.com/art/1/285
> 
> HTH!
> 
> Yours,
> Wee Keat
> 
> ------------------------------------------------------------
> "Good timber does not grow with ease; the stronger the wind, the stronger
> the trees."
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
I found thise one to be rather useful:

http://www.liquidpulse.net/articles/125


----- Original Message -----
From: "Davy Obdam" <[EMAIL PROTECTED]>
To: "Justin French" <[EMAIL PROTECTED]>
Cc: "PHP" <[EMAIL PROTECTED]>; "PHP-WIN" <[EMAIL PROTECTED]>
Sent: Sunday, December 22, 2002 8:30 PM
Subject: Re: [PHP] Tutorials on OOP


: Hi Justin,
:
: Thanks for your quick reply.. Well in this case i needs to build em
: myself, because i am doing a course called Masterclass PHP and i have to
: learn OOP.. So i am looking for some good OOP tutorials/examples on the
: web.... I am very interested in creating a user login class using
: sessions....Do u know any good sites where i can find tutorials/examples
: about this.?
:
: Best regards,
:
: Davy Obdam
: mailto:[EMAIL PROTECTED]
:
: Justin French wrote:
:
: >Both of those classes would already exist on a site like
phpclasses.org...
: >do you have to BUILD them, or do you NEED them?
: >
: >Justin
: >
: >
: >on 23/12/02 11:43 AM, Davy Obdam ([EMAIL PROTECTED]) wrote:
: >
: >
: >
: >>Hi people,.
: >>
: >>I have to build several classes for a project i am doing, but i am quite
: >>new to OOP programming. I need to make a database abstraction layer
: >>class and a user login class.. Does anyone know some good tutorials
: >>about these things and OOP in general. Thanks in advance..
: >>
: >>Best regards,
: >>
: >>Davy Obdam
: >>mailto:[EMAIL PROTECTED]
: >>
: >>
: >>
: >>
: >
: >
: >
: >
:
:
:
:
: --
: PHP General Mailing List (http://www.php.net/)
: To unsubscribe, visit: http://www.php.net/unsub.php
:
:
:


--- End Message ---
--- Begin Message ---
I have the following problem, help me please!!!.

php 4.2.2

register globals off

apache 1.3.27

windows 2000

internet explorer 6.0 SP1

I have two archives.

One that handles the code part, as validating form's inputs and inserting in
the data base, and other one is the fill-out form.

Inside of the form, includes an field in order to upload a image file .

The problem comes when I inputs (submit) image in said field, When uploading
it, the variables POST, GET, REQUEST does not identify to the "mode"
variable neither to the rests the form's fields.

But if not submit an image in that image field, it identifies all the form's
variables,.

The drive is the following.

mode take first the value of "addresi", later changes to the value "insert"
when enters in the "print_add_resi_form" function inside of the sentence
"switch".

The $ME variable take the value of "http://localhost/../residente.php";

What can be happening ?

/*******************/
residente.php

<?
include($_SERVER['DOCUMENT_ROOT']."/aruni/config.php");


//require_login();
//require_priv("admin");

$DOC_TITLE = "Lista de Residentes";
include("plantilla/encabezado.php");

echo $_REQUEST["mode"]."<br>";
echo $_GET["mode"]."<br>";
echo $_POST["mode"]."<br>";
echo $_FILES["mode"]."<br>";
echo "<br>";
echo "<br>";
foreach($_REQUEST as $key=>$value){
echo $key."--".$value."<br>";
}
echo "<br>";
echo "<br>";
foreach($_POST as $key=>$value){
echo $key."--".$value."<br>";
}
echo "<br>";
echo "<br>";
foreach($_GET as $key=>$value){
echo $key."--".$value."<br>";
}
echo "<br>";
echo "<br>";
foreach($_FILES as $key=>$value){
echo $key."--".$value."<br>";
}
echo "<br>";
echo "<br>";
//echo $_GET."<br>";
//echo $_POST."<br>";
//echo $_FILES."<br>";
//echo $_HTTP_POST_VARS["mode"];

switch ($_REQUEST["mode"]) {
 case "addresi" :
  print_add_resi_form(nvl($_REQUEST["category_id"], 1));
  break;
...

 case "insert" :
  insert_resi($_REQUEST["id"], $_POST, $_FILES["frmmg"]);
  break;

...

 default :
  print_resi_list();
  break;
}

function print_add_resi_form($idresi = 1) {
global $ME, $CFG;
...
$frm01["mode"] = "insert";
...
include("plantilla/form01.php");
}

function insert_resi($id, $form, $formimg){
 global $ME, $CFG;

....

}


/*******************/

/*********************/
form01.php

<form method="post" enctype="multipart/form-data" action="<?=$ME?>">
<input type="hidden" name="id" value="<?=$id?>">
<input type="hidden" name="mode" value="<?=$frm01["mode"]?>">
...
<input type="file" name="frmmg">
...
</form>
/********************/


--- End Message ---

Reply via email to