RE: [PHP] Newbie Question.. (MySQL/PHP)

2001-09-06 Thread Jack Dempsey

sure, am actually doing this right now ;-)
It depends on how fancy you want to get...if you don't mind slicing off in
the middle of a word, you can just do this:
$preview_text = substr($text,0,200) . '. . .'; //gets the first 200
characters and adds an ellipsis afterwards

if you want to make sure you're stopping at a space try:
$preview_text = substr($text,0,strpos($text,' ',200)) . '. . .';//gets all
the text up to the first space that occurs after 200 chars

you want exactly fifty words, you could try something like this (untested)
preg_match("/^(\w+\s){50}/",$text,$match);
$preview_text = $match[0] . '. . .';

its late and i'm reaching the 10 hour coding mark, so there might be a
syntax error lurking in there, but those should at least get you
started.

jack

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 07, 2001 3:19 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Newbie Question.. (MySQL/PHP)


Hey guys,

I have a mysql database of articles, and what i'd like to do is make 1 page
that shows a brief sneak peak of each article, so what I would do is, show
the first 50 or so words of each article and then add an elipses at the end.
I'm sure it can be done but I wouldn't have a clue where to start. Any
suggestions, or anyone ever done this?

Thanks,
Nate


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Newbie Question.. (MySQL/PHP)

2001-09-06 Thread David Robley

On Fri,  7 Sep 2001 16:49, [EMAIL PROTECTED] wrote:
> Hey guys,
>
> I have a mysql database of articles, and what i'd like to do is make 1
> page that shows a brief sneak peak of each article, so what I would do
> is, show the first 50 or so words of each article and then add an
> elipses at the end. I'm sure it can be done but I wouldn't have a clue
> where to start. Any suggestions, or anyone ever done this?
>
> Thanks,
> Nate


Mysql has a substring function you could use to grab the first n 
characters, then just concatenate the elippses when you display the 
string.

With a little more effort, you could play around with substring_index to 
display the first n words of the article.

-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   Happiness is a warm modem

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Assigning PHP Session ID's as cookie with a time set to it?

2001-09-06 Thread Richard Lynch

Read php.ini
Also read http://php.net/session

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: Smileyq <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 06, 2001 12:11 AM
Subject: Assigning PHP Session ID's as cookie with a time set to it?


> Hello all,
> While everything seems to be working fine in my pages I would really like
> to learn to how set up sessions id's a different way other than at the
> begining of each session. Right now it assigns a session ID per session
> with the cookie value of PHPSESSID. Is there a way I can set the value
> of the cookie to say ID or SID and give it a time for expiration so that
> I can authenticate against session id's and uses user preferences even
> when their browsers are closed. Any help would be greatly appreciated.
> Thanks guys..
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Executing a CGI script from a PHP script

2001-09-06 Thread Richard Lynch

Try using virtual instead of exec, I think...

Otherwise, I'm guessing you want to walk through all of $HTTP_ENV_VARS and
build up a command line with each one being set followed by a ; and then
your actual CGI to run.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: Patrick Dunford <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 06, 2001 8:06 AM
Subject: Executing a CGI script from a PHP script


> The server I am on uses a CGI script to get a count for home pages. With
> server side includes it is executed using the Apache "exec" SSO directive
> and works well.
>
> The problem with PHP is that the CGI script when executed by Apache sets
> a lot of environmental variables that apparently aren't set by the PHP
> script when using system() to run the CGI script.
>
> I wondered if there are any commands in PHP4 that will cause PHP/Apache
> to set the environmental variables the same way as it would when Apache
> executes a CGI script directly.
>
> --
> ===
> Patrick Dunford, Christchurch, NZ
>
>He makes me lie down in green pastures, he leads me beside quiet
> waters, he restores my soul. He guides me in paths of righteousness
> for his name's sake.
> -- Psalm 23:2-3
>http://www.StudyLight.org/desk/?query=Psalm+23:2-3


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: PHP4 Session Handling

2001-09-06 Thread Richard Lynch

> 1) Added this line into the .htaccess file:  php_value
session.save_handler
> user

I would have expected this to work, since it happens before PHP gets
involved...

> 2) session_module_name("user");
> 3) ini_set("session.save_handler", "user");

Speculation:
These would not work *if* the php.ini had auto_session turned on, probably,
since the session would have been initialized before your code was executed,
I should think.

> Fatal error: Failed to initialize session module in
> /home/woodstor/thefinewoodstore-www/index.php on line 3

Do file-based sessions work?
Have you thoroughly tested your mysql_session_* functions?

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Newbie Question.. (MySQL/PHP)

2001-09-06 Thread nate

Hey guys,

I have a mysql database of articles, and what i'd like to do is make 1 page that shows 
a brief sneak peak of each article, so what I would do is, show the first 50 or so 
words of each article and then add an elipses at the end. I'm sure it can be done but 
I wouldn't have a clue where to start. Any suggestions, or anyone ever done this?

Thanks,
Nate



Re: [PHP] Does PHP work with Sybase ASA?

2001-09-06 Thread Rasmus Lerdorf

Perhaps people expected you to check the docs or the code yourself.  If
you go to php.net/sybase you will find the functions you need.  If you
read the user comments on that page you will even find urls to
tutorials/faqs on how to install and configure things for PHP to talk to
Sybase ASA.

eg. http://www.finebyte.com/docs/sybase/ASA-PHP-Linux.html
http://help.webmedia.com.au/Linux-Apache-PHP-Sybase-HOWTO.txt

-Rasmus

On Fri, 7 Sep 2001, Davor Pleskina wrote:

> 2nd time, seem that last time nobody saw my question...
>
> I mean, is there in PHP support for Sybase Adaptive Server Anywhere, any
> version, like for MySQL and some other databases?
>
> Thanks.
>
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Does PHP work with Sybase ASA?

2001-09-06 Thread Davor Pleskina

2nd time, seem that last time nobody saw my question...

I mean, is there in PHP support for Sybase Adaptive Server Anywhere, any
version, like for MySQL and some other databases?

Thanks.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: Function call introspection: possible or not?

2001-09-06 Thread Christopher CM Allen


> > Is there any way for a function to determine the name of the calling
> > function?

This would be very useful!!  Great Idea!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: how do I?

2001-09-06 Thread Adrian D'Costa

On Thu, 6 Sep 2001, _lallous wrote:

> onMouseOver="info( 
> Dunno, should this be: onMouseOver="info(' instead?
> I mean I see no quotes surrounding the javascript string (that is generated
> from PHP).

ok, that what a typo. As I said eariler.  The script works fine if text in
the table is a single line.  If it is multiply lines then it does not
display, but in the source code of the browser it is there, except 
flashing.

Adrian


> 
> 
> "Adrian D'Costa" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi,
> >
> > I am trying to write a dynamic help module based on a mysql database.  I
> > am using Javascript and PHP to do this.
> >
> > This is part of my script (both java and php)
> >
> > 
> > 
> > 
> >  > href="offerte.html" onMouseOver="info( >
> > require("user.php");
> > require("error.php");
> > $newuser = new user();
> >
> > $nerror= new error();
> > $xfile=explode("/", __FILE__);
> > $num=sizeof($xfile);
> > $fname=$xfile[$num-1];
> > // Sql Statement
> >
> > $searchStmt = "select * from help where fnumber=$xline and
> > fname='$fname'";
> >
> > //execute the statement for help
> >
> > if(!$result=mysql_query($searchStmt, $newuser->link))
> > {
> > $xerror = $nerror->error1(202);
> > print($xerror);
> > exit();
> > }else{
> > $num=mysql_num_rows($result);
> > if ($num==0)
> > {
> > $xerror = $nerror->error1(300);
> > print($xerror);
> > exit();
> > } else {
> > $row=mysql_fetch_object($result);
> > }
> > }
> > $xdetail = nl2br($row->hdetail);
> > echo "$xdetail";
> > ?>);">
> >
> > This script works if I have a single line the hdetail field, but if I put
> > multiply lines in the hdetail field nothing shows up.  I added nl2br but
> > nothing work, if you view the source in netscape it is there with the
> > .  I am sure I am doing something wrong, but where I don't know.  Can
> > some one correct me?
> >
> > TIA
> >
> > Adrian
> >
> 
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Delivering an authenticated pdf

2001-09-06 Thread George Pitcher

Hi all,

I want to be able to, after authentication, read a pdf into a string and
then write it out to the client through the browser.

I can't do all of the procedure in PHP as it's an add on to a
Lasso/Filemaker site. I can handle the transfer between the two processes, I
just need to do the writing out to the client.

Has anyone done this sort of thing before? (Not the lasso/php stuff but pdf
delivery.)

The reasoning is that the user should not be able to get to the pdf unless
they have been authenticated (in Lasso).

Any suggestions?


Regards

George Pitcher

Technical Manager
HERON Project
Napier University
Edinburgh EH10 5DT

[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]

Work: www.heron.ac.uk
Play  : www.pingu.napier.ac.uk


   programmer -  A device for transmuting caffeine into code.





_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Question about running php as root

2001-09-06 Thread Richard Lynch

Why do you need the DSO to run as root?...

If it's just to do a specific task, it may be easier to write a shell script
(or PHP script, or Perl script) and suid it so that "nobody" can do that one
specific task that requires root access.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: Richard Kurth <[EMAIL PROTECTED]>
Newsgroups: php.general
To: php <[EMAIL PROTECTED]>
Sent: Wednesday, September 05, 2001 5:08 PM
Subject: Question about running php as root


> I have two versions of php running on my site one as a DSO with Apache
> and one as a cgi for command line scripting.
> I have scripts that run from a crontab that run at root.
>
> Now I know I can not run a script at root from PHP that is running as
> A dso with Apache.
>
> But is there a way to make one of my root scripts run by sending it a
> command to do so from the DSO version of PHP like with system command
> or something like that. Or some roundabout way to make it think root is
> asking the script run.
>
> I hope you understand what I am asking.
>
>
>
>
>
>
>
>
>
>
>
> Best regards,
>  Richard
> mailto:[EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: newbie looking to sync access with MySQL

2001-09-06 Thread Richard Lynch

> I have a potential customer that just called and would like to create a
web
> site that would display secure info for their clients. Currently his
> employees are using a flat Access database to add, edit and delete records
> and he would like to keep it that way.
>
> Normally I would create a web manager for them to add, edit and delete the
> MySQL database. Is there an easy, reliable way to sync up Access with
MySQL.
> Maybe a nightly script that could upload the contents of Access to MySQL.
>
> Would it be easier to start with ASP and SQL Server?

If only the Access database can change, you could fairly easily schedule an
export and then upload that to be sucked into MySQL.

There also is at least one tool/product out there specifically to do this,
but I dunno where it is...

You really don't want Access behind your web-site.  Too unstable.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Very urgent for being help!!!

2001-09-06 Thread Richard Lynch

Use a "cursor" in Oracle.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: Duy B <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
Raymond Lee Meng Hong <[EMAIL PROTECTED]>; Sinardy Xing
<[EMAIL PROTECTED]>; Stephane Faroult <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Saturday, January 02, 1999 1:27 PM
Subject: Very urgent for being help!!!


> Dear all,
> Now i have an Oracle database. I have created a table contains 43 rows for
example. Fields  of my table are id primary key, ten char, tuoi int, diachi
char. I use PHP script to contact with my oracle table and search
information I need. After that display into table on my screen. Each time it
displays 10 items. Suppose, I have created a html page to search with 'ten'.
Could anybody show me how to print each time 10 items, and [Priv] or [Next]
as well? I am very appreciated for receiving your replies. Thanks you all.
> Best regards,
> BaDu
>
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Grabbing dynamic pages

2001-09-06 Thread Joseph Blythe

This is true this is exactly why i try and find a solution here first (with
PHP), my bosses attitude was to hire java programmers i said 'why?'.

I also noticed getss which strips stuff on the read which is kinda cool too
(c:

Joseph

-Original Message-
From: David Robley [mailto:[EMAIL PROTECTED]]
Sent: Friday, 7 September 2001 3:02 PM
To: Joseph Blythe; [EMAIL PROTECTED]
Subject: Re: [PHP] Grabbing dynamic pages


On Fri,  7 Sep 2001 14:44, Joseph Blythe wrote:
> Hey all,
>
> I got a bit of a problem I need to be able to grab info (which has been
> approved) from the Australian Stock Exchange Website (www.asx.com.au)
> all they say about this in the information they sent me is:
>
> "To obtain your share price data you will need to get your IT
> department to write a java object or a com active x object to strip out
> the unnecessary html so that you are just left with your share price
> information."
>
> LOL I am the IT department (well part of it) and I don't use or would
> even recommend using these products not that there is anything wrong
> with them, furthermore even if I did this does not help me very much
> (c:
>
> I was sort of wondering if there is a way to do this sort of thing with
> PHP? the only other information I have is the URL in the form of:
>
> http://www.asx.com.au/scripts/nd_ISAPI_50.dll/asx/research/chartsSearch
>.jsp? searchBy=asxCode&TimeFrame=D&asxCode=ASX
>
> I tried a quick test using the filesystem functions with no success, I
> was sort of hoping for a 'Yes' / 'No" answer maybe if 'Yes' just a
> quick explanation.
>
> Any help would be much much appreciated.
>
> Regards,
>
> Joseph Blythe
> Web Development

Seems like PHP has something to do just about anything; in this case you
may find striptags is just the bee's knees.

--
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA

   Real Programmers aren't afraid to use GOTO's.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Error while saving attachments (jpegs)

2001-09-06 Thread Richard Lynch

Try opening the origianl and downloaded files in a text editor and see if
you can spot the differences...

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: Daniel Reichenbach <[EMAIL PROTECTED]>
Newsgroups: php.general
To: Php-General <[EMAIL PROTECTED]>
Sent: Wednesday, September 05, 2001 9:31 AM
Subject: Error while saving attachments (jpegs)


> Hy,
>
> i wrote a little cron job which fetches mails from a pop account and
> saves all contained jpeg attachments to disc.
>
> I use the following code:
> --- snap ---
> // determine attachment encoding
> $atty = imap_fetchbody($mbox, $i, $b);
>
> switch($att_ency) {
> case "base64":
> $decoded_string = imap_base64($atty);
> break;
>
> case "binary":
> $decoded_string = imap_binary($atty);
> break;
>
> case "other":
> $decoded_string = $atty;
> break;
> }
>
> // save it to disc
> echo $upload_folder.$att_name;
> $fp = fopen ($upload_folder.$att_name , "w+");
> fwrite ($fp, $decoded_string, $atty_size);
> fclose ($fp);
> --- snap ---
>
> After saving there is a difference in filesize and the image is
> unusable. Original image size is 758.204 bytes and after saving
> the attachment to disc its 759.885 bytes. What am i doing wrong
> here?
>
> Greetings from Germany,
> Daniel
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Grabbing dynamic pages

2001-09-06 Thread Joseph Blythe

hmm just tried exact code still same error, I am going to have to have a
little talk to our internet manager as he has done some pretty nasty stuff
to our border. what i do find starnge is no errors are produced when I
exclude all the query stuff eg:

$fp = fopen("http://www.asx.com.au","r";);

Thanks again,

Joseph

-Original Message-
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Sent: Friday, 7 September 2001 3:18 PM
To: Joseph Blythe
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Grabbing dynamic pages

This script worked fine for me here:

http://www.asx.com.au/scripts/nd_ISAPI_50.dll/asx/research/CompanyInf
oSearchResults.jsp?searchBy=asxCode&allinfo=on&asxCode=asx&companyName=&prin
cipalActivity=&industryGroup=0","r");
while(!feof($fp)) echo fgets($fp,1024);
fclose($fp);
?>

Firewall in the way perhaps?

-Rasmus


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Grabbing dynamic pages

2001-09-06 Thread David Robley

On Fri,  7 Sep 2001 14:44, Joseph Blythe wrote:
> Hey all,
>
> I got a bit of a problem I need to be able to grab info (which has been
> approved) from the Australian Stock Exchange Website (www.asx.com.au)
> all they say about this in the information they sent me is:
>
> "To obtain your share price data you will need to get your IT
> department to write a java object or a com active x object to strip out
> the unnecessary html so that you are just left with your share price
> information."
>
> LOL I am the IT department (well part of it) and I don't use or would
> even recommend using these products not that there is anything wrong
> with them, furthermore even if I did this does not help me very much
> (c:
>
> I was sort of wondering if there is a way to do this sort of thing with
> PHP? the only other information I have is the URL in the form of:
>
> http://www.asx.com.au/scripts/nd_ISAPI_50.dll/asx/research/chartsSearch
>.jsp? searchBy=asxCode&TimeFrame=D&asxCode=ASX
>
> I tried a quick test using the filesystem functions with no success, I
> was sort of hoping for a 'Yes' / 'No" answer maybe if 'Yes' just a
> quick explanation.
>
> Any help would be much much appreciated.
>
> Regards,
>
> Joseph Blythe
> Web Development

Seems like PHP has something to do just about anything; in this case you 
may find striptags is just the bee's knees.

-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   Real Programmers aren't afraid to use GOTO's.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Grabbing dynamic pages

2001-09-06 Thread Rasmus Lerdorf

This script worked fine for me here:

http://www.asx.com.au/scripts/nd_ISAPI_50.dll/asx/research/CompanyInfoSearchResults.jsp?searchBy=asxCode&allinfo=on&asxCode=asx&companyName=&principalActivity=&industryGroup=0","r";);
while(!feof($fp)) echo fgets($fp,1024);
fclose($fp);
?>

Firewall in the way perhaps?

-Rasmus

On Fri, 7 Sep 2001, Joseph Blythe wrote:

> Thanks all (c:
>
> > Why don't they make this available via XML?  Parsing HTML is painful.
>
> Was my exact question to them (c:
>
> > That just shows a chart.  How are you supposed to parse anything out of
> > that?
>
> Hehe I provided the wrong url should something like:
>
> http://www.asx.com.au/scripts/nd_ISAPI_50.dll/asx/research/CompanyInfoSearch
> Results.jsp?searchBy=asxCode&allinfo=on&asxCode=asx&companyName=&principalAc
> tivity=&industryGroup=0
>
> I tried it as suggested heres the output:
>
> Warning: php_hostconnect: connect failed in /home/asx/public_html/index.php
> on line 9
>
> Warning:
> fopen("http://www.asx.com.au/scripts/nd_ISAPI_50.dll/asx/research/CompanyInf
> oSearchResults.jsp?searchBy=asxCode&allinfo=on&asxCode=asx&companyName=&prin
> cipalActivity=&industryGroup=0","r") - Bad file descriptor in
> /home/asx/public_html/index.php on line 9
>
> Trust them to make it as hard as possible using Java Slowdown Pages :-))
>
> Will keep trying.
>
> Regards,
>
> Joseph
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: How to implement e-mail facility?

2001-09-06 Thread Balaji Ankem

hi! ,
   mine is windows 98 machine. Not linux.

anyway i am using  my company  mail server.

I am finding php.ini in c:\pear\tests directory instaed of c:\windows and
it does not contain anything. It has following stuff only.
>>>
; php.ini for PEAR tests
include_path=..
[java]
extension=php_java.dll
java.library.path=c:\php\extensions\
java.class.path="c:\php\extensions\jdk1.3.1\php_java.jar;c:\myclasses"

(this one i added just some time back for implementing e-mail)

[mail function]
; For Win32 only.
SMTP = 10.145.0.18

; For Win32 only.
sendmail_from = [EMAIL PROTECTED]
>

And i want to change environment variables like HTTP_REFERER and SMTP and
all..

I am in a position  unable to  change those vars.

thanks in advance.

Regards
-Balaji
- Original Message -
From: Richard Lynch <[EMAIL PROTECTED]>
To: Balaji Ankem <[EMAIL PROTECTED]>
Sent: Friday, September 07, 2001 7:43 AM
Subject: Re: How to implement e-mail facility?


Where is sendmail on your system?

Make php.ini have this:

sendmail_path = "/usr/bin/sendmail -t -i"

Only use whatever your sendmail path is.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: Balaji Ankem <[EMAIL PROTECTED]>
To: Kraa de Simon <[EMAIL PROTECTED]>
Cc: Richard Lynch <[EMAIL PROTECTED]>
Sent: Thursday, September 06, 2001 5:49 PM
Subject: How to implement e-mail facility?


> Hi ,
>it is giving the following errors...
>
> plz check..
>
> email2.php
> >
> 
>  $user_name="Balaji Ankem";
>  $user_mail="[EMAIL PROTECTED]";
>
>  mail($user_mail,"Thanks for visiting","Dear $user_name,\n We
>  appreciate your visit.");
>
>  ?>
>
> >
>
> errors:
> >
> Warning: Unknown error in c:\www\email2.php on line 7
> >
>
> php.ini
> >>
>
> ; php.ini for PEAR tests
> include_path=..
> [java]
> extension=php_java.dll
> java.library.path=c:\php\extensions\
> java.class.path="c:\php\extensions\jdk1.3.1\php_java.jar;c:\myclasses"
>
> [mail function]
> ; For Win32 only.
> SMTP = 10.145.0.18
>
> ; For Win32 only.
> sendmail_from = [EMAIL PROTECTED]
>
> >
>
>
> Thanks and regards
>
> -Balaji
> - Original Message -
> From: Kraa de Simon <[EMAIL PROTECTED]>
> To: 'Balaji Ankem' <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Cc: Renze Munnik <[EMAIL PROTECTED]>
> Sent: Thursday, September 06, 2001 2:34 PM
> Subject: RE: [PHP] How to implement e-mail facility?
>
>
> Edit the [mail function] section in php.ini:
>
> [mail function]
> ; For Win32 only.
> SMTP = localhost
>
> ; For Win32 only.
> sendmail_from = [EMAIL PROTECTED]
>
> ; For Unix only.  You may supply arguments as well (default: 'sendmail -t
> -i').
> ;sendmail_path =
>
> HTH,
>
> Simon.
>
> > -Original Message-
> > From: Balaji Ankem [mailto:[EMAIL PROTECTED]]
> > Sent: donderdag 6 september 2001 23:00
> > To: [EMAIL PROTECTED]
> > Cc: Renze Munnik
> > Subject: [PHP] How to implement e-mail facility?
> >
> >
> >
> > Hi friend,
> > I want to mail a user if he forget password .
> > How to implement that.
> > What are all the requirements.
> >
> > please see the following code.
> >
> >
> > >>>
> >  >
> > $user_name="Balaji Ankem";
> > $user_mail="[EMAIL PROTECTED]";
> >
> > mail($user_mail,"Thanks for visiting","Dear $user_name,\n We
> > appreciate
> > your visit.");
> >
> > ?>
> > 
> >
> > Thanks and regards
> > -Balaji Ankem
> >
> >
>
>





--
Information transmitted by this E-MAIL is proprietary to Wipro and/or its Customers
and is intended for use only by the individual or entity to which it is
addressed, and may contain information that is privileged, confidential or
exempt from disclosure under applicable law. If you are not the intended
recipient or it appears that this mail has been forwarded to you without
proper authority, you are notified that any use or dissemination of this
information in any manner is strictly prohibited. In such cases, please
notify us immediately at mailto:[EMAIL PROTECTED] and delete this mail
from your records.
-



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrat

RE: [PHP] Grabbing dynamic pages

2001-09-06 Thread Joseph Blythe

Thanks all (c:

> Why don't they make this available via XML?  Parsing HTML is painful.

Was my exact question to them (c:

> That just shows a chart.  How are you supposed to parse anything out of
> that?

Hehe I provided the wrong url should something like:

http://www.asx.com.au/scripts/nd_ISAPI_50.dll/asx/research/CompanyInfoSearch
Results.jsp?searchBy=asxCode&allinfo=on&asxCode=asx&companyName=&principalAc
tivity=&industryGroup=0

I tried it as suggested heres the output:

Warning: php_hostconnect: connect failed in /home/asx/public_html/index.php
on line 9

Warning:
fopen("http://www.asx.com.au/scripts/nd_ISAPI_50.dll/asx/research/CompanyInf
oSearchResults.jsp?searchBy=asxCode&allinfo=on&asxCode=asx&companyName=&prin
cipalActivity=&industryGroup=0","r") - Bad file descriptor in
/home/asx/public_html/index.php on line 9

Trust them to make it as hard as possible using Java Slowdown Pages :-))

Will keep trying.

Regards,

Joseph



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: PHP/Java, Receiving Error message.

2001-09-06 Thread Richard Lynch

> Warning: java.lang.NoSuchMethodException: initialize
>
> Now this method definitely exists.  The syntax I am using is as follows:
>
> $Class = new Java("long.path.to.class");
>
>$Method = $Class->initialize("12345", "George", "123 spiff Street",
> "suite 121", "Hometown", "USA", "12345", "UPG");

Wild guess:

Some of those arguments need to be integer rather than string?

I have no idea how it works, but since Java a variable-type language rather
than data-typed, I suspect you have to pass it the right types of variables
for method-matching to work.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Grabbing dynamic pages

2001-09-06 Thread Rasmus Lerdorf

> "To obtain your share price data you will need to get your IT department
> to write a java object or a com active x object to strip out the unnecessary
> html so that you are just left with your share price information."

Why don't they make this available via XML?  Parsing HTML is painful.

> I was sort of wondering if there is a way to do this sort of thing with PHP?
> the only other information I have is the URL in the form of:
>
> 
>http://www.asx.com.au/scripts/nd_ISAPI_50.dll/asx/research/chartsSearch.jsp?searchBy=asxCode&TimeFrame=D&asxCode=ASX

That just shows a chart.  How are you supposed to parse anything out of
that?

> I tried a quick test using the filesystem functions with no success, I was
> sort of hoping for a 'Yes' / 'No" answer maybe if 'Yes' just a quick
> explanation.

$fp =
fopen('http://www.asx.com.au/scripts/nd_ISAPI_50.dll/asx/research/chartsSearch.jsp?searchBy=asxCode&TimeFrame=D&asxCode=ASX','r');

should work just fine to get the HTML.

-Rasmus


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: UD4 & PhAkt Users?

2001-09-06 Thread Richard Lynch

> (and whether that's a pain to do) or if just uploading files and testing
> that way is a viable alternative.

Just upload and test is what *I* would recommend for a beginner.

If it's a live site, set up a second directory for development so you can
test before you copy over to live.

Switching to UtlraDev is unlikely to help much, and you'll spend more time
installing,configuring and figuring out UltraDev than you'll save.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Now Here's a Winner

2001-09-06 Thread Richard Lynch

Different versions of different browsers use different headers or variants
of headers to decide how to fill in the file name prompt.

You may even want to make the URL that the form ACTION points to be:

ACTION=whatever.php/export.csv
So that the really dumb browsers will think they are accessing a file named
export.csv
PHP and Apache will ignore it.
As far as why to get the FORM HTML in there rather than the CSV data, I can
only guess that you have other if () clauses earlier in the script that are
messing up what goes into $FinalContent.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: Jonathan Hilgeman <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 05, 2001 5:20 PM
Subject: Now Here's a Winner


> Okay, this has gone over my head. I am running Apache 1.3.19, with PHP
4.0.5
> and mySQL 3.23.37. The Apache/PHP server is on a Windows development box,
> and the mySQL is on a remote box. The basic function of the script is to
> first present a form where a user can select records that match a date,
and
> then they can choose whether to have the records be displayed on-screen,
or
> be sent as a file.
>
> Now, on-screen works beautifully. But, if I try the following code and
> specify to send as a file:
>
> if($ExportTo == "display")
>   {
>print $FinalContent;
>   }
> elseif($ExportTo == "file")
>   {
>$FileName = "export-$RecordDay-$RecordMonth-$RecordYear.csv";
>Header("Content-Type: application/x-octet-stream");
>Header("Content-Disposition: attachment; filename=$FileName");
>print $FinalContent;
>exit;
>   }
>
> - I get the popup window asking if I want to save it or open it. But the
> filename is not export-date.csv like it should be. Furthermore, if I
choose
> to save the file and then open it in a text editor, what I see is not
> $FinalContents, which is the expected output, but instead I see the form
> that I just submitted FROM. Yes, it saves the exact page I'm looking at -
> the one with the submit button I just pushed.
>
> Now, I know that it is getting to those Header() tags because they are the
> only ones in the code. So it is going inside the elseif() block. It is
> confusing the heck out of me.
>
> - Jonathan
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: php.ini not being read

2001-09-06 Thread Richard Lynch

Is php.ini readable?

Any messages in your Apache error log?

Are you 100% sure you really killed Apache and restarted?...  I've had cases
where I managed to install the new Apache in a different location, and ended
up with two different sets of httpd's running.  Quite disconcerting.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: Brett <[EMAIL PROTECTED]>
Newsgroups: php.general
To: Php-General@Lists. Php. Net <[EMAIL PROTECTED]>
Sent: Sunday, August 12, 2001 2:47 AM
Subject: php.ini not being read


> Changes made to my php.ini file are not showing up upon a restart of
apache.
> I compiled php to use the php.ini in a directory of my choosing and this
is
> the directory which phpinfo() reports the php.ini file to be found.  Yet
all
> changes are ignored.
>
> Any ideas why?
>
>
>brett newman
>[EMAIL PROTECTED]
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Grabbing dynamic pages

2001-09-06 Thread Joseph Blythe

Hey all,

I got a bit of a problem I need to be able to grab info (which has been
approved) from the Australian Stock Exchange Website (www.asx.com.au) all
they say about this in the information they sent me is:

"To obtain your share price data you will need to get your IT department
to write a java object or a com active x object to strip out the unnecessary
html so that you are just left with your share price information."

LOL I am the IT department (well part of it) and I don't use or would even
recommend using these products not that there is anything wrong with them,
furthermore even if I did this does not help me very much (c:

I was sort of wondering if there is a way to do this sort of thing with PHP?
the only other information I have is the URL in the form of:

http://www.asx.com.au/scripts/nd_ISAPI_50.dll/asx/research/chartsSearch.jsp?
searchBy=asxCode&TimeFrame=D&asxCode=ASX

I tried a quick test using the filesystem functions with no success, I was
sort of hoping for a 'Yes' / 'No" answer maybe if 'Yes' just a quick
explanation.

Any help would be much much appreciated.

Regards,

Joseph Blythe
Web Development

BoldFX / Binary Logic
The LOGICAL Choice!
750 Port Road Beverley
Phone: +61 08 8244 1800
Fax: +61 08 8244 1811
mailto:[EMAIL PROTECTED]






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Table Search

2001-09-06 Thread CC Zona

In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Devon) wrote:

> $result = mysql_query ("SELECT * FROM enet
>  WHERE TechContact LIKE '$TechContact%'");

You haven't fetched any rows, so the next line isn't coming from the query 
result.  Use one of the mysql_fetch_*() functions.

> print $row["TechContact"];

-- 
CC

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP complains when using similar_text() as documented.

2001-09-06 Thread Peter Hutnick

http://www.php.net/manual/en/function.similar-text.php states that the third
argument should be a reference.  PHP 4.0.6 complains "Warning: Call-time
pass-by-reference has been deprecated - argument passed by value;" etc.

But that percentage (double) is only available this way . . .

Where am I going wrong?

I hate doing this, but I can't cope with another mailing list right now.
Please CC: me.

Thanks,
Peter




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] HTML mail

2001-09-06 Thread Alex Shi

Hi Sid,

Following link is an article about sending MIME email in php:
http://www.phpbuilder.com/columns/kartic2807.php3

But I think it is too complicated for me to read:((.  I suggest you
can try following instead:


$email_address="[EMAIL PROTECTED]";
$subject="anything you can do";
$email_contents="HTML test: write your HTML tags here";
$tips="Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 7bit";
mail($email_address,$subject,$email_contnets,$tips);


here $tips is the key for html mail.

Hope this can help.

Alex

- Original Message -
From: "Sid" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 06, 2000 11:32 AM
Subject: [PHP] HTML mail


> hi,
> How would you send HTML mail using the mail() function in PHP.
> SID
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] HTML mail

2001-09-06 Thread Jason Murray

> How would you send HTML mail using the mail() function in PHP.

You need to use a MIME email - HTML goes as text/html, and
graphics go as file attachments.

Simple way to produce a MIME email:

http://planetkiller.shadow.net.au/mime-php.txt

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] what will be the output for this pgm?

2001-09-06 Thread Sid

Of course there will not be any output. That's because when you type in the 
directly type the url in the browser there will not be any referer. Try 
putting a link from another domain to that page and you will get some 
output then / try visiting the page through a search engine. i.e make the 
page come up in you search results and then click on it and when you visit 
the page it will show you the domain of the search engine.

Hope this helps

At 02:05 AM 9/5/01 +0530, you wrote:
>Hi friend,
>what will be the output for the following program?
>
> >>
>
>  $foo=$HTTP_SERVER_VARS["HTTP_REFERER"];
>
>  echo $foo;
>
>?>
>
> >>>
>
>For me it is printing the blank value.
>
>Thanks in advance
>
>Regards
>-Balaji
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Wierd for thingy, help!

2001-09-06 Thread Sid

Of cource you can. In the second page just ask PHP to echo the variable in 
the space where the text box accepts preset values some thing like this

" size="30">

where $variable is a variable that is sent from the previous page.

Hope this helps


At 11:38 AM 9/4/01 -0700, you wrote:
>Ok sorry for not looking into this one but is it possible for 1 page to 
>have a variable (not input) and then post it to another page and in an 
>input variable (text box) it will have the variable from the first page as 
>its value. not im confused!
>
>
>-lk6-
>http://www.StupeedStudios.f2s.com
>Home of the burning lego man!
>
>ICQ: 115852509
>MSN: [EMAIL PROTECTED]
>AIM: legokiller666


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] HTML mail

2001-09-06 Thread Sid

hi,
How would you send HTML mail using the mail() function in PHP.
SID 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Netscape & Cookies

2001-09-06 Thread Jochen Kaechelin

>
SetCookie("bilderanzeige",$bilderanzeige,time()+3600*24*30,"/","",0);
> > Works fine in IE and Opera!
> > Could anyone help, please!
>
> What's in $bilderanzeige?


$bilderanzeige = "ja" or
$bilderanzeige = "nein"

Jochen


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Netscape & Cookies

2001-09-06 Thread Jason Murray

> SetCookie("bilderanzeige",$bilderanzeige,time()+3600*24*30,"/","",0);
> 
> Works fine in IE and Opera!
> Could anyone help, please!

What's in $bilderanzeige?

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
"Work now, freak later!"

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Table Search

2001-09-06 Thread Chrisy

[EMAIL PROTECTED] (David Robley) typed on Fri, 7 Sep
2001 10:16:57 +0930, :

|On Fri,  7 Sep 2001 10:11, Devon wrote:
|> Below is an example of my code which searches a table and prints the
|> result, the problem is that it only displays the TechContact where I
|> want it to display all the fields that associated with it in that row
|> off the colum eg. Mobile, AdminContact etc etc  Any suggestions?
|>
|> if ($TechContact == "")
|> {$TechContact = '%';}
|> $result = mysql_query ("SELECT * FROM enet
|>  WHERE TechContact LIKE '$TechContact%'");
|> print $row["TechContact"];
|
|You would need to specify them in a print function, then.
|print $row["Mobile"];
|print $row["AdminContact"]; etc etc

Or count the columns in $row and print $row[0] to $row[count-1]. There
was a way of getting the correct field name

which someone else will provide hopefully.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Netscape & Cookies

2001-09-06 Thread Jochen Kaechelin

Netscape does not accept the following:

SetCookie("bilderanzeige",$bilderanzeige,time()+3600*24*30,"/","",0);

Works fine in IE and Opera!
Could anyone help, please!

Jochen



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] More info on BCC? (was Re: [PHP] Sending Broadcast Email - will a large loop cause a crash?)

2001-09-06 Thread elists

What's the reasoning behind that number? (330-)

I'm about to implement something similar, using BCC (since the emails 
don't need to be personalized). I've searched in the past for the 
answers to 2 questions, but haven't had any luck. Can you shed any light 
on the issue?

1. Is there a limit on the number of BCC recipients that can be 
included? (Is this where you got the 330 number?) If so, what is it, and 
if not, what is a reasonable number to include in a single email (1000, 
1, 10, etc)

2. Is it possible, using BCC from a mail() function in PHP, to 
accidentally reveal the list of recipients to anyone who receives the 
email?

Thanks,
Andrew Elliston


On Thursday, September 6, 2001, at 04:35 PM, Miles Thompson wrote:

>
> Well, try it - find a willing victim and just do a simple loop.
>
> Alternately, set up an account with a local, high-bandwidth ISP, batch 
> in groups of 330-, and use BCC.
>
> Miles
>
> At 04:16 PM 9/6/01 -0700, Fotwun wrote:
>> Hi,
>>
>> I need to send a broadcast email to our customers (about 3,000 
>> emails). The
>> data is being drawn for the DB, and will be personalized. Obviously, 
>> the
>> code to do this is only a few lines. However, I am concerned with the 
>> load
>> it will put on the system trying to loop through and mail() 3,000+ 
>> times.
>> Because of the overhead I anticipate this will cause the server, I am
>> planning to do it late in the evening.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: multi updates

2001-09-06 Thread Gary

Thanks Chris, it was the missing where statement.

Gary

Chris Lee wrote:

> where's the form, maybe the problem is there. your update query has no where
> statment, this isnt syntaxicaly incorrect, its just rare that you need to
> update every single element in the database to the same value. everything
> else looks ok, what exactly is the error/warning ? you dont accually need
> the $conn in mysql_query() and die() is just nasty, I like a little bit more
> friendly user errors. I also like to shorten things by putting the
> mysql_query in the if() statement
> 
> if ( !mysql_query($sql) )
> 
> --
> 
>   Chris Lee
>   [EMAIL PROTECTED]
> 
> 
> 
> "Gary" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 
>>I have a form that has name (unique in the table), team, pick, and
>>message. The below is updating all the rows with the same updates. where
>>have I screwed up?
>>
>>
>>
>>$sql = "UPDATE cappers SET team= \"$team\", pick = \"$pick\", message =
>>\"$message\"";
>>
>>//Get Results
>>$sql_result = mysql_query($sql, $conn) or die("Couldn't Query Database");
>>
>>if(!$sql_result) {
>>
>>TIA
>>Gary
>>
>>
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Table Search

2001-09-06 Thread David Robley

On Fri,  7 Sep 2001 10:11, Devon wrote:
> Below is an example of my code which searches a table and prints the
> result, the problem is that it only displays the TechContact where I
> want it to display all the fields that associated with it in that row
> off the colum eg. Mobile, AdminContact etc etc  Any suggestions?
>
> if ($TechContact == "")
> {$TechContact = '%';}
> $result = mysql_query ("SELECT * FROM enet
>  WHERE TechContact LIKE '$TechContact%'");
> print $row["TechContact"];

You would need to specify them in a print function, then.
print $row["Mobile"];
print $row["AdminContact"]; etc etc

-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   Famous last words - Don't worry, I can handle it.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] config options

2001-09-06 Thread Martín Marqués

On Jue 06 Sep 2001 21:39, David Robley wrote:
> On Fri,  7 Sep 2001 10:04, Martín Marqués wrote:
> > On Jue 06 Sep 2001 21:31, David Robley wrote:
> > > On Fri,  7 Sep 2001 09:56, Martín Marqués wrote:
> > > > I there a way to get the config options with which the php binary
> > > > (as a binary or as an apache module)?
> > > >
> > > > Saludos... :-)
> > >
> > > It is one of the things shown by phpinfo()
> >
> > Yes, I know. But it has a horrible output. If I want to use the same
> > options with a new version I can get stupid (I have done it in the
> > past) copying and pasting the options.
> > All I want is a copyable configure sentence.
> >
> > Thanks anyway.
> >
> > Saludos :-)
>
> Oh, OK. Look in the root of your php build directory for a file called
> config.nice - it will contain the configure string from your last build
>
> :-)

I also know about that. :-)

The problem is that I don't have the old compiled surce around, but thats OK. 
I'm already compiling PHP, after a long copy and paste.
There should be a shell script that gives the info about how php was 
configured. For example PostgreSQL has a script pg_config that gives some 
info, and on of the infos are the options used to compile PostgreSQL.

Thanks anyway!

Saludos... :-0

-- 
Porqué usar una base de datos relacional cualquiera,
si podés usar PostgreSQL?
-
Martín Marqués  |[EMAIL PROTECTED]
Programador, Administrador, DBA |   Centro de Telematica
   Universidad Nacional
del Litoral
-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Table Search

2001-09-06 Thread Devon

Below is an example of my code which searches a table and prints the result,
the problem is that it only displays the TechContact where I want it to
display all the fields that associated with it in that row off the colum eg.
Mobile, AdminContact etc etc  Any suggestions?

if ($TechContact == "")
{$TechContact = '%';}
$result = mysql_query ("SELECT * FROM enet
 WHERE TechContact LIKE '$TechContact%'");
print $row["TechContact"];





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] config options

2001-09-06 Thread David Robley

On Fri,  7 Sep 2001 10:04, Martín Marqués wrote:
> On Jue 06 Sep 2001 21:31, David Robley wrote:
> > On Fri,  7 Sep 2001 09:56, Martín Marqués wrote:
> > > I there a way to get the config options with which the php binary
> > > (as a binary or as an apache module)?
> > >
> > > Saludos... :-)
> >
> > It is one of the things shown by phpinfo()
>
> Yes, I know. But it has a horrible output. If I want to use the same
> options with a new version I can get stupid (I have done it in the
> past) copying and pasting the options.
> All I want is a copyable configure sentence.
>
> Thanks anyway.
>
> Saludos :-)

Oh, OK. Look in the root of your php build directory for a file called 
config.nice - it will contain the configure string from your last build 
:-)

-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   A Shower is the halfway point between Bed and World.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Releasing Your Code

2001-09-06 Thread Chris Lee

www.mediawaveonline.com/examples/

bsd licence, im not to picky, as the url sujests their examples, do what you
wish with them, give me credit if you eel its worth it, if you feel not
worth it, dont give me credit, I dont care.

comments? some have comments, you can figure it out, the code is free, the
documentation is not.

I like classes

I didnt clean any hack jobs up, their still in there, if you want to clean
them up, please email me the cleaned up version so I dont have todo it.

good feedback, the code is free, dont complain when it free, if I was
charging then complain, else if you dont like it, write your own.

my examples are allways updated, they're just symbloic links to the accual
files I use.

because its code src, not bin, you can change it however you want, have fun,
people shouldnt be so anal about their code or others code.

--

  Chris Lee
  [EMAIL PROTECTED]



"James" <[EMAIL PROTECTED]> wrote in message
02d801c13719$caae1180$[EMAIL PROTECTED]">news:02d801c13719$caae1180$[EMAIL PROTECTED]...
> Multiple part question to all:
>
> 1) Have you released full or partial code to any of your projects?
>
> 2) What kind of program was it (web mail, groupware, bulletin board,
website
> template etc)?
>
> 3) Why did you (not) release it?
>
> 4) What kind of license did you use?  GPL?  LGPL?  BSD?  Your own mini
one?
> No license?
>
> 5) Code Questions:
> a) What did you do before release?  What kind of quality checks did you do
> to the PHP code?
>
> b) What about commenting?
>
> c) Code grouping and logic? (Like grouping like functions and classes
> together)
>
> d) What about any hack jobs you did?  Did you clean them up totally or
just
> polish them a little or just release as is?  Thats probably the only good
> thing about closed source development, you could write a love letter to
your
> SO or an essay on the Thirty Years War in relation to the fall of the Holy
> Roman Empire and noone would know
>
> 6) What kind of feedback have you gotten?  Good (People
applauding/thanking
> you)?  Bad (People calling you a jerk and hoping your first born falls in
a
> well and they make a horrible TV movie about it?)?  All just complaints
> about the quality of it?  Good suggestions (I think it would be better if
> here you...)?  Any wild suggestions (I think your web mail application
> should also do taxes for each employee, in addition to doing our internal
> message board)?
>
> 7) What kind of input do you accept from the user?  Code
replacement/feature
> additions?
>
> 8) Do you still do your own updates to it or is it "abandonware"?
>
> a) What kind of updates?  Security fixes?  Bug fixes?  Minor feature
> upgrades?  Major feature upgrades?  Complete overhauls?
>
> 9) How customized is your PHP app to the end user?
> Is it stuck saying "THIS WAS DONE BY JOHN SMITH, CODER AND LEAD DIRECTOR"
> all over?  Can they insert their own name to make it more customizable and
> look like their own?  Is it just a library backend?
>
> 10) What is the setup of the PHP app like?
> Is it like "Okay, untar it and there it is" or "Okay, untar it, edit the
> config file and you are done" or "Untar it and do our little web based
> configurator to finish" or "Untar it, recompile your kernel, recompile
> Apache, PHP and MySQL, sell your immortal soul to your neighbor for $1.50
> and walk on your hands for 2 weeks"?
>
> 11) MySQL Question:  When having people install your PHP app and it needs
> its own MySQL database with custom table structure, what is the best
> instructions to tell idiots how to do it?
>
> - k
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] config options

2001-09-06 Thread Martín Marqués

On Jue 06 Sep 2001 21:31, David Robley wrote:
> On Fri,  7 Sep 2001 09:56, Martín Marqués wrote:
> > I there a way to get the config options with which the php binary (as a
> > binary or as an apache module)?
> >
> > Saludos... :-)
>
> It is one of the things shown by phpinfo()

Yes, I know. But it has a horrible output. If I want to use the same options 
with a new version I can get stupid (I have done it in the past) copying 
and pasting the options.
All I want is a copyable configure sentence.

Thanks anyway.

Saludos :-)

-- 
Porqué usar una base de datos relacional cualquiera,
si podés usar PostgreSQL?
-
Martín Marqués  |[EMAIL PROTECTED]
Programador, Administrador, DBA |   Centro de Telematica
   Universidad Nacional
del Litoral
-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] config options

2001-09-06 Thread David Robley

On Fri,  7 Sep 2001 09:56, Martín Marqués wrote:
> I there a way to get the config options with which the php binary (as a
> binary or as an apache module)?
>
> Saludos... :-)

It is one of the things shown by phpinfo()

-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   Writer's Rule #2: About those sentence fragments.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: this newsgroup via newsgroup program?

2001-09-06 Thread Chris Lee

I use Outlook Express and Im posting this via news.php.net into php.general

--

  Chris Lee
  [EMAIL PROTECTED]


"Chris Hayes" <[EMAIL PROTECTED]> wrote in message
3B981E0F.25754.4210CA@localhost">news:3B981E0F.25754.4210CA@localhost...
> hi,
> from http://www.php.net/support.php i get the
> impression that i can subscribe to this group via
> news.php.net. Indeed i can collect a zillion
> newsgroups via that server but i cannot find
> php.general. Neither on news.xs4all.nl.
> I am using 'Agent'.
> Chris
>
> ---
> -
> --  C.Hayes  Droevendaal 35  6708 PB Wageningen
> the Netherlands  --
> ---
> -
>
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: multi updates

2001-09-06 Thread Chris Lee

where's the form, maybe the problem is there. your update query has no where
statment, this isnt syntaxicaly incorrect, its just rare that you need to
update every single element in the database to the same value. everything
else looks ok, what exactly is the error/warning ? you dont accually need
the $conn in mysql_query() and die() is just nasty, I like a little bit more
friendly user errors. I also like to shorten things by putting the
mysql_query in the if() statement

if ( !mysql_query($sql) )

--

  Chris Lee
  [EMAIL PROTECTED]



"Gary" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have a form that has name (unique in the table), team, pick, and
> message. The below is updating all the rows with the same updates. where
> have I screwed up?
>
>
>
> $sql = "UPDATE cappers SET team= \"$team\", pick = \"$pick\", message =
> \"$message\"";
>
> //Get Results
> $sql_result = mysql_query($sql, $conn) or die("Couldn't Query Database");
>
> if(!$sql_result) {
>
> TIA
> Gary
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Module/PHP conflict

2001-09-06 Thread Michael Cronström

php_dbg.dll, required for PHPEd as well as DBG debugger, works fine on 
Windows 98SE, PWS and PHP 4.04.
However, when I upgrade to PHP 4.0.6 (CGI binary) and change server to 
Apache/1.3.20 (Win32) I get the following error

'Content-type: text/html
PHP Warning: dbg: Unable to initialize module
Module compiled with debug=0, thread-safety=1 module API=20001214
PHP compiled with debug=0, thread-safety=1 module API=20001222
These options need to match in Unknown on line 0'

What do I do to fix it?

Michael Cronström
[EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Sending Broadcast Email - will a large loop cause a crash?

2001-09-06 Thread Kath

Whats your time frame for deployment of the email?

You might want to stagnate it out... like loop through 100, pause for 10
secs, do the next 100, pause, repeat.  Maybe longer if you could.

You could always have it record the number, stop it and adjust higher/lower
as required.

Also, make sure that you are able to tell what emails are kicked back and
logged as not being received (User not found, other kind of error in
sending).

Please let us know what happens, it would be excellent reference.

- k

- Original Message -
From: "Fotwun" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 06, 2001 7:16 PM
Subject: [PHP] Sending Broadcast Email - will a large loop cause a crash?


> Hi,
>
> I need to send a broadcast email to our customers (about 3,000 emails).
The
> data is being drawn for the DB, and will be personalized. Obviously, the
> code to do this is only a few lines. However, I am concerned with the load
> it will put on the system trying to loop through and mail() 3,000+ times.
> Because of the overhead I anticipate this will cause the server, I am
> planning to do it late in the evening.
>
> My concern is this... will such a loop calling mail() cause PHP/Apache/the
> box/etc to crash under normal circumstances? We have a pretty beefy box, I
> just have never tried broadcasting through PHP. Also, if there is any
> reasonable chance for such a failure, is it possible to put timed pauses
in,
> say half a second or so before it continues the loop. I've never heard of
> inserting pauses into the execution of PHP code, not sure if its possible.
> If it were, I would think this could combat some of the load, and prevent
> the bottleneck from building backlog until failure.
>
> Who knows, maybe this type of routine won't even make my box flinch
(P3-833,
> FreeBSD, 256 megs), that's why I'm asking ahead of time. I'd hate to see a
> crash, mainly because I'll have no idea where it left off, and will end up
> sending 2 or more emails to some people if I have to run it more than
once.
>
> Thanks.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Sending Broadcast Email - will a large loop cause a crash?

2001-09-06 Thread Mark Charette

From: "Miles Thompson" <[EMAIL PROTECTED]>
>
> Well, try it - find a willing victim and just do a simple loop.
>
> Alternately, set up an account with a local, high-bandwidth ISP, batch in
> groups of 330-, and use BCC.
>
> Miles
>
> At 04:16 PM 9/6/01 -0700, Fotwun wrote:
> >Hi,
> >
> >I need to send a broadcast email to our customers (about 3,000 emails).
The
> >data is being drawn for the DB, and will be personalized. Obviously, the
> >code to do this is only a few lines. However, I am concerned with the
load
> >it will put on the system trying to loop through and mail() 3,000+ times.

Or load and install qmail. Set the number of outgoing queues to a reasoable
number (maybe 50 or so) and let loose. You'll never have more than "queue"
connections simultaneously. Keeps the load reasonable.
Mark C.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Sending Broadcast Email - will a large loop cause a crash?

2001-09-06 Thread Opec Kemp

Hi,
You'd be better off running this process from a command line, i.e. not
through your Web Browser as I'm more than certain that it will timeout if
you are to send 3000+ emails in a loop :). And then you'll have to start
again , and I'm sure your client won't be so happy if they were to get
multiple copies of the same emails even if they've asked for it:)

You can still write the program in PHP to run from the command line. There
are only a couple of changes that you have to make (if you have complied PHP
to be both stand alone and Web plugin) to enable this.

Also if you were to do this, I wouldn't use mail() function. What I'd do is
run sendmail from the command line (with switches) to basically, get
sendmail to handle *all* deliveries. The beauty of this is that with certain
switch you use from the command line you run sendmail in *batch* mode i.e.
it won't try to send the email straight away but put them into the queue.

The advantage of this is that you can crunch through the list much quicker.
And even if your server crash the emails would already be in the queue so
you won't have to redo it :).

Just a few pointers :) HTH.

> Hi,
>
> I need to send a broadcast email to our customers (about 3,000
> emails). The
> data is being drawn for the DB, and will be personalized. Obviously, the
> code to do this is only a few lines. However, I am concerned with the load
> it will put on the system trying to loop through and mail() 3,000+ times.
> Because of the overhead I anticipate this will cause the server, I am
> planning to do it late in the evening.
>
> My concern is this... will such a loop calling mail() cause PHP/Apache/the
> box/etc to crash under normal circumstances? We have a pretty beefy box, I
> just have never tried broadcasting through PHP. Also, if there is any
> reasonable chance for such a failure, is it possible to put timed
> pauses in,
> say half a second or so before it continues the loop. I've never heard of
> inserting pauses into the execution of PHP code, not sure if its possible.
> If it were, I would think this could combat some of the load, and prevent
> the bottleneck from building backlog until failure.
>
> Who knows, maybe this type of routine won't even make my box
> flinch (P3-833,
> FreeBSD, 256 megs), that's why I'm asking ahead of time. I'd hate to see a
> crash, mainly because I'll have no idea where it left off, and will end up
> sending 2 or more emails to some people if I have to run it more
> than once.
>
> Thanks.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Sending Broadcast Email - will a large loop cause a crash?

2001-09-06 Thread Miles Thompson


Well, try it - find a willing victim and just do a simple loop.

Alternately, set up an account with a local, high-bandwidth ISP, batch in 
groups of 330-, and use BCC.

Miles

At 04:16 PM 9/6/01 -0700, Fotwun wrote:
>Hi,
>
>I need to send a broadcast email to our customers (about 3,000 emails). The
>data is being drawn for the DB, and will be personalized. Obviously, the
>code to do this is only a few lines. However, I am concerned with the load
>it will put on the system trying to loop through and mail() 3,000+ times.
>Because of the overhead I anticipate this will cause the server, I am
>planning to do it late in the evening.
>
>My concern is this... will such a loop calling mail() cause PHP/Apache/the
>box/etc to crash under normal circumstances? We have a pretty beefy box, I
>just have never tried broadcasting through PHP. Also, if there is any
>reasonable chance for such a failure, is it possible to put timed pauses in,
>say half a second or so before it continues the loop. I've never heard of
>inserting pauses into the execution of PHP code, not sure if its possible.
>If it were, I would think this could combat some of the load, and prevent
>the bottleneck from building backlog until failure.
>
>Who knows, maybe this type of routine won't even make my box flinch (P3-833,
>FreeBSD, 256 megs), that's why I'm asking ahead of time. I'd hate to see a
>crash, mainly because I'll have no idea where it left off, and will end up
>sending 2 or more emails to some people if I have to run it more than once.
>
>Thanks.
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: this newsgroup via newsgroup program?

2001-09-06 Thread CC Zona

In article <3B981E0F.25754.4210CA@localhost>,
 [EMAIL PROTECTED] (Chris Hayes) wrote:

> from http://www.php.net/support.php i get the 
> impression that i can subscribe to this group via 
> news.php.net. Indeed i can collect a zillion 
> newsgroups via that server

Then you're not looking at the news.php.net server after all, because it 
has only 29 newsgroups by my count.  Double-check your settings.

> but i cannot find php.general. Neither on news.xs4all.nl. I am using 
> 'Agent'.

-- 
CC

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Sending Broadcast Email - will a large loop cause a crash?

2001-09-06 Thread Fotwun

Hi,

I need to send a broadcast email to our customers (about 3,000 emails). The
data is being drawn for the DB, and will be personalized. Obviously, the
code to do this is only a few lines. However, I am concerned with the load
it will put on the system trying to loop through and mail() 3,000+ times.
Because of the overhead I anticipate this will cause the server, I am
planning to do it late in the evening.

My concern is this... will such a loop calling mail() cause PHP/Apache/the
box/etc to crash under normal circumstances? We have a pretty beefy box, I
just have never tried broadcasting through PHP. Also, if there is any
reasonable chance for such a failure, is it possible to put timed pauses in,
say half a second or so before it continues the loop. I've never heard of
inserting pauses into the execution of PHP code, not sure if its possible.
If it were, I would think this could combat some of the load, and prevent
the bottleneck from building backlog until failure.

Who knows, maybe this type of routine won't even make my box flinch (P3-833,
FreeBSD, 256 megs), that's why I'm asking ahead of time. I'd hate to see a
crash, mainly because I'll have no idea where it left off, and will end up
sending 2 or more emails to some people if I have to run it more than once.

Thanks.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Tracking shipments UPS, FEDEX, etc...

2001-09-06 Thread Dennis Moore

I am not clear in what you want to do.  I think the simplest solution is to
build a table in your favorite database with the tracking number and the
vendor.  Make another table or switch statement that points to the URL for
the vendors tracking mechanism.   Now you can just write a function  that
links to the vendoes tracking mechanism passing along the tracking number to
their form.   I am not sure if this is legal or they allow permission to do
this on their site.

Otherwise you need to get their data via XML and write whole set of
functions and what not to do something that already exists.  This is not
trivial.

/dkm


- Original Message -
From: "Joe Sheble (Wizaerd)" <[EMAIL PROTECTED]>
To: "General PHP List" <[EMAIL PROTECTED]>
Sent: Thursday, September 06, 2001 1:47 AM
Subject: [PHP] Tracking shipments UPS, FEDEX, etc...


> has anybody written any routines or functions they'd care to share for
> parsing the tracking information out of UPS, FEDEX, or other shipping
> carriers tracking pages?
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] independent PHP4 on shared Apache?

2001-09-06 Thread Chris Hayes

hi,
we have an account with an ISP which is not 
extremely up to date (PHP3) but we are allowed to 
install MySQL. Ourselves. (But not on the default 
space, which is a disaster. Luckily there is a very 
experienced man, he even used to work for that ISP 
doing this for us. :-) Still took him 40 hours)

Now i was thinking, it is much easier to install 
PHP4 (i sincerley hope) on a non default location. 

BUT how can we tell Apache to only for _our_ 
account use that PHP4? 

This is how it is set up:
 FreeBSD 4.0.1, Apache, 
 internet dir at usr/local/WWW/www.ourdomain.org/
 mysql at usr/o/ourdomain/mysql
 php can be there too like /usr/o/ourdomain.org
   i suppose as a CGI.

Chris

cheers,
Chris
 



---
-
--  C.Hayes  Droevendaal 35  6708 PB Wageningen  
the Netherlands  --
---
-

 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Looking for PHP programmer in San Diego Area

2001-09-06 Thread Brandon Orther

Hello,
 
I am currently working on a full fledge PHP project for my current
company.  We are looking for 1 to 2 more PHP programmers to finish up
this project for the next several months.  If you would like more
information please respond to my e-mail address and not the User Group
Thank you,


Brandon Orther
WebIntellects Design/Development Manager
[EMAIL PROTECTED]
800-994-6364
www.webintellects.com
  
 



[PHP] this newsgroup via newsgroup program?

2001-09-06 Thread Chris Hayes

hi, 
from http://www.php.net/support.php i get the 
impression that i can subscribe to this group via 
news.php.net. Indeed i can collect a zillion 
newsgroups via that server but i cannot find 
php.general. Neither on news.xs4all.nl.
I am using 'Agent'.
Chris

---
-
--  C.Hayes  Droevendaal 35  6708 PB Wageningen  
the Netherlands  --
---
-

 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] multi updates

2001-09-06 Thread Gary

I have a form that has name (unique in the table), team, pick, and 
message. The below is updating all the rows with the same updates. where 
have I screwed up?



$sql = "UPDATE cappers SET team= \"$team\", pick = \"$pick\", message = 
\"$message\"";

//Get Results
$sql_result = mysql_query($sql, $conn) or die("Couldn't Query Database");

if(!$sql_result) {

TIA
Gary


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Releasing Your Code

2001-09-06 Thread Alexander Deruwe

On Thursday 06 September 2001 21:20, James wrote:
> Multiple part question to all:

I would like to add a 12th question to this:

12) Is it useful to release source for a business application, specifically 
target to one line of work? Are there any considerations beside the obvious 
(what license, ...)?

ad

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] The future of PHP - PHP Pattern Repository

2001-09-06 Thread Geoff Caplan

Miles

>
> Fascinating link and series of articles. Well worth reading.
>
> One of my VFP buddies copies his entire set of classes into every new
> project he starts; I've also seen scenarios where to use one or two useful
> functions you had to import a whole class structure.
>

Yes, I think he raises some very fair issues. My own experience goes like
this -

1) Had a business idea and couldn't afford the software, so decided to learn
how to build it myself.

2) Read "Code Complete" and did the first draft

3) Found I was getting drowned in complexity:  assumed OOP would be the
answer and that I might have to abandon PHP.

4) Read the OOP classics. I have a pretty strong academic background but I
find a lot of the OOP stuff extremely difficult to understand. I have a rule
of thumb that if an author can't explain something clearly, it is often
because they are not clear about it themselves. Began to wonder if the OOP
emperor had no clothes.

5) Began to suspect that it is the architectural ideas of OOP that are
interesting, rather than objects themselves.

6) Played around with PHP and discovered I could do most of the same things
more simply and more flexibly, organising the app around tasks rather than
objects.

7) Found some writers such as Michael Jackson (his recent book on analysis
is a classic) who gave a theoretical justification for what I was
intuitively doing in practice.

This is where I think a PHP Pattern Repository would come in - to allow the
community to begin to flesh out and document these non-OOP approaches. But
as there has been a thunderous silence, I have to assume that no one else
agrees...

Geoff Caplan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Releasing Your Code

2001-09-06 Thread James

Multiple part question to all:

1) Have you released full or partial code to any of your projects?

2) What kind of program was it (web mail, groupware, bulletin board, website
template etc)?

3) Why did you (not) release it?

4) What kind of license did you use?  GPL?  LGPL?  BSD?  Your own mini one?
No license?

5) Code Questions:
a) What did you do before release?  What kind of quality checks did you do
to the PHP code?

b) What about commenting?

c) Code grouping and logic? (Like grouping like functions and classes
together)

d) What about any hack jobs you did?  Did you clean them up totally or just
polish them a little or just release as is?  Thats probably the only good
thing about closed source development, you could write a love letter to your
SO or an essay on the Thirty Years War in relation to the fall of the Holy
Roman Empire and noone would know

6) What kind of feedback have you gotten?  Good (People applauding/thanking
you)?  Bad (People calling you a jerk and hoping your first born falls in a
well and they make a horrible TV movie about it?)?  All just complaints
about the quality of it?  Good suggestions (I think it would be better if
here you...)?  Any wild suggestions (I think your web mail application
should also do taxes for each employee, in addition to doing our internal
message board)?

7) What kind of input do you accept from the user?  Code replacement/feature
additions?

8) Do you still do your own updates to it or is it "abandonware"?

a) What kind of updates?  Security fixes?  Bug fixes?  Minor feature
upgrades?  Major feature upgrades?  Complete overhauls?

9) How customized is your PHP app to the end user?
Is it stuck saying "THIS WAS DONE BY JOHN SMITH, CODER AND LEAD DIRECTOR"
all over?  Can they insert their own name to make it more customizable and
look like their own?  Is it just a library backend?

10) What is the setup of the PHP app like?
Is it like "Okay, untar it and there it is" or "Okay, untar it, edit the
config file and you are done" or "Untar it and do our little web based
configurator to finish" or "Untar it, recompile your kernel, recompile
Apache, PHP and MySQL, sell your immortal soul to your neighbor for $1.50
and walk on your hands for 2 weeks"?

11) MySQL Question:  When having people install your PHP app and it needs
its own MySQL database with custom table structure, what is the best
instructions to tell idiots how to do it?

- k


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] how to use fileatime() if the file name contains empty char?

2001-09-06 Thread Zhu George-CZZ010

Hi,

   Does anyone know how to use fileatime() when the file name contains empty char 
inside?

Thank you very much in advance.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] mysql timestamp field

2001-09-06 Thread CC Zona

In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Jason Stechschulte) wrote:

> > I need an update on my table. but I have a timestamp field called
> > t_stamp. When I update a field other than t_stamp field, t_stamp field
> > also updates to now(). I need it not to update and saves its value.
> > 
> > How should I do this?
> 
> The easiest way is to change the column type.  Timestamp always updates
> itself whenever the row is updated. 

To be more precise: the *first* timestamp field in a table always updates 
itself whenever the row is updated.

>  You could simply change the column
> type to datetime.

Yep.  Or add another timestamp column before t_stamp.  But unless you have 
use for this auto-updating value (and it doesn't sound like you do), the 
first suggestion is the better one.

-- 
CC

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] output using ClibPDF is blank - RESENT in ASCII

2001-09-06 Thread Don

Hi,

I am evaluating ClibPDF and have written a sample rpogram to output some text and a 
couple of lines to a letter size page. However,
the when the PDF loads onto the screen, it is blank.  Can anyone tell me what went 
wrong?  The code is below. Am running Apache
Server on RedHat Linux 6.2

Thanks,
Don

Code
--
  $pdf = cpdf_open(0);
  cpdf_set_creator($pdf, "bl_print.php");
  cpdf_set_title($pdf, "Proof B/L");

  cpdf_page_init($pdf, 1, 0, 612, 792);

  cpdf_begin_text($pdf);
  cpdf_set_font($pdf, "Times-Roman", 30, "WinAnsiEncoding");
  cpdf_set_text_rendering($pdf, 1);
  cpdf_text($pdf, "Times Roman outlined", 50, 700);
  cpdf_end_text($pdf);

  cpdf_moveto($pdf, 55, 757);
  cpdf_lineto($pdf, 585, 757);
  cpdf_moveto($pdf, 55, 754);
  cpdf_lineto($pdf, 585, 754);

  cpdf_finalize_page ($pdf, 1);

  cpdf_finalize($pdf);
  Header("Content-type: application/pdf");
  cpdf_output_buffer($pdf);
  cpdf_close($pdf);


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Line number of error

2001-09-06 Thread Jonathan Hilgeman

Nevermind - found the answer. The current line number is held in the
constant __LINE__ and the current file name is held in the constant __FILE__

So I can do the following:
print "this is line " . __LINE__ . " in the file " . __FILE__;

- Jonathan

"Jonathan Hilgeman" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Is there any way to print the current line number? i.e.
>
> 43  print "blah";
> 44  print "this is line $LineNumber";
> 45  print "etc";
>
> and have it result in :
> blahthis is line 44etc
>
> ?
>
> - Jonathan
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] output using ClibPDF is blank

2001-09-06 Thread Don

Hi,

I am evaluating ClibPDF and have written a sample rpogram to output some text and a 
couple of lines to a letter size page. However, the when the PDF loads onto the 
screen, it is blank.  Can anyone tell me what went wrong?  The code is below. Am 
running Apache Server on RedHat Linux 6.2

Thanks,
Don

Code
--
  $pdf = cpdf_open(0);
  cpdf_set_creator($pdf, "bl_print.php");
  cpdf_set_title($pdf, "Proof B/L");
  
  cpdf_page_init($pdf, 1, 0, 612, 792);

  cpdf_begin_text($pdf);
  cpdf_set_font($pdf, "Times-Roman", 30, "WinAnsiEncoding");
  cpdf_set_text_rendering($pdf, 1);
  cpdf_text($pdf, "Times Roman outlined", 50, 700);
  cpdf_end_text($pdf);

  cpdf_moveto($pdf, 55, 757);
  cpdf_lineto($pdf, 585, 757);
  cpdf_moveto($pdf, 55, 754);
  cpdf_lineto($pdf, 585, 754);

  cpdf_finalize_page ($pdf, 1);
  
  cpdf_finalize($pdf);
  Header("Content-type: application/pdf");
  cpdf_output_buffer($pdf);
  cpdf_close($pdf);




[PHP] Regular Expressions - A relatively simple search...

2001-09-06 Thread Mike Gifford

Hello,

I'm trying to replace a couple of lines of code:

$dotpos = 1 - (strlen($userfile_name) - strpos($userfile_name, '.'));
$extension = substr($userfile_name, $dotpos);

with a simpler regular expression:
$extension = eregi_replace( "/.*", "", $userfile_name);

However it isn't working..

What I'd like to do is to find the extension of a file name and place that in a 
variable.  So in 
'/home/mike/test.txt', I want to have the statement return 'txt'

Any help would be appreciated..

Mike
-- 
Mike Gifford, OpenConcept Consulting, http://openconcept.ca
Offering everything your organization needs for an effective web site.
Abolish Nuclear Weapons Now!: http://pgs.ca/petition/
It is a miracle that curiosity survives formal education. - A Einstein


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Best Methods for Storing Checkbox Information in a MySQL Database

2001-09-06 Thread Kath

I have some checkboxes on a form.

Now I figured out how to store them in a database sandwiched together (like
thing1,thing2,thing3,thing4).

However, what is the best method for storing them each in an individual
field.

This is what I'd really like:

| userid | otherthing |
|1 |azu   |
|1 |cde   |
|1 |foo|
|2 |bar|

Would it be something like:

Count the number of things, then do

for($x = 0, $x <= $numberofthings; $x++) {

$sql = "INSERT INTO table (userid, otherthing) VALUES ('$userid',
'$things[$x]')";

$result = mysql_query($sql);

if (!$result) { blaherrorchecking(); }

}

What do you all think of that?  Is it a good solution?  Lousy?  A hack job?
Is there a better way?

- k


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Tracking shipments UPS, FEDEX, etc...

2001-09-06 Thread MailingLists


I don't want the rate, I have that through a 3rd party shipping engine... 
it's the tracking info I need...  unfortunately not just for UPS... FedEx, 
DHL, Airborne, etc...At 03:09 PM 9/6/2001 -0500, Christopher CM Allen wrote:

> > >
> > >
> > > has anybody written any routines or functions they'd care to share for
> > > parsing the tracking information out of UPS, FEDEX, or other shipping
> > > carriers tracking pages?
> > >
>
>/*
>Begin FEDX GROUND
>*/
> $fp = fopen
>("http://grd.fedex.com/cgi-bin/rrr2010.exefunc=Rate&Screen=Ground&;
>OriginZip=$orig_zip&OriginCountryCode=US&DestZip=$new_zip&DestCountryCode=US
>&Weight=$w_total", "r");
> if(!$fp)
> {
> echo "Didnt open  $errstr
>($errno)\n";
> }
> else
> {
> fputs($fp,"GET / HTTP/1.0\n\n");
>
> while(!feof($fp))
> {
>
>$buffer=fgets($fp,100);
> if ( ereg
>  "^(<\!TotalCharges>)([0-9]{1,4})(\.)([0-9]{1,})", $buffer, $regs))
> {
>
> $fee
>.=$regs[2];
> $fee
>.=$regs[3];
> $fee
>.=$regs[4];
> }
> echo
>"The Shipping Fee is $fee";
>
>}
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Tracking shipments UPS, FEDEX, etc...

2001-09-06 Thread Data Driven Design

The ups tools are quite complicated. You have to open a pipe and the send
and retrieve xml documents. Not for the weak of heart.

Data Driven Design
1506 Tuscaloosa Ave
Holly Hill, Florida 32117

http://www.datadrivendesign.com
Phone: (386) 226-8979

Websites That WORK For You
- Original Message -
From: "Brian V Bonini" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "Joe Sheble (Wizaerd)"
<[EMAIL PROTECTED]>; "General PHP List"
<[EMAIL PROTECTED]>
Sent: Thursday, September 06, 2001 4:05 PM
Subject: RE: [PHP] Tracking shipments UPS, FEDEX, etc...


> Doesn't UPS provide tools to do this? Not necessarily
> using PHP but I thought 
>
> > -Original Message-
> > From: Dan Harrington [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, September 06, 2001 3:45 PM
> > To: Joe Sheble (Wizaerd); General PHP List
> > Subject: RE: [PHP] Tracking shipments UPS, FEDEX, etc...
> >
> >
> > No kidding :-)
> >
> > or calculating shipping costs.
> >
> >
> > > -Original Message-
> > > From: Joe Sheble (Wizaerd) [mailto:[EMAIL PROTECTED]]
> > > Sent: Wednesday, September 05, 2001 11:47 PM
> > > To: General PHP List
> > > Subject: [PHP] Tracking shipments UPS, FEDEX, etc...
> > >
> > >
> > > has anybody written any routines or functions they'd care to share for
> > > parsing the tracking information out of UPS, FEDEX, or other shipping
> > > carriers tracking pages?
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> > >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Tracking shipments UPS, FEDEX, etc...

2001-09-06 Thread Christopher CM Allen


> >
> >
> > has anybody written any routines or functions they'd care to share for
> > parsing the tracking information out of UPS, FEDEX, or other shipping
> > carriers tracking pages?
> >

/*
Begin FEDX GROUND
*/
$fp = fopen
("http://grd.fedex.com/cgi-bin/rrr2010.exefunc=Rate&Screen=Ground&;
OriginZip=$orig_zip&OriginCountryCode=US&DestZip=$new_zip&DestCountryCode=US
&Weight=$w_total", "r");
if(!$fp)
{
echo "Didnt open  $errstr
($errno)\n";
}
else
{
fputs($fp,"GET / HTTP/1.0\n\n");

while(!feof($fp))
{

$buffer=fgets($fp,100);
if ( ereg
 "^(<\!TotalCharges>)([0-9]{1,4})(\.)([0-9]{1,})", $buffer, $regs))
{

$fee
.=$regs[2];
$fee
.=$regs[3];
$fee
.=$regs[4];
}
echo
"The Shipping Fee is $fee";

   }



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Tracking shipments UPS, FEDEX, etc...

2001-09-06 Thread Brian V Bonini

Doesn't UPS provide tools to do this? Not necessarily
using PHP but I thought 

> -Original Message-
> From: Dan Harrington [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 06, 2001 3:45 PM
> To: Joe Sheble (Wizaerd); General PHP List
> Subject: RE: [PHP] Tracking shipments UPS, FEDEX, etc...
>
>
> No kidding :-)
>
> or calculating shipping costs.
>
>
> > -Original Message-
> > From: Joe Sheble (Wizaerd) [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, September 05, 2001 11:47 PM
> > To: General PHP List
> > Subject: [PHP] Tracking shipments UPS, FEDEX, etc...
> >
> >
> > has anybody written any routines or functions they'd care to share for
> > parsing the tracking information out of UPS, FEDEX, or other shipping
> > carriers tracking pages?
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] nested loop confusion

2001-09-06 Thread Jerry Lake

Ok, I will try to explain myself as clearly as possible
please let me know if I need to be more so.

On my admin page I have a review form. there is a select
box that is self populating from a readir. that part works
fine. however I would like for the files to not show up if
they have been used in a prior review, the ones that have been
used are noted in the MySQL review database. here is the
code that I am trying to work with, if anyone has any ideas,
please let me know.


".$file."";
 }
}
}
 echo "";
closedir($handle);

?>


Jerry Lake
Interface Engineering Technician


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PDFLib to generate 2+ page with same content

2001-09-06 Thread Rasmus Lerdorf

> I have used the PDFLib to generate a pdf by myself. I would like to
> know how to make a page break and then draw second page which the
> content is exactly the first page.
> I need to repeat this step 9 times so I can use printer function to
> print 9-in-1 page.

Why not just put a loop around your code?

ie.



-Rasmus



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PDFLib to generate 2+ page with same content

2001-09-06 Thread Norman

Hi !

I have used the PDFLib to generate a pdf by myself. I would like to
know how to make a page break and then draw second page which the
content is exactly the first page.
I need to repeat this step 9 times so I can use printer function to
print 9-in-1 page.
Thank you very much !!

Regards,
Norman


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Tracking shipments UPS, FEDEX, etc...

2001-09-06 Thread Dan Harrington

No kidding :-)

or calculating shipping costs.


> -Original Message-
> From: Joe Sheble (Wizaerd) [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, September 05, 2001 11:47 PM
> To: General PHP List
> Subject: [PHP] Tracking shipments UPS, FEDEX, etc...
> 
> 
> has anybody written any routines or functions they'd care to share for
> parsing the tracking information out of UPS, FEDEX, or other shipping
> carriers tracking pages?
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Line number of error

2001-09-06 Thread Jonathan Hilgeman

Is there any way to print the current line number? i.e.

43  print "blah";
44  print "this is line $LineNumber";
45  print "etc";

and have it result in :
blahthis is line 44etc

?

- Jonathan



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] mysql_fetch_array

2001-09-06 Thread sagar

hi,
just go thru ur code once u'll getout with the bug.

$myrow<>mysql_fetch_Array($result2);

what is $myrow and to which value should the left part should
compare.

try this :


/sagar


- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 06, 2001 2:09 PM
Subject: [PHP] mysql_fetch_array


Can someone tell me what i'm doing wrong here?

mysql_fetch_array($result2))
 {
echo "Print some text here!";
 }
?>

Basically I just want to print text if the IP address was not found in the
database, and if it was found then I want to print "Print some text here!"

Please help!
Thanks,
Nate



_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Unresolved Mistery Error in PHP

2001-09-06 Thread Webmaster

Hi people:

I trying to run a script from my shell but I get this error:

[root@corotu docs]# ./phorummail
php: error in loading shared libraries: libmysqlclient.so.6: cannot open
shared
object file: No such file or directory

Well, some people said to me that usually this library is located in
/usr/local/lib/mysql, I search this file in source of MySQL but not
exists!!! only there are libmysqlclient.so.10, I made a sym-link from
libmysqlclient.so.10 to libmysqlclient.so.6 after copy to
/usr/local/lib/mysql and don't work  I received the same error.

The error occurs with any php script not only with Phorummail.

I am on the edge of insane, please somebody help me, I was working in this
for one week.

Regards,

Peter Brumvig


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] For the RegExps gurus!

2001-09-06 Thread ~~~i LeoNid ~~

On Wed, 5 Sep 2001 12:15:34 +0200 impersonator of [EMAIL PROTECTED] (*
R&Ze:) planted &I saw in php.general:

>This should do the job:
>
...
You can keep improving:) or you can use piece of my working (except for
$Harlem, to which i am not going:) code (I give it for free this time:) 

No /me, no ereg, no nothing - gentleMen:)-just /i (did you miss it, btw?:)


note1: your url shouldn't be broken in the middle by \n 
note2: you might see strange characters in patterns - its allowed by
standart - cyrilic. If you are sure to not need anything but latinic, take
others out.

$pref = "([a-z0-9~#%\&=\?/\._-]+?:([a-z0-9~#%\&=\?/\._-]+?@)?)?";
$port = "(:[\d]+)?";
$domain =
"([_0-9a-zÿâåðòûóèîïøùýúüþ¸àñäôã÷éêëìíáæöõç][_0-9a-zÿâåðòûóèîïøùýúüþ¸àñäôã÷éêëìíáæöõç-]+?[\.])+[a-z]{2,3}";
$subpat = $domain . $port .
"([/\\][a-zÿâåðòûóèîïøùýúüþ¸àñäôã÷éêëìíáæöõç0-9~#%@\&:\.=\?_-]*)*";
$patterns = array
("`(?<=[;\x20^<>{}+-=|\\&%^\^\$#!~:.,\(\)\"'\[])((f|ht)tps?|news)://" .
$pref . $subpat ."`i",
   "`(?<=[;\x20^<\(\)\"'\[])www[\.]" . $subpat . "`i",
   "`(?<=[;\x20^<\(\)\"'\[])[_\.0-9a-z-]+@" . $domain . "`i");
$links = array ("\\0",
   "http://\\0'>\\0",
   "\\0");

$Harlem=explode("\n",$mem);
foreach($Harlem as $line){
  $line = htmlspecialchars ( $line);
  $line = preg_replace ($patterns, $links, $line);
}
>-- 
>-- Renze Munnik
>-- DataLink BV
>--
>-- E: [EMAIL PROTECTED]
>-- W: +31 23 5326162
>-- F: +31 23 5322144
>-- M: +31 6 21811143
>--
>-- Stationsplein 82
>-- 2011 LM  HAARLEM
>-- Netherlands
>--
>-- http://www.datalink.nl
>-- 
--
i leonid http://nux.home.dk3.com/
no phone here, but for other personals - donation info. - visit i site^:)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Re: Mailing, which is faster

2001-09-06 Thread Matthew Loff


Doesn't PHP exec sendmail when mail() is called anyway?  (Unless you run
another MTA, of course)

I would think they'd take the same amount of time, unless there is
overhead with using popen()

--Matt


-Original Message-
From: Chris Lee [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, September 06, 2001 2:00 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Mailing, which is faster


benchamrking is a common question with a common answer, "try it
yourself", depending on your situation/hardware/software this will very
greatly from machine to machine.

--

  Chris Lee
  [EMAIL PROTECTED]


"Niklas lampén" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Which is faster (and/or smarter), using function mail() or doing it by

> popen("/blah/sendmail")?
>
>
> Niklas
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] To
contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP regexp powerful?

2001-09-06 Thread Jeff Lewis

I have a lot of scripts written in perl here and have been using PHP a lot now.  I am 
wondering if PHPs regexps are powerful or not.  I will show a small section of this 
code below that I clean up witht he perl scripts.  It cleans it almost right up but 
take a look :)  And YES there is actually information we use in this file :)

Jeff

***BATCHJobBATCH_384,SubmittedbyPRDMANOPERonNodeKWRB***%SET-W-NOTSET,errormodifyingKWRB$DKA0:-CLI-E-IVDEVTYPE,invaliddevicetype-specifyamailboxdevice$log*o=="logoff/full"needtohavecapabilities$tologout$iff$mode().eqs."INTERACTIVE"thenprdmenu$logout/full$hellosystemKWRtakes0Hellosystem,haveaniceday$setverify$znewdate$6sep01$heading$@clasNumb:1000@sort:BABYBEDDI@firs:6sep01L9BC11758KWRN2N1V4$Diag1135247V2*cbe,99*pe*tfNEWSGO*BF*ps6*ss6.5*la104%*cpe*cse*ih6.*boBABY,BEDDING*bb*cpd*tfNEWSGO*ps6.*ss6.5*la104%*feforcrib.In-cludesmatchingCribMo-bile.$20.578-6231.*dih*pe*lcd*add*ic*IR.6*rs.5*la3.*rab*ru*fe
$@clasNumb:1000@sort:BABYBEDDI@firs:6sep01L9BA46614KWRN2N3C7$Diag1117244V2*cbe,99*pe*tfNEWSGO*BF*ps6*ss6.5*la104%*cpe*cse*ih6.*bo*comMemo:sameplaced...e-maildee<10>BABYBEDDING.*bb*cpd*tfNEWSGO*ps6.*ss6.5*la104%*feNoah'sArkfromSears,A1condition.$50firm.743-9923.*dih*pe*lcd*add*ic*IR.6*rs.5*la3.*rab*ru*fe
$@clasNumb:1000@sort:BABYBREAS@firs:6sep01L9BB31124KWRN1B1B5$Diag1131124V1*cbe,99*pe*tfNEWSGO*BF*ps6*ss6.5*la104%*cpe*cse*ih6.*bo*comMemo:samefaxed.dee<10>BABYBREAST*bb*cpd*tfNEWSGO*ps6.*ss6.5*la104%*fepump.Gerber.Likenew.$35.Call653-3355.*dih*pe*lcd*add*ic*IR.6*rs.5*la3.*rab*ru*fe



[PHP] Problems with Sessions?

2001-09-06 Thread Tim

When I first browse to a site on my LAN, I get links with URLs that look
like this:

chat/?PHPSESSID=f3d149f79f5196bd709fb3c256dbb3d8

after a refresh, the whoe PHPSESSID goes away.

Wondered if there was some setting in php.ini that I've overlooked?

I'm running PHP4 with Apache on an Unstable Debian box.

Any help would be appreciated :-)



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




SV: [PHP] HTML table creation software

2001-09-06 Thread anders nawroth

I use some rather complex table layouts.
I make them with modular programming.
Every function that produces a 
also produces a .
And such a function maybe calls another
function that also puts a table inside
the HTML.
And so on ...
That way I can keep track on what's happening!
Sometimes I also put comments in the HTML
to see what actually happens, to find errors
in my code.

Anders

webmaster
www.bibbi.nawroth.com

- Ursprungligt meddelande - 
Från: "Seb Frost" <[EMAIL PROTECTED]>
Till: <[EMAIL PROTECTED]>
Skickat: den 6 september 2001 19:05
Ämne: [PHP] HTML table creation software


I expect I'll get flamed for being off topic but never mind.

I'm fine with creating simple tables and stuff - even nested a couple of
levels.  But there's so many sites these days with super-complex table
layouts.  How are these created?  Is it just some super-talented table guru
who codes the lot in notepad, or is there a bit of software (like Frontpage
but obviously NOT frontpage) that aids their creation significantly?
Frontpage is poo.

- seb
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.274 / Virus Database: 144 - Release Date: 23/08/2001


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] For the RegExps gurus!

2001-09-06 Thread

And here is version 5.2!

I optimized the search patterns. I found out that there was only a
very limited scope of URL's that was matched... So I pretty much
fixed that now (see the example).
Repeating elements from the patterns have been extracted and put in
an array, so that you can easily see the diff between the two
patterns. Also it's a bit easier to read this way.
Also note the adjusted test-string $mem. There are some more
realistic URL's in it than before. Just to see that they can realy
be matched.

--- PHP code ---

http://www.helloworld.com/index.html\n
Hello world! ftp://ftp-system.server.com?name=Renze%20Munnik\n
Hello world! www.helloworld.com this-is/not=a%link.\n
Hello world!
www.helloworld.com/dynamic-html/main.php?and=some%20Extra";

/* --- RE version 5.2 --- */
/* Sub patterns: */
$sub = array ("(ht|f)tp://",/* protocols */
  "(\w+|-)+\.", /* first (required) part of URL */
  "\w+[/?=\.%\-]*");/* rest of the URL */

/* Search-patterns: */
$pattern = array ("~\s+(($sub[0])+($sub[1])($sub[2])+)~m",
  "~\s+(($sub[0]){0}($sub[1])($sub[2])+)~m");

$replace = array (" $1",
  " http://$1\";>http://$1");

$mem = preg_replace ($pattern, $replace, $mem);


print ($mem);

?>

--- End of PHP code ---

-- 

* R&zE:


-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Problem with session controiler files in PHP on Roxen

2001-09-06 Thread Andreas Lundgren

Hello!

We installed php 4.0.6 in a Roxen 2.1.625 web server on Solaris 7. Now we 
have a problem with temporary session files. The session_start() command 
will abort with the following error message:

Warning: open(/tmp/sess_e8771af1171a6cbdf51eebdba5199d25, O_RDWR) failed: m 
(0) in [path/file.php] on line 78

Warning: open(/tmp/sess_e8771af1171a6cbdf51eebdba5199d25, O_RDWR) failed: m 
(0) in Unknown on line 0

Warning: Failed to write session data (files). Please verify that the 
current setting of session.save_path is correct (/tmp) in Unknown on line 0

The thing is that session.save_path is correct. It points to /tmp, where 
the web server and php has write permissions. The session controller can 
read and write existing files. The problem occurs only when session_start() 
has to create a _new_ session control file.

If we use fopen(), we can read and write files in /tmp. If we create a file 
with the name of the supposed session control file (sess_..., the name 
stated in the error message from session_start()) with fopen() and then 
reload the page, session_start() will execute correctly, using the file we 
just created for it. Then php will access the file correctly, writing and 
reading session variables just as it is supposed to.

So, again, the problem occurs only when session_start() has to create a 
_new_ session control file. Shouldn't a file be created automatically if it 
doesn't exist?

The only strange thing with the installation of PHP on Roxen was that no 
binary file was created. We can't find the stand-alone program to execute 
php files from the shell. This happened even though no error message was 
given at the time of installation.

The roxen installation was made as the config script suggested.

Does anyone have a clue why this problem occurs?

Best regards,

Andreas Lundgren
mailto:[EMAIL PROTECTED]



Andreas Lundgren
Magistratsvägen 55P:405
226 44 Lund
046-320250, 0708-960717, ICQ:1430437


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] php includes === Dreamweaver library items

2001-09-06 Thread Robert V. Zwink

George Whiffen,

a) Nested Loops
One problem that I see is that if I have nested loops:


{LOOP1_VARIABLE}

{LOOP2_VARIABLE}



I can assign values and get the predicted result, but if I try to use the
fastTemplate method clear_dynamic("loop2") I do not get the predicted
result.  The above situation is rather uncommon, and I work around it by
including HTML code into the php page, and assigning the result to a
fasttemplate variable.  This special consideration works fine for the few
pages that need the above nested loop, and the problem only appears if I
need to clear() a nested loop, which is another rare thing.  A good point
though, but relatively rare in my experience.  Even following my process for
handling nested loops in php using fasttemplate, it is likely less
complicated than attempting the same loop without fasttemplate.

b) Extra Luggage
Extra luggage, maybe, but would your prefer to stuff all your clothes into
one suitcase, or organize them nicely into two?  To further elaborate on the
analogy, it sure would be a lot easier to travel with companion using two
suitcases.  Using a templating system, like FastTemplate, saves countless
hours in a redesign, especially if all your doing is redesigning the HTML.
The designers I work with are on the extreme end of the print design world,
they need to see exactly what the page will look like.  The fasttemplate
{VARIABLES} have never been an issue.

c) Implications of php4 output buffering control
If you do not use CachedFastTemplate, then I would certainly look into using
the buffered output for caching.  Aside from cachinc, I have no further
experience with output buffering.

d) Dreaweaver library files/php includes
This indeed will remain an awkward arrangement.  Possible?  Yes, of course,
most things are, but awkward indeed.

e) Making variable place holders more useful to designers
This is a neat idea.  If end up setting up php up pages to process the page,
then echo variables, this sounds like a great idea.

FINALLY)
If you need up update the html pages from command line or basic text editor,
you still can.  Dreamweaver's library items remain consist across all of the
applied pages, I just do a find on all open documents with EditPad, and the
site is updated the same way Dreamweaver would have updated the pages.

Robert V. Zwink
http://www.zwink.net/daid.php





-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of George Whiffen
Sent: Thursday, September 06, 2001 1:20 PM
To: Robert V. Zwink
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] php includes === Dreamweaver library items


Robert,

Your time and trouble in going through the issues are much appreciated, and
I'm starting to warm to the idea of FastTemplate.  It seems DYNAMIC BLOCK is
the answer
to the itty bitty little html file problem, but I'm still not entirely
happy..

a) Nested Loops
I notice the warnings about unpredictable results with nested DYNAMIC
BLOCKs.
Does that mean I can't have two levels of detail e.g. a list
of invoices and their detail lines (if any) on the same page?

b) Extra Luggage
I have a strong preference for using as few tools as possible.  This is why
I like php so much and why I don't like Perl.  With php 99% of the
functionality
is built-in to the the core and you don't have to worry about picking up
extra utilities.  I can't see the case for FastTemplate is overwhelming,
given
that php is ALREADY a templating language. Apart from an extra level of
indirection that allows for cleaner tags in the html, I can't see that it
adds
that much. On the other hand it's clearly less powerful than "raw" php.

c) Implications of php4 output buffering control
I wonder if the new facilities for processing output buffers in php4 have
an impact on the best approach for templating.  Now that you have full
control
over the php output buffer, doesn't that reduce the importance of templating
systems such as FastTemplate whichpre-process output before it gets to
php's output buffer? I have the feeling that if you were/are designing
a templating system from scratch for php4, you could get a lot more
functionality
for less work now e.g. it would be easy to allow full embedding of php, by
just
carrying out the template parse after the first round of php processing
rather
than before.

d) Dreaweaver library files/php includes
Having tried the .lbi/php include trick i.e. use Dreamweaver library files
as server includes, it does work, but not brilliantly.  Funnily enough, my
main problem was that Dreamweaver insists on library items consisting of
complete "blocks" so my header and footer each had to split in two to
draw out the side columns from the top and bottom sections.

e) Making variable place holders more useful to designers
The other unpleasantness I found with Dreamweaver is that "php" tags don't
look
so nice as variable names as the variable place holders.  However I think I
may have an even more attractive alternative than a

[PHP] Re: Mailing, which is faster

2001-09-06 Thread Chris Lee

benchamrking is a common question with a common answer, "try it yourself",
depending on your situation/hardware/software this will very greatly from
machine to machine.

--

  Chris Lee
  [EMAIL PROTECTED]


"Niklas lampén" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Which is faster (and/or smarter), using function mail() or doing it by
> popen("/blah/sendmail")?
>
>
> Niklas
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: SESSIONS! - please help

2001-09-06 Thread Chris Lee

this allways buggers people up

session_register("count");
$count = array();

should be

$count = array();
session_register("count");

you have to set the var first before registering it. you should also check
if the var is allready registerd ($HTTP_SESSION_VARS[]) if so, dont
re-register it, this can cause session to segfault apache every so often.

www.mediawaveonline.com/exmaples/session.txt

this is my session file I use, take a look at what I mean.

also your using php4 so try foreach() its alot nicer, just looks better.

foreach($count as $key => $value)
vs
while (list($key, $value) = each ($count))

--

  Chris Lee
  [EMAIL PROTECTED]




"Christian Haines" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> hi all,
>
> PHP-4.03pl
> LINUX 7.0
>
> i am still having problems with sessions. the following does nothing but
> should appear to do something! it is just a simple experiment to test that
> sessions work. session_test.php calls session_proc.php to perform one of
> three functions.
>
> i would really appreciate any help as this is driving me nuts. i have also
> tested this on other systems to no avail.
>
> many thanks in advance,
> christian
>
>
> - session_test.php --
> 
>
> 
>  if(is_array($count))
> {
> reset ($count);
> while (list($key, $value) = each ($count)) {
> echo "Key: $key; Value: $value
> Count:".count($value)."\n";
>
> if(is_array($value))
> {
> reset ($value);
> while (list($key2, $value2) = each ($value)) {
> echo "---> Key: $key2; Value: $value2 \n";
> }
> }
> }
> }
>
> print " ".count($count)."
> ---".session_is_registered("count");
>
> ?>
> 
>  type=submit value=reset>
> 
>
> 
> 
>
> - session_proc.php --
>  session_start();
>
> session_register("count");
> $count = array();
>
> if(isset($increment))
> {
> $count[0] = 9;
> $count[1] = 11;
> $count[2] = 12;
> }
>
> if(isset($reset))
> {
> unset($count);
> }
>
> if(isset($decrement))
> {
> $count[0] = 4;
> $count[1] = 6;
> $count[2] = 1;
> }
>
> header("location: session_test.php");
> exit;
> ?>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] << Previous / Next Buttons >>

2001-09-06 Thread Chris Lee

I just use LIMIT its alot better, alot less CPU intensive.

if (!isset($pos))
$pos = 0

SELECT * FROM product LIMIT 0, $pos

$pos++
if ( !((SELECT count(*) FROM product) > $pos) )
Next

you get the idea.

  Chris Lee
  [EMAIL PROTECTED]

"Jeff Oien" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi, what's the simplest way to provide previous/next buttons that
navigate
> > through individual records of a database?  This is for a photo gallery,
so I
> > want to do one record at a time until I'm out of records, then I want
the
> > "next" button to disappear.  I've been fiddling with it for a while now,
but
> > haven't been very successful.  Anyone have any snippets, or ideas for
me?
> >
> > Thanks in advance.
>
> I'll show you what I did but realize I'm an advanced beginner/intermediate
> programmer. This may not be the most efficient way to do it but seems to
> be the simplest code compared to other ways of doing it that I've seen.
Not
> sure if I will explain this well enough either. And this is for a fairly
small
> database. With a larger one it may be too inefficient.
>
> First count how many records are in the database for the album and put
> it in $count.
>
> Then loop through all the records in the album, place the id for each
record
> in an array and find out where in the array the current record is.
$photo_id
> is fed to this script which tells it which picture to display:
>
> $x = 0;
> while ($row = mysql_fetch_array($result)) {
> $photo_id1 = $row['photoid'];
> $array[$x] =  $photo_id1;
> if ($photo_id1 == $photo_id) {
> $position = $x;
> }
> $x++;
> }
>
> In another sql query for retrieving the specific image (have to compensate
for
> array[] starting at zero but record count starting at 1):
>
> $row = mysql_fetch_array($result);
> $photo_id = $row['photoid'];
> if ($position == 0) {
> $photo_pos = $position + 1;
> echo "Showing $photo_pos of $count << Previous"; //no link
> }
> else {
> $photo_pos = $position + 1;
> $previous_pos = $photo_pos - 2;
> $previous = $array[$previous_pos];
> echo "Showing $photo_pos of $count  href=\"display.php?photo_id=$previous\"><< Previous";
> }
> if ($count == $photo_pos) {
> echo " | Next >>"; //no link
> }
> elseif ($photo_pos < $count) {
> $next_pos = $photo_pos;
> $next = $array[$next_pos];
> echo " |  href=\"display.php?photo_id=$next\">Next >>";
> }
>
> Comments from more experienced programmers welcome. I don't want to lead
> astray.
> Jeff Oien



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] The future of PHP - PHP Pattern Repository

2001-09-06 Thread Geoff Caplan

Hi

>
>I'm getting a 404 not found on that URL. Please check it.
>

Oops - silly typo - and I double checked it too!

Here is the address:

http://www.geocities.com/SiliconValley/Lab/6888/prpats.htm

Actually, this is a pretty interesting site. The root is at:

http://www.geocities.com/SiliconValley/Lab/6888/index.html

It is a pretty thought provoking critique of OOP as a tool for small to
medium business projects - helped give me the confidence to stick with a
procedural approach.

His style is pretty combative, which will put some backs up, but it makes
for entertaining reading.

The site is a bit shambolic, but if you dig around you will find about 30
papers and lots of good links too.

I particularly like his concept of Table Oriented Programming:

http://www.geocities.com/SiliconValley/Lab/6888/top.htm

He shows how to use various kinds of external configuration approaches to
increase flexibility and reduce maintenance.

Good stuff, IMHO

Geoff Caplan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] For the RegExps gurus!

2001-09-06 Thread

Okay... this time an even better solution, without the /e modifier.
Think this comes pretty close to some final solution.

--- PHP code ---

http://www.helloworld.com\n
Hello world! ftp://ftp.server.com\n
Hello world www.helloworld.com";

/* -- ! Fifth regexp ! -- */
$pattern = array ("~\s+((?:http://|ftp://){0}(?:\w+\.)+(?:\w+))~m",
  "~\s+((?:http://|ftp://)+(?:\w+\.)+(?:\w+))~m");
$replace = array (" http://$1\";>http://$1",
  " $1");

$mem = preg_replace ($pattern, $replace, $mem);

print ($mem);

?>

--- End of PHP code ---

This still needs some optimization imo (...)

-- 

* R&zE:


-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] The future of PHP - PHP Pattern Repository

2001-09-06 Thread


From: Miles Thompson <[EMAIL PROTECTED]>
Date: Thu, Sep 06, 2001 at 01:44:16PM -0300
Message-ID: <[EMAIL PROTECTED]>
Subject: Re: [PHP] The future of PHP - PHP Pattern Repository

> Geoff,
> I'm getting a 404 not found on that URL. Please check it.
> Miles






You should replace the slash by a dot:

http://www/geocities.com/SiliconValley/Lab/6888/prpats.htm
  ^
  |
  v
http://www.geocities.com/SiliconValley/Lab/6888/prpats.htm



-- 

* R&zE:


-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] << Previous / Next Buttons >>

2001-09-06 Thread Jeff Oien

> Hi, what's the simplest way to provide previous/next buttons that navigate
> through individual records of a database?  This is for a photo gallery, so I
> want to do one record at a time until I'm out of records, then I want the
> "next" button to disappear.  I've been fiddling with it for a while now, but
> haven't been very successful.  Anyone have any snippets, or ideas for me?
> 
> Thanks in advance.

I'll show you what I did but realize I'm an advanced beginner/intermediate 
programmer. This may not be the most efficient way to do it but seems to
be the simplest code compared to other ways of doing it that I've seen. Not
sure if I will explain this well enough either. And this is for a fairly small 
database. With a larger one it may be too inefficient.

First count how many records are in the database for the album and put
it in $count.

Then loop through all the records in the album, place the id for each record
in an array and find out where in the array the current record is. $photo_id
is fed to this script which tells it which picture to display:

$x = 0;
while ($row = mysql_fetch_array($result)) {
$photo_id1 = $row['photoid'];
$array[$x] =  $photo_id1;
if ($photo_id1 == $photo_id) {
$position = $x;
}
$x++;
}

In another sql query for retrieving the specific image (have to compensate for
array[] starting at zero but record count starting at 1):

$row = mysql_fetch_array($result);
$photo_id = $row['photoid'];
if ($position == 0) {
$photo_pos = $position + 1; 
echo "Showing $photo_pos of $count << Previous"; //no link
}
else {
$photo_pos = $position + 1; 
$previous_pos = $photo_pos - 2;
$previous = $array[$previous_pos];
echo "Showing $photo_pos of $count << Previous";
}
if ($count == $photo_pos) {
echo " | Next >>"; //no link
}
elseif ($photo_pos < $count) {
$next_pos = $photo_pos;
$next = $array[$next_pos];
echo " | Next >>";
}

Comments from more experienced programmers welcome. I don't want to lead
astray.
Jeff Oien

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] HTML table creation software

2001-09-06 Thread Seb Frost

I expect I'll get flamed for being off topic but never mind.

I'm fine with creating simple tables and stuff - even nested a couple of
levels.  But there's so many sites these days with super-complex table
layouts.  How are these created?  Is it just some super-talented table guru
who codes the lot in notepad, or is there a bit of software (like Frontpage
but obviously NOT frontpage) that aids their creation significantly?
Frontpage is poo.

- seb
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.274 / Virus Database: 144 - Release Date: 23/08/2001


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] book help

2001-09-06 Thread Alexander Deruwe

On Thursday 06 September 2001 16:35, Nikola Veber wrote:
> Can anyone who has this book suggest what chapters should
> I read first or which topics on php are the most apropriate for a beginner.

You shouldn't use the cookbook in that way. Try like this: You are writing 
whatever application it is you are writing, and you come across problem X 
dealing with stuff about Y. What you do now is browse through the very first 
section of the book, called "Contents at a Glance". Look for the header 
concerning Y, then look on for a solution to problem X.

Most problems you will encounter as a newbie are indeed touched upon by this 
book, and when that is not the case, there is the internet.

> My only php resources are internet and this book.

Great. That combination should get you well underway.

ad.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] password sanity checker

2001-09-06 Thread George Whiffen

A cheap and cheerful rule is to insist on at least one numeric.
  Then you don't have to bother with a dictionary check!

The php to force only alphas and numerics (upper or lower case) and at least
one numeric is something like : -

if (!ereg("^[a-zA-Z0-9]*[0-9][a-zA-Z0-9]*$",$password)) 
{ 
   $message = "no good";
}

and the Javascript : -

var passwordPat=new RegExp("^[a-zA-Z0-9]*[0-9][a-zA-Z0-9]*$"); 

if ( password.match(passwordPat)==null)
{
   alert("no good");
}

Good Luck,

George

Chris Anderson wrote:
> 
> Getting the size is easy, and if you had a small dictionary you could see if
> the password existed in that by looping through it. Not sure about checking
> if it is LIKE the username
> - Original Message -
> From: "Charles Sprickman" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, July 03, 2001 12:18 PM
> Subject: [PHP] password sanity checker
> 
> > Hi,
> >
> > I've been digging around for a function to do a sanity check on
> > user-supplied passwords when creating a new account.  Haven't found
> > anything yet...  Any pointers appreciated.
> >
> > Ideally it should:
> >
> > -check for a min number of numerals
> > -check for similarity against username (?)
> > -check at least a small dictionary
> >
> > Although anything that could provide a starting point would be great.
> >
> > Thanks,
> >
> > Charles
> >
> > | Charles Sprickman  | Internet Channel
> > | INCH System Administration Team| (212)243-5200
> > | [EMAIL PROTECTED] | [EMAIL PROTECTED]
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




  1   2   >