|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: php-general-digest-help
lists.php.netDate: Fri Oct 05 2001 - 03:33:53 CDT
php-general Digest 5 Oct 2001 08:33:53 -0000 Issue 916
Topics (messages 69976 through 70046):
PHP Warning: Unable to load dynamic library
69976 by: Edson Toshiya
70031 by: Richard Lynch
Re: howw do I programm a PREV & Next mechanism in PHP? Help Please!!
69977 by: Steve Werby
69982 by: Lasse
Re: [PHP-DB] howw do I programm a PREV & Next mechanism in PHP? Help Please!!
69978 by: Charles Butler
69979 by: Rick Emery
69981 by: Bas Jobsen
69983 by: Charles Butler
Re: This is SOOOO FREAKY!!! Laughed like HELL !!! :-)
69980 by: Chris Hayes
Re: ad rotation program
69984 by: Michael Geier, CDM Systems Admin
69998 by: Maxim Maletsky \(PHPBeginner.com\)
Getting an Email into a PHP/pl script
69985 by: Chris Aitken
69987 by: Kurt Lieber
69988 by: rick fletcher
69989 by: Richard Heyes
69996 by: David Robley
69997 by: ReDucTor
Re: newbie - some simple questions
69986 by: John A. Grant
read file twice or read into array once?
69990 by: John A. Grant
70032 by: Richard Lynch
Re: check if file is already in use before fopen
69991 by: Brian White
Upgrade Issue
69992 by: Php Questions
70033 by: Richard Lynch
Re: OT page load speed [was: howw do I programm a PREV & Next mechanism in PHP? Help Please!!]
69993 by: Steve Werby
stupid newbie question
69994 by: Paul Procacci
70035 by: Richard Lynch
php, files, ownership....(was file manipulation)
69995 by: Gerard Samuel
70034 by: Richard Lynch
70037 by: Gerard Samuel
Re: PHP is a Bloated Kludge, discuss!
69999 by: Maxim Maletsky \(PHPBeginner.com\)
70002 by: Maxim Maletsky \(PHPBeginner.com\)
70004 by: Maxim Maletsky \(PHPBeginner.com\)
70005 by: php
70006 by: Maxim Maletsky \(PHPBeginner.com\)
Proposal
70000 by: Ralph Guzman
ereg checking if its only numbers
70001 by: Chris Aitken
70003 by: Jack Dempsey
70007 by: Maxim Maletsky \(PHPBeginner.com\)
70012 by: Php Questions
70038 by: Rasmus Lerdorf
70041 by: _lallous
Re: double byte problem
70008 by: Yasuo Ohgaki
Change linux password using php
70009 by: Sigurd Magnusson
70017 by: Evan Nemerson
70036 by: Evan Nemerson
Re: Restrict where PHP is Usable?
70010 by: Sigurd Magnusson
Mirroring Website
70011 by: Jon Shoberg
System(), exec(), Passthru(), etc
70013 by: ReDucTor
70014 by: David Robley
70016 by: ReDucTor
Email Processors Wanted Immediately!!!
70015 by: terrycrowe_webdirect2001.yahoo.com
Re: php in css not working with IF's
70018 by: Jason Dulberg
Re: popup window under php
70019 by: Naintara Jain
Re: Namo Web Editor
70020 by: Joel Ricker
Re: images no appearing
70021 by: Joel Ricker
cgi bug workaround
70022 by: James Peter Gregory
Re: help! linux 7 problems
70023 by: Richard Lynch
Re: Really need HELP on PHP install > Error in "make"
70024 by: Richard Lynch
Re: printf scientific notation?
70025 by: Richard Lynch
Re: How can I simulate the login process?
70026 by: Richard Lynch
70039 by: _lallous
Re: Session ID
70027 by: Richard Lynch
70042 by: Rosen
Re: installation prob.
70028 by: Richard Lynch
Re: Apache + PHP + libswf problems
70029 by: Richard Lynch
Re: Problem with sem_get and semaphores
70030 by: Richard Lynch
Re: Downloading Images
70040 by: _lallous
Another Header headed nowhere
70043 by: Hugh Danaher
70045 by: Naintara Jain
Re: [PHP-DEV] Bug #13545: oci8 compile problem
70044 by: Jerome Ponsin
What is wrong (was: How to simulate any browser)
70046 by: Kamil Nowicki
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Hi,
I'm trying to load ming as a module of PHP, but I get an error when loading
apache:
PHP Warning: Unable to load dynamic library './php_ming.so' -
./php_ming.so: cannot open shared object file: No such file or directory in
Unknown on line 0
Can someone help me ?
Thanks,
ET
attached mail follows:
Your php_ming.so has to go in the directory specified in php.ini as
"extension_dir" It ain't gonna get found anywhere else.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com 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: Edson Toshiya <toshiya
ieg.com.br> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Thursday, October 04, 2001 3:45 PM Subject: PHP Warning: Unable to load dynamic library
> Hi, > > I'm trying to load ming as a module of PHP, but I get an error when loading > apache: > > PHP Warning: Unable to load dynamic library './php_ming.so' - > ./php_ming.so: cannot open shared object file: No such file or directory in > Unknown on line 0 > > Can someone help me ? > > Thanks, > > ET > >
attached mail follows:
"Sander Peters" <S.Peters
Visionnet.nl> wrote:
> I users wants to browse records from my (mysql) database, and the user
> can decide how many records he/she wants to see per page. There should
> be a Previous and a Next button on each page to brows through the
> records.
Here's a snippet of code from a site I built. It shoud be enough code for you to accomplish what you want without really having to understand it. I suggest taking the time to understand it though. If you're curious what it looks like in action here's one of the pages generated from the full script that the code below was pulled from. http://www.tysonchandler.com/news_3.html (that's an underscore, not a space).
$sql = "SELECT * "; $sql .= "FROM articles "; $sql .= "WHERE active = 1 "; $sql .= "ORDER BY article_date DESC, article_source ASC ";
$result = mysql_query( $sql, $GLOBALS['handle'] ) or die( 'No records.' ); $num_records = mysql_num_rows( $result );
$limit_rows = 8; $pages = ceil( $num_records / $limit_rows );
if ( empty( $page ) ) { $page = 1; $limit_start = 0; } else { $limit_start = ( $page - 1 ) * $limit_rows; }
$sql .= "LIMIT $limit_start, $limit_rows ";
$result = mysql_query( $sql, $GLOBALS['handle'] ) or die( 'No records.' );
$page_next = $page + 1; $page_prev = $page - 1;
if ( $page_prev >= 1 ) { $output .= ' <a href="/news_' . $page_prev . '.html'; $output .= '">Prev Page</a> |'; } else { $output .= " Prev Page |"; }
-- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/
attached mail follows:
"Steve Werby" <steve-lists
befriend.com> wrote in message
news:0c3701c14d18$3505c910$6401a8c0
workstation7...
[SNIPs]
> http://www.tysonchandler.com/news_3.html (that's an underscore, not a
> space).
Is it just me or is this site blazingly fast? Are you using some cache-tricks or something? Or du you just have an over-powered under-loaded server?
I could use a bit of speed at my own site.. :-)
-- Lasse
attached mail follows:
This is a copy of the next/prev links I've used on my own News Droid project, to see an example, http://www.subject-unknown.com/phantom/
function NavLinks($limit, $offset, $user, $passwd, $dbname, $host, $PHP_SELF) {
// Get a running total of news-id's so we can calculate and display
$connection =
mysql_connect($host, $user, $passwd) or die
(mysql_error());
$db =
mysql_select_db($dbname, $connection) or die (mysql_error());
$sql = "
SELECT id from $tablename
";
$result =
mysql_query($sql, $connection) or die (mysql_error());
$row_num = mysql_num_rows($result);
$total = ($row_num-1);
$next = $offset + $limit;
$prev = $offset - $limit;
$offset += $limit;
-----Original Message-----
From: Sander Peters [mailto:S.Peters
Visionnet.nl]
Sent: Thursday, October 04, 2001 3:44 PM
To: php-db
lists.php.net; php-general
lists.php.net
Subject: [PHP-DB] howw do I programm a PREV & Next mechanism in PHP?
Help Please!!
Hello!
I'm making a database wich can be viewed and modified through a webbrowser using PHP and MySQL.
I users wants to browse records from my (mysql) database, and the user can decide how many records he/she wants to see per page. There should be a Previous and a Next button on each page to brows through the records.
(This is a very common situation wich is for example used by search engines.)
My problem is, I really don't know how to make a Prev and Next system. I tried already a lot but it doesn't work.
Does somebody have a PHP script with this working and can you send it to
me please (or just the part with the prev/next meschanism)?
It would help me a lot!
Thanks in advance!
Greetings Sander Peters - The Netherlands http://www.visionnet.nl/
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribelists.php.net For additional commands, e-mail: php-db-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
http://www.phpbuilder.com/columns/rod20000221.php3
-----Original Message-----
From: Sander Peters [mailto:S.Peters
Visionnet.nl]
Sent: Thursday, October 04, 2001 3:44 PM
To: php-db
lists.php.net; php-general
lists.php.net
Subject: [PHP-DB] howw do I programm a PREV & Next mechanism in PHP?
Help Please!!
Hello!
I'm making a database wich can be viewed and modified through a webbrowser using PHP and MySQL.
I users wants to browse records from my (mysql) database, and the user can decide how many records he/she wants to see per page. There should be a Previous and a Next button on each page to brows through the records.
(This is a very common situation wich is for example used by search engines.)
My problem is, I really don't know how to make a Prev and Next system. I tried already a lot but it doesn't work.
Does somebody have a PHP script with this working and can you send it to
me please (or just the part with the prev/next meschanism)?
It would help me a lot!
Thanks in advance!
Greetings Sander Peters - The Netherlands http://www.visionnet.nl/
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribelists.php.net For additional commands, e-mail: php-db-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
<? if(!isset($userinput_number))$userinput_number=10; file://user defined number of result/page $total= ; file://resultsfount in db if(!isset($start))$start=0; for($i=$start; $i<$userinput_number; $i++) echo"";//your results here
$back=$start-$userinput_number; if($start>0)echo"<a href='$PHP_SELF?start=${back}&userinput_number=$userinput_number'>PREVIOUS</ a>"; $next=$start+$userinput_number; if($start+$userinput_number<=$total)echo"<a href='$PHP_SELF?start=${next}&userinput_number=$userinput_number'>NEXT</a>"; ?>
attached mail follows:
And ofcourse being myself, I totally forgot to insert the rest of the code...many apologies... Here is the full code:
function NavLinks($limit, $offset, $user, $passwd, $dbname, $host, $PHP_SELF) {
// Get a running total of news-id's so we can calculate and display the Total number of news-entries
$tablename = "phantom_droid";
$connection =
mysql_connect($host, $user, $passwd) or die
(mysql_error());
$db =
mysql_select_db($dbname, $connection) or die (mysql_error());
$sql = "
SELECT id from $tablename
";
$result =
mysql_query($sql, $connection) or die (mysql_error());
$row_num = mysql_num_rows($result);
$total = ($row_num-1);
$next = $offset + $limit;
$prev = $offset - $limit;
$offset += $limit;
$next_disp = "<a href=$PHP_SELF?dest=home&offset=$next>Next
$limit</a>";
$prev_disp = "<a href=$PHP_SELF?dest=home&offset=$prev>Previous
$limit</a>";
if ($prev < 0) {
$prev_disp = "Previous $limit";
}
if ($next >= $total) {
$next_disp = "Next $limit";
}
$total_news_disp = "<font class=linkwannabe>$row_num Total News
Entries</font>";
// echo the display block
echo "$total_news_disp $prev_disp |
$next_disp ";
}
-----Original Message-----
From: Sander Peters [mailto:S.Peters
Visionnet.nl]
Sent: Thursday, October 04, 2001 3:44 PM
To: php-db
lists.php.net; php-general
lists.php.net
Subject: [PHP-DB] howw do I programm a PREV & Next mechanism in PHP?
Help Please!!
Hello!
I'm making a database wich can be viewed and modified through a webbrowser using PHP and MySQL.
I users wants to browse records from my (mysql) database, and the user can decide how many records he/she wants to see per page. There should be a Previous and a Next button on each page to brows through the records.
(This is a very common situation wich is for example used by search engines.)
My problem is, I really don't know how to make a Prev and Next system. I tried already a lot but it doesn't work.
Does somebody have a PHP script with this working and can you send it to
me please (or just the part with the prev/next meschanism)?
It would help me a lot!
Thanks in advance!
Greetings Sander Peters - The Netherlands http://www.visionnet.nl/
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribelists.php.net For additional commands, e-mail: php-db-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
> > According to him, if you add > > '?=PHPE9568F36-D428-11d2-A769-00AA001ACF42'
http://www.phpbuilder.com/mail/php4-beta/200004/0796.php
--------------------------------------------------------------- ----- -- C.Hayes Droevendaal 35 6708 PB Wageningen the Netherlands -- --------------------------------------------------------------- -----
attached mail follows:
check out Oasis on Freshmeat...I haven't used it, but I did notice it on there. also, as already posted, PHPads.
-----Original Message-----
From: Wandrer [mailto:wandrer
glcomputers.com]
Sent: Thursday, October 04, 2001 2:12 PM
To: Joseph Bannon
Cc: php-general
lists.php.net
Subject: Re: [PHP] ad rotation program
At 01:37 PM 10/4/01 -0500, you wrote: >Has anyone on this list developed an ad rotation program in PHP? >Joseph >PHP General Mailing List (http://www.php.net/)
Joseph,
dotBanner ( http://www.dot-banner.com ) is the one that I work on.
"We have your script pushing well over 6 million impressions per day with no problem." - Robert
"...out of all the software I have bought on the net, you have provided me with the BEST service, HANDS DOWN man... You should be very proud of this man... thanks so much!" -Deejay
Paul
----------------------------- dotBanner www.dot-banner.com -----------------------------
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Have you looked into phpAdsNew?
www.sf.net And search for it there
Maxim Maletsky www.PHPBeginner.com
> -----Original Message-----
> From: Michael Geier, CDM Systems Admin [mailto:mgeier
cdmsports.com]
> Sent: giovedi 4 ottobre 2001 23.39
> To: Wandrer; Joseph Bannon
> Cc: php-general
lists.php.net
> Subject: RE: [PHP] ad rotation program
>
>
> check out Oasis on Freshmeat...I haven't used it, but I did
> notice it on there. also, as already posted, PHPads.
>
> -----Original Message-----
> From: Wandrer [mailto:wandrer
glcomputers.com]
> Sent: Thursday, October 04, 2001 2:12 PM
> To: Joseph Bannon
> Cc: php-general
lists.php.net
> Subject: Re: [PHP] ad rotation program
>
>
> At 01:37 PM 10/4/01 -0500, you wrote:
> >Has anyone on this list developed an ad rotation program in
> PHP? Joseph
> >PHP General Mailing List (http://www.php.net/)
>
> Joseph,
>
> dotBanner ( http://www.dot-banner.com ) is the one that I work on.
>
> "We have your script pushing well over 6 million impressions
> per day with no problem."
> - Robert
>
> "...out of all the software I have bought on the net, you
> have provided me with the BEST service, HANDS DOWN man... You
> should be very proud of this man... thanks so much!" -Deejay
>
> Paul
>
> -----------------------------
> dotBanner www.dot-banner.com
> -----------------------------
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail:
> php-general-help
lists.php.net To contact the list
> administrators, e-mail: php-list-admin
lists.php.net
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail:
> php-general-help
lists.php.net To contact the list
> administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
Hi all,
I have looked into the archives but im not sure what im searching for so I decided to ask here.
What I want to do is, on my FreeBSD box running PHP and MySQL, to have a system which will take any email sent to a specific address, and pipe the body of the email to PHP (or even to a perl script). Once I have the body of the email as a variable, I can do all my parsing and extracting etc to do with it as I need, but im baffled on where to start looking to get this done.
Any help would be greatly appreciated.
Cheers
Chris
Chris Aitken - Administration/Database Designer - IDEAL Internet
email: chris
ideal.net.au phone: +61 2 4628 8888 fax: +61 2 4628 8890
__-----------------------------------------__
It is said that if you line up all the cars in the world end to end,
some moron in a rotary will still to try and pass them
attached mail follows:
Check out hotscripts.com -- there's a bunch of PHP scripts that do various things. One in particular that at least may point you in the right direction is PHPEmailArchiver:
http://www.hotscripts.com/Detailed/12104.html
hth
--kurt
> -----Original Message-----
> From: Chris Aitken [mailto:chris
ideal.net.au]
> Sent: Thursday, October 04, 2001 2:54 PM
> To: php-general
lists.php.net; freebsd-questions
FreeBSD.ORG
> Subject: [PHP] Getting an Email into a PHP/pl script
>
>
> Hi all,
>
> I have looked into the archives but im not sure what im
> searching for so I
> decided to ask here.
>
> What I want to do is, on my FreeBSD box running PHP and
> MySQL, to have a
> system which will take any email sent to a specific address,
> and pipe the
> body of the email to PHP (or even to a perl script). Once I
> have the body
> of the email as a variable, I can do all my parsing and
> extracting etc to
> do with it as I need, but im baffled on where to start
> looking to get this
> done.
>
> Any help would be greatly appreciated.
>
>
>
> Cheers
>
>
> Chris
>
>
>
> Chris Aitken - Administration/Database Designer - IDEAL Internet
> email: chris
ideal.net.au phone: +61 2 4628 8888 fax: +61
> 2 4628 8890
> __-----------------------------------------__
> It is said that if you line up all the cars in the world
> end to end,
> some moron in a rotary will still to try and pass them
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail:
> php-general-help
lists.php.net To contact the list
> administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
There's a good php POP3 class available here: http://www.thewebmasters.net/php/POP3.phtml
That will enable you to log into your mail server and retrieve a mail message from it.
> -----Original Message-----
> From: Chris Aitken [mailto:chris
ideal.net.au]
> Sent: Thursday, October 04, 2001 2:54 PM
> To: php-general
lists.php.net; freebsd-questions
FreeBSD.ORG
> Subject: [PHP] Getting an Email into a PHP/pl script
>
> Hi all,
>
> I have looked into the archives but im not sure what im searching for
so I
> decided to ask here.
>
> What I want to do is, on my FreeBSD box running PHP and MySQL, to have
a
> system which will take any email sent to a specific address, and pipe
the
> body of the email to PHP (or even to a perl script). Once I have the
body
> of the email as a variable, I can do all my parsing and extracting etc
to
> do with it as I need, but im baffled on where to start looking to get
this
> done.
>
> Any help would be greatly appreciated.
>
>
>
> Cheers
>
>
> Chris
>
>
>
> Chris Aitken - Administration/Database Designer - IDEAL Internet
> email: chris
ideal.net.au phone: +61 2 4628 8888 fax: +61 2 4628
8890
> __-----------------------------------------__
> It is said that if you line up all the cars in the world end to
end,
> some moron in a rotary will still to try and pass them
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail:
php-list-admin
lists.php.net
attached mail follows:
> There's a good php POP3 class available here: > http://www.thewebmasters.net/php/POP3.phtml > > That will enable you to log into your mail server and retrieve a mail > message from it.
There's also a good mime decoder here:
-- Richard Heyes "I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones." - Albert Einstein
attached mail follows:
On Fri, 5 Oct 2001 07:24, Chris Aitken wrote: > Hi all, > > I have looked into the archives but im not sure what im searching for > so I decided to ask here. > > What I want to do is, on my FreeBSD box running PHP and MySQL, to have > a system which will take any email sent to a specific address, and pipe > the body of the email to PHP (or even to a perl script). Once I have > the body of the email as a variable, I can do all my parsing and > extracting etc to do with it as I need, but im baffled on where to > start looking to get this done. > > Any help would be greatly appreciated.
What are you using for an MTA? If for example you are using sendmail, you can set up an alias, via an entry in /etc/aliases which pipes the incoming mail to a script, which could be a php script. Of course, you would need a php binary. Similarly you can set up an alias file with qmail which passes the email to a script.
This is a common technique for say creating web based mail list archives.
-- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIACats aren't clean, they're just covered with cat spit!
attached mail follows:
Most mail servers use qmail, so i will explain how to do it with qmail
For your qmail accounts, you will have .qmail files(e.g. .qmail-default
.qmail-webmaster and so on), open one of these files, now add the bottom of
it |preline /path/to/php /path/to/script.php or you can do it with perl the
same way, but with your path to perl, The email its self will be stored in
stdin, if you want ot read it in php you can just go fopen("php://stdin",
"r"); if you want to use it in perl, just do
stdinarray=<stdin>; it's an
array, make sure to chomp() your results, from there you can prase the
email, and check who it is, reply the the email, delete the email from the
mailbox, what ever you want... :D
----- Original Message -----
From: "David Robley" <huntsman
www.nisu.flinders.edu.au>
To: "Chris Aitken" <chris
ideal.net.au>; <php-general
lists.php.net>;
<freebsd-questions
FreeBSD.ORG>
Sent: Friday, October 05, 2001 10:27 AM
Subject: Re: [PHP] Getting an Email into a PHP/pl script
> On Fri, 5 Oct 2001 07:24, Chris Aitken wrote:
> > Hi all,
> >
> > I have looked into the archives but im not sure what im searching for
> > so I decided to ask here.
> >
> > What I want to do is, on my FreeBSD box running PHP and MySQL, to have
> > a system which will take any email sent to a specific address, and pipe
> > the body of the email to PHP (or even to a perl script). Once I have
> > the body of the email as a variable, I can do all my parsing and
> > extracting etc to do with it as I need, but im baffled on where to
> > start looking to get this done.
> >
> > Any help would be greatly appreciated.
>
> What are you using for an MTA? If for example you are using sendmail, you
> can set up an alias, via an entry in /etc/aliases which pipes the
> incoming mail to a script, which could be a php script. Of course, you
> would need a php binary. Similarly you can set up an alias file with
> qmail which passes the email to a script.
>
> This is a common technique for say creating web based mail list archives.
>
> --
> David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
> CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
>
> Cats aren't clean, they're just covered with cat spit!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
"Rasmus Lerdorf" <rasmus
php.net> wrote in message
news:Pine.LNX.4.33.0110020854040.1241-100000
rasmus.php.net...
[...]
Thanks for the help & tips. I guess I'll use ".inc" for files that are included (as opposed to being run directly) and block access to them at the server level. Hmm, since the directory always has an index.html, clients will never see the filename anyway and could only run it by guessing at the name, so it's a small point.
-- John A. Grant * I speak only for myself * (remove 'z' to reply) Radiation Geophysics, Geological Survey of Canada, Ottawa If you followup, please do NOT e-mail me a copy: I will read it here
attached mail follows:
I have a file containing ~100 lines of text, each perhaps 100-200 characters in length. I need to retrieve line $n from the file, where: $n = $julianday % $nlines;
$julianday = today's date (from localtime[7]) $nlines = no. of lines in the file
Method A 0. fopen() the file 1. read the file line by line with fgets() and count the lines ($nlines) 2. compute the required entry: $n=$julianday % $nline 3. rewind() the file and read it again until entry $n is found 4. fclose() the file
Method B 1. read the entire file into memory: $lines=file("myfile") 2. compute the required entry: $n=$julianday % count($lines)
I appreciate that this depends on the no. of lines in the file and the size of the file. What I'm looking for is opinions on whether the use of file() is more efficient than fgets(). It needs more memory, but it eliminates reading the file twice.
Thanks.
-- John A. Grant * I speak only for myself * (remove 'z' to reply) Radiation Geophysics, Geological Survey of Canada, Ottawa If you followup, please do NOT e-mail me a copy: I will read it here
attached mail follows:
100 lines of 200 chars each is 20000 which is 20K which is chump change for RAM...
Unless you are on a super busy page on a super high-volume server, just file() it.
If you're on a super busy page on a super high-volume server, file() it anyway, and then ap benchmark it to see if it's "slim enough" -- And if not, profile it to be sure it's the file() that's killing you, not something else.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com 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: John A. Grant <jazrant
zsc.nrcan.zc.ca> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Thursday, October 04, 2001 5:29 PM Subject: read file twice or read into array once?
> I have a file containing ~100 lines of text, each perhaps 100-200 > characters in length. I need to retrieve line $n from the file, where: > $n = $julianday % $nlines; > > $julianday = today's date (from localtime[7]) > $nlines = no. of lines in the file > > Method A > 0. fopen() the file > 1. read the file line by line with fgets() and count the lines ($nlines) > 2. compute the required entry: $n=$julianday % $nline > 3. rewind() the file and read it again until entry $n is found > 4. fclose() the file > > Method B > 1. read the entire file into memory: $lines=file("myfile") > 2. compute the required entry: $n=$julianday % count($lines) > > I appreciate that this depends on the no. of lines in the file and > the size of the file. What I'm looking for is opinions on whether > the use of file() is more efficient than fgets(). It needs more memory, > but it eliminates reading the file twice. > > Thanks. > > -- > John A. Grant * I speak only for myself * (remove 'z' to reply) > Radiation Geophysics, Geological Survey of Canada, Ottawa > If you followup, please do NOT e-mail me a copy: I will read it here > > >
attached mail follows:
Check out the "flock" fucntion
At 16:20 4/10/2001 -0400, Jason Stechschulte wrote:
>On Thu, Oct 04, 2001 at 11:10:56AM -0400, Matthew Luchak wrote:
> > Is there a way to verify if a file is in use by another user before
> > fopening it?
>
>As far as I know this is something you have to program in yourself. If
>you are only worried about your programs accessing the file, then it is
>a good idea to create a lock file. Before you access a file called
>mydata, check for a file called mydata.lock. If that exists, then the
>file is in use, so wait and check later. If it does not exist, create a
>file called mydata.lock, open mydata, do with it as you please, close
>mydata, and delete mydata.lock.
>
>You also have to be prepared to handle a situation where your program
>stops before removing the lock file. Usually with PHP, it is much
>easier to just use a database so all this file locking is dealt with by
>the database and not you.
>--
>Jason Stechschulte
>jpstech
unoh.edu
>--
>Sorry. My testing organization is either too small, or too large, depending
>on how you look at it. :-)
> -- Larry Wall in <1991Apr22.175438.8564
jpl-devvax.jpl.nasa.gov>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>For additional commands, e-mail: php-general-help
lists.php.net
>To contact the list administrators, e-mail: php-list-admin
lists.php.net
-------------------------
Brian White
Step Two Designs Pty Ltd - SGML, XML & HTML Consultancy
Phone: +612-93197901
Web: http://www.steptwo.com.au/
Email: bwhite
steptwo.com.au
attached mail follows:
Today, I upgraded our development web server from PHP 4.02 to 4.06.
the exact configure string was:
./configure --with-apxs=/usr/sbin/apxs --with-mysql=/usr --with-mcrypt=/usr/local/lib --enable-versioning --with-ldap=/usr/local
None of the support files (apache, mysql, mcrypt, openldap) were changed only the php tarball from their website.
Now I have this interesting problem:
the source: <? require("templates/virt_cust.inc") or error("Fatal Error");
produces this error message: Fatal error: Failed opening required '1' (include_path='.:/usr/local/lib/php') in /home/httpd/html/distsupp/templates/virt_cust_form.php on line 2
The file is there and it works fine when I remove the "or error(..." code from the end of line 2. It appears that adding this code causes require() to interpret the file name as a boolean TRUE.
This problem did not happen with 4.02.
Does anyone know of a configuration option or anything I can correct to make this syntax work again with 4.06?
attached mail follows:
Require is not a function.
It's a language construct.
As such, it has never had a defined return value.
You can try include instead, just for fun, but you'd be better off to code it cleaner and check something that virt_cust.inc does or sets and erroring out if that didn't happen.
require 'template/virt_cust.inc'; if (isset($customer)) error("Fatal Error");
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com 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: Php Questions <php_questions
juiceplus.com> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Thursday, October 04, 2001 5:48 PM Subject: Upgrade Issue
Today, I upgraded our development web server from PHP 4.02 to 4.06.
the exact configure string was:
./configure --with-apxs=/usr/sbin/apxs --with-mysql=/usr --with-mcrypt=/usr/ local/lib --enable-versioning --with-ldap=/usr/local
None of the support files (apache, mysql, mcrypt, openldap) were changed only the php tarball from their website.
Now I have this interesting problem:
the source: <? require("templates/virt_cust.inc") or error("Fatal Error");
produces this error message: Fatal error: Failed opening required '1' (include_path='.:/usr/local/lib/php') in /home/httpd/html/distsupp/templates/virt_cust_form.php on line 2
The file is there and it works fine when I remove the "or error(..." code from the end of line 2. It appears that adding this code causes require() to interpret the file name as a boolean TRUE.
This problem did not happen with 4.02.
Does anyone know of a configuration option or anything I can correct to make this syntax work again with 4.06?
attached mail follows:
"Lasse" <lm
nospam.dk> wrote:
> Is it just me or is this site blazingly fast? Are you using some
> cache-tricks or something? Or du you just have an over-powered
under-loaded
> server?
>
> I could use a bit of speed at my own site.. :-)
You'll probably be surprised to know that the server is a Cobalt RaQ4, marketed by Sun as a "server appliance". The box has a 450 mHz processor and 1/2 GB of RAM. It's hardly a cutting edge server in terms of processor speed, though I've been fairly pleased with the RaQ line since its inception and continue to work with them heavily since I do a fair amount of server administration and application development for hosting companies and other businesses running RaQs. The perceived speed is partly due to the fact that the box operates under a modest load, is in a data center with good connectivity and your browser likely caches the images which are shared among all pages. There is no server-side caching. All of the content on it is generated dynamically, though I could easily create static pages for that particular site. I'm also a big fan of controlling related web pages from a single PHP script by configuring Apache to point requests to this script using the AliasMatch directive so that the end user and search engines thinks the content is static and the URLs don't get cluttered with ugly query strings. However that doesn't improve speed, it actually degrades it.
Hope that helps,
-- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/
attached mail follows:
How do u fork?
Thanks ahead of time : )
attached mail follows:
You'll need to use & in the command to be executed.
That command may or may not need to be wrapped up in a shell script to muck with stdin/stderr/stdout so that PHP isn't waiting for those to be freed up... Or something like that. I don't really understand it, I just know that programs that use stdin/stdout/stderr have to be treated funky.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com 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: Paul Procacci <procacci
procacci.net> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Thursday, October 04, 2001 10:12 PM Subject: stupid newbie question
> How do u fork? > > Thanks ahead of time : ) >
attached mail follows:
Ok, I found out what was causing some of the people who were using my script and have it fail. They are on a shared server and apache is being run as user nobody, so therefore the script is being run as nobody. But the the files has to have user ownership foo foo. Is it at all possible to have a script run as one user and create files as another. Dont know if it is even safe?? Or could you point me in another direction? Thanks
attached mail follows:
You *CAN* do that with PHP as CGI wrapped with suexec... But you lose performance, and you'll have to convince the ISP to install that as a second mime-type with a different extension... They'll need to read the suexec docs at http://apache.org first and foremost. (Doing suexec incorrectly is quite dangerous)
Other option is to chown or chmod the files to allow nobody to do what nobody needs to do -- Of course, that opens those files up for any other users on the shared server to mess with, and it's probably easier for an external hacker to gain "nobody" access than a real user.
Safety is relative. How critical are these files, and how much do you trust fellow users on a shared resource web-server?
You could also write some world-executable shell scripts that provide "nobody" with very specific actions they can do to/with the files -- You want to write that script as limited and carefully as possible so that *ONLY* the things you want to happen can happen.
Bottom line: Unless you go hard-core with suexec, anything you set up can be figured out and potentially abused by any fellow users on the ISP.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com 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: Gerard Samuel <trini0
optonline.net> Newsgroups: php.general To: PHP <php-general
lists.php.net> Sent: Thursday, October 04, 2001 7:24 PM Subject: php, files, ownership....(was file manipulation)
> Ok, I found out what was causing some of the people who were using my > script and have it fail. They are on a shared server and apache is > being run as user nobody, so therefore the script is being run as > nobody. But the the files has to have user ownership foo foo. Is it at > all possible to have a script run as one user and create files as > another. Dont know if it is even safe?? > Or could you point me in another direction? > Thanks > > > >
attached mail follows:
I just sent an email just before reading this, to the developers I report to. I suggested that we take out the nice little feature I worked so hard on. I dont think it would be benificial to people Im writing it for, if it doesn't work for a great number of people who have their websites on a shared server. Oh well, back to the drawing board for my next plan to take over the world.... :)
Thanks
Richard Lynch wrote:
> You *CAN* do that with PHP as CGI wrapped with suexec... But you lose
> performance, and you'll have to convince the ISP to install that as a second
> mime-type with a different extension... They'll need to read the suexec
> docs at http://apache.org first and foremost. (Doing suexec incorrectly is
> quite dangerous)
>
> Other option is to chown or chmod the files to allow nobody to do what
> nobody needs to do -- Of course, that opens those files up for any other
> users on the shared server to mess with, and it's probably easier for an
> external hacker to gain "nobody" access than a real user.
>
> Safety is relative. How critical are these files, and how much do you trust
> fellow users on a shared resource web-server?
>
> You could also write some world-executable shell scripts that provide
> "nobody" with very specific actions they can do to/with the files -- You
> want to write that script as limited and carefully as possible so that
> *ONLY* the things you want to happen can happen.
>
> Bottom line: Unless you go hard-core with suexec, anything you set up can
> be figured out and potentially abused by any fellow users on the ISP.
>
> --
> WARNING richard
zend.com address is an endangered species -- Use
> ceo
l-i-e.com
> 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: Gerard Samuel <trini0
optonline.net>
> Newsgroups: php.general
> To: PHP <php-general
lists.php.net>
> Sent: Thursday, October 04, 2001 7:24 PM
> Subject: php, files, ownership....(was file manipulation)
>
>
>
>>Ok, I found out what was causing some of the people who were using my
>>script and have it fail. They are on a shared server and apache is
>>being run as user nobody, so therefore the script is being run as
>>nobody. But the the files has to have user ownership foo foo. Is it at
>>all possible to have a script run as one user and create files as
>>another. Dont know if it is even safe??
>>Or could you point me in another direction?
>>Thanks
>>
>>
>>
>>
>>
>
>
attached mail follows:
> (From behind filing cabinet where I am ducking preparing for flames). > > Is it just me or is there anyone else that thinks PHP suffers > from not being modular.
It is just you and some other people similar to you. Thought this question was up for a while :-)
> PHP on the other hand seems to load in ALL the code that MAY > be run. i.e. an include brings things in which are inside an > if, even if the if equates to false.
Is it really true? I always though it wasn't. AFAIN: Long time ago require() was working this way. But now, require() and include() are the same. Loaded only when needed.
> This means that the language is not extendible in the way > others are. If you do write a function you wish to include > in 'only the pages you wish to use' you have to first > include it, then call it.
Well, it has it's pluses and it's minuses, it is extendable, though OOD works a little different in it. But hey, it compiles on the fly, remember? That's a plus for developers, especially newbies.
> This has also meant that things like spell checking functions > are built into the core module rather than called in as or > when they are needed. > > Then there is the way database connectivity is handled. > > There are a load of functions (again in the core language) > with there NAMES containing the name of the database you are > connecting to.
OK, true. But, this is necessary if you want PHP to automatically connect to different DBs. A plus to portability and a minus to... (to what?)
> For example all MySQL functions are mysql_something and I > guess all oracle ones are oracle_something. This would only > be a minor inconvenience because wrapper functions can be > written but from what I can gather different databases have > different functionality available.
That is why Sascha Sunmann wrote PHPLIB and (Stig?) Bakken created PEAR (released with every PHP distribution, btw - just waiting for you to use it)
phplib.netuse.de php.net/pear
> I know this is partly because different databases have > different functionality. what I would expect to see is a > load of generic function which attempt to provide same > functionality where it is available or implement some of the > functionality themselves. Obviously for some of the less > sophisticated databases these functions would have to do more > work and maybe some functionality wouldn't be available in > certain databases (but only the things like stored procedures). > > Got a nast feeling that ASP (spit) does something like this. > > You may cry, it cant be done. however I remember a > connectivity product that came from Borland (this was back in > the Paradox Days) which did just this, it even had > transaction handling built into this connectivity layer for DBase! > > Anyway I am playing Devils Advocate.
We all play it once at least ;-)
> What I do like about PHP is how quickly it can be learnt and > how quick you can build apps with it. Maybe this is at the > expense of elegance. Maybe PHP5 will address these issues -;)
Isn't it the greatest thing of it? Just think of this - where else you can become a programmer in a short time? Compliling/executing/libraring/connecting just to make a simple guestbook for your site.
> And there are certainly some very busy PHP sites, you should > see the traffic levels on indymedia.org during > anti-capitalist demonstrations and I am sure during the New > York attacks they went belistic.
Search archives for "php sites" or something like this. The topic comes up every week or so :-)
Maxim Maletsky www.PHPBeginner.com
attached mail follows:
> > PHP on the other hand seems to load in ALL the code that > MAY be run. > > i.e. an include brings things in which are inside an if, > even if the > > if equates to false. > > A quick check in the manual, it states that: > > "Unlike include(), require() will always read in the target > file, even if the line it's on never executes. If you want to > conditionally include a file, use include(). The conditional > statement won't affect the require(). However, if the line on > which the require() occurs is not executed, neither will any > of the code in the target file be executed. " > http://www.php.net/manual/en/function.require.php > and > http://www.php.net/manual/en/function.require-once.php > > > So to do what you said i.e. conditionally load the > function/files that you want then you should use include(). > http://www.php.net/manual/en/function.include.php > and > http://www.php.net/manual/en/function.include-once.php > > So I don't buy this agument.
This is outdated. Look int othe archives - I had this discussion with Zeev close to a year ago - since PHP 4.0.(something) require and include behaves in the exactly same way.
Test it yourself on the latest release of PHP:
require.test.php ---- <?
echo 'included?';
if($go) require 'require.error.test';
?> ----
require.error.test ---- <?
echo '<H1>yup!</H1>';
parse error;
?> ----
Access it with: 1. require.test.php?go=e
And then try it with: 2. require.test.php
What do you buy now?
Maxim Maletsky www.PHPBeginner.com
attached mail follows:
Of cource changing the require with include would explain everything :-) Sorry, forgot to mention that :-)
Maxim Maletsky www.PHPBeginner.com
> -----Original Message-----
> From: Maxim Maletsky (PHPBeginner.com)
> [mailto:php-general
phpbeginner.com]
> Sent: venerdě 5 ottobre 2001 3.33
> To: 'Opec Kemp'; php-general
lists.php.net
> Subject: RE: [PHP] PHP is a Bloated Kludge, discuss!
>
>
> > > PHP on the other hand seems to load in ALL the code that
> > MAY be run.
> > > i.e. an include brings things in which are inside an if,
> > even if the
> > > if equates to false.
> >
> > A quick check in the manual, it states that:
> >
> > "Unlike include(), require() will always read in the target
> > file, even if the line it's on never executes. If you want to
> > conditionally include a file, use include(). The conditional
> > statement won't affect the require(). However, if the line on
> > which the require() occurs is not executed, neither will any
> > of the code in the target file be executed. "
> > http://www.php.net/manual/en/function.require.php
> > and
> > http://www.php.net/manual/en/function.require-once.php
> >
> >
> > So to do what you said i.e. conditionally load the
> > function/files that you want then you should use include().
> > http://www.php.net/manual/en/function.include.php
> > and
> > http://www.php.net/manual/en/function.include-once.php
> >
> > So I don't buy this agument.
>
> This is outdated. Look int othe archives - I had this
> discussion with Zeev close to a year ago - since PHP
> 4.0.(something) require and include behaves in the exactly same way.
>
> Test it yourself on the latest release of PHP:
>
>
> require.test.php
> ----
> <?
>
> echo 'included?';
>
> if($go)
> require 'require.error.test';
>
> ?>
> ----
>
> require.error.test
> ----
> <?
>
> echo '<H1>yup!</H1>';
>
> parse error;
>
> ?>
> ----
>
> Access it with:
> 1. require.test.php?go=e
>
> And then try it with:
> 2. require.test.php
>
>
> What do you buy now?
>
>
> Maxim Maletsky
> www.PHPBeginner.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail:
> php-general-help
lists.php.net To contact the list
> administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
I think the implication of the oringal poster was not the include/requires stuff, but more a build of PHP with --enable-1000000 options vs php-shared....etc
-----Original Message-----
From: Maxim Maletsky (PHPBeginner.com)
[mailto:php-general
phpbeginner.com]
Sent: Friday, 5 October 2001 11:33 AM
To: 'Opec Kemp'; php-general
lists.php.net
Subject: RE: [PHP] PHP is a Bloated Kludge, discuss!
> > PHP on the other hand seems to load in ALL the code that > MAY be run. > > i.e. an include brings things in which are inside an if, > even if the > > if equates to false. > > A quick check in the manual, it states that: > > "Unlike include(), require() will always read in the target > file, even if the line it's on never executes. If you want to > conditionally include a file, use include(). The conditional > statement won't affect the require(). However, if the line on > which the require() occurs is not executed, neither will any > of the code in the target file be executed. " > http://www.php.net/manual/en/function.require.php > and > http://www.php.net/manual/en/function.require-once.php > > > So to do what you said i.e. conditionally load the > function/files that you want then you should use include(). > http://www.php.net/manual/en/function.include.php > and > http://www.php.net/manual/en/function.include-once.php > > So I don't buy this agument.
This is outdated. Look int othe archives - I had this discussion with Zeev close to a year ago - since PHP 4.0.(something) require and include behaves in the exactly same way.
Test it yourself on the latest release of PHP:
require.test.php ---- <?
echo 'included?';
if($go) require 'require.error.test';
?> ----
require.error.test ---- <?
echo '<H1>yup!</H1>';
parse error;
?> ----
Access it with: 1. require.test.php?go=e
And then try it with: 2. require.test.php
What do you buy now?
Maxim Maletsky www.PHPBeginner.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
"conditionally load the function/files that you want then you should use include(). "
Was the implication of the poster I replied to.
To the original I replied commenting each of his arguments, therefore I knew his points.
Maxim Maletsky www.PHPBeginner.com
attached mail follows:
I currently thinking on doing some freelance PHP programming and web design for somebody. I have a pretty good idea on how much I will be chargin, however I am looking at putting this in writing. I was wondering if anybody had any example proposals/bids or web liks to where I can find such information so that I can create my own.
Thanks in advance.
attached mail follows:
Ive been playing around with ereg for about half an hour and having no joy because I dont really understand the medhod behind it and how it all works. But what im trying to do is check to see if a 9 digit string is all numbers and nothing else
$string1 = "123456789" $string2 = "123456abc"
how would I check either string with an IF statement and make it continue on string 1 (ie, all numbers) and error on string 2 (not all numbers).
Any suggestions ?
Thanks
Chris
--
Chris Aitken - Administration/Database Designer - IDEAL Internet
email: chris
ideal.net.au phone: +61 2 4628 8888 fax: +61 2 4628 8890
__-----------------------------------------__
It is said that if you line up all the cars in the world end to end,
some moron in a rotary will still to try and pass them
attached mail follows:
if(!preg_match("/^\d+$/",$string){ echo "$string has something other than a number"; }
-----Original Message-----
From: Chris Aitken [mailto:chris
ideal.net.au]
Sent: Thursday, October 04, 2001 9:34 PM
To: PHP General Mailing List
Subject: [PHP] ereg checking if its only numbers
Ive been playing around with ereg for about half an hour and having no joy because I dont really understand the medhod behind it and how it all works. But what im trying to do is check to see if a 9 digit string is all numbers and nothing else
$string1 = "123456789" $string2 = "123456abc"
how would I check either string with an IF statement and make it continue on string 1 (ie, all numbers) and error on string 2 (not all numbers).
Any suggestions ?
Thanks
Chris
--
Chris Aitken - Administration/Database Designer - IDEAL Internet
email: chris
ideal.net.au phone: +61 2 4628 8888 fax: +61 2 4628 8890
__-----------------------------------------__
It is said that if you line up all the cars in the world end to end,
some moron in a rotary will still to try and pass them
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
For additional commands, e-mail: php-general-help
lists.php.net
To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
With ereg it could be:
if(ereg(^[^[:digit:]]+$)) echo 'something else came through';
Untested though ...
Maxim Maletsky www.PHPBeginner.com
> -----Original Message-----
> From: Jack Dempsey [mailto:dempsejn
georgetown.edu]
> Sent: venerdě 5 ottobre 2001 3.42
> To: Chris Aitken; PHP General Mailing List
> Subject: RE: [PHP] ereg checking if its only numbers
>
>
> if(!preg_match("/^\d+$/",$string){
> echo "$string has something other than a number";
> }
>
> -----Original Message-----
> From: Chris Aitken [mailto:chris
ideal.net.au]
> Sent: Thursday, October 04, 2001 9:34 PM
> To: PHP General Mailing List
> Subject: [PHP] ereg checking if its only numbers
>
>
>
> Ive been playing around with ereg for about half an hour and
> having no joy because I dont really understand the medhod
> behind it and how it all works. But what im trying to do is
> check to see if a 9 digit string is all numbers and nothing else
>
> $string1 = "123456789"
> $string2 = "123456abc"
>
>
> how would I check either string with an IF statement and make
> it continue on string 1 (ie, all numbers) and error on string
> 2 (not all numbers).
>
>
> Any suggestions ?
>
>
>
> Thanks
>
>
> Chris
>
> --
> Chris Aitken - Administration/Database Designer - IDEAL Internet
> email: chris
ideal.net.au phone: +61 2 4628 8888 fax: +61
> 2 4628 8890
> __-----------------------------------------__
> It is said that if you line up all the cars in the world
> end to end,
> some moron in a rotary will still to try and pass them
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail:
> php-general-help
lists.php.net To contact the list
> administrators, e-mail: php-list-admin
lists.php.net
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail:
> php-general-help
lists.php.net To contact the list
> administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
try:
<? if(ereg("[0-9]{9}", $string)){ echo "Success, 9 numbers!"; } else { echo "Failure, not 9 numbers."; } ?>
There is a great book on regular expressions by o'reily.
Evan
*********** REPLY SEPARATOR ***********
On 10/5/01 at 11:33 AM Chris Aitken wrote:
>Ive been playing around with ereg for about half an hour and having no
>joy
>because I dont really understand the medhod behind it and how it all
>works.
>But what im trying to do is check to see if a 9 digit string is all
>numbers
>and nothing else
>
>$string1 = "123456789"
>$string2 = "123456abc"
>
>
>how would I check either string with an IF statement and make it continue
>on string 1 (ie, all numbers) and error on string 2 (not all numbers).
>
>
>Any suggestions ?
>
>
>
>Thanks
>
>
>Chris
>
>--
> Chris Aitken - Administration/Database Designer - IDEAL Internet
> email: chris
ideal.net.au phone: +61 2 4628 8888 fax: +61 2 4628 8890
> __-----------------------------------------__
> It is said that if you line up all the cars in the world end to end,
> some moron in a rotary will still to try and pass them
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>For additional commands, e-mail: php-general-help
lists.php.net
>To contact the list administrators, e-mail: php-list-admin
lists.php.net
ž
attached mail follows:
On Fri, 5 Oct 2001, Chris Aitken wrote:
>
> Ive been playing around with ereg for about half an hour and having no joy
> because I dont really understand the medhod behind it and how it all works.
> But what im trying to do is check to see if a 9 digit string is all numbers
> and nothing else
>
> $string1 = "123456789"
> $string2 = "123456abc"
>
>
> how would I check either string with an IF statement and make it continue
> on string 1 (ie, all numbers) and error on string 2 (not all numbers).
>
>
> Any suggestions ?
>
>
>
> Thanks
>
>
> Chris
>
> --
> Chris Aitken - Administration/Database Designer - IDEAL Internet
> email: chris
ideal.net.au phone: +61 2 4628 8888 fax: +61 2 4628 8890
> __-----------------------------------------__
> It is said that if you line up all the cars in the world end to end,
> some moron in a rotary will still to try and pass them
>
>
>
attached mail follows:
That's not regexps Rasmus! :) I always see you referring us the the manual! sometimes you refer to a function i never say in my life! ;)
"Rasmus Lerdorf" <rasmus
php.net> wrote in message
news:Pine.LNX.4.33.0110042351330.1317-100000
rasmus.php.net...
> http://php.net/is_numeric
>
> On Fri, 5 Oct 2001, Chris Aitken wrote:
>
> >
> > Ive been playing around with ereg for about half an hour and having no
joy
> > because I dont really understand the medhod behind it and how it all
works.
> > But what im trying to do is check to see if a 9 digit string is all
numbers
> > and nothing else
> >
> > $string1 = "123456789"
> > $string2 = "123456abc"
> >
> >
> > how would I check either string with an IF statement and make it
continue
> > on string 1 (ie, all numbers) and error on string 2 (not all numbers).
> >
> >
> > Any suggestions ?
> >
> >
> >
> > Thanks
> >
> >
> > Chris
> >
> > --
> > Chris Aitken - Administration/Database Designer - IDEAL Internet
> > email: chris
ideal.net.au phone: +61 2 4628 8888 fax: +61 2 4628
8890
> > __-----------------------------------------__
> > It is said that if you line up all the cars in the world end to end,
> > some moron in a rotary will still to try and pass them
> >
> >
> >
>
attached mail follows:
Subhrajyoti Moitra wrote: > hi, > i am having a little problem in using php with double byte character. > > a user enters double byte character in some html form.. this user data is converted into a gif image. and later stored in a mysql/pgsql database... > > i have no clue how go about doing this .. can someone please please please help me .. i am stuck.. >
Are you using mbstirng module? or not?
-- Yasuo Ohgaki
attached mail follows:
What is the best way to change linux passwords using a web .PHP interface? I currently allow FTP access to php enabled webhosting sites; which use safe mode, thus use real linux accounts.
Thus far I thought I would:
Write a real short C program which would call allow to go setpasswd <username> <passwd> passwd could perhaps be the crypt() version to provide better security? it would just call passwd, and ensure that username is not 'root' and a few other accounts ;)
Then I would put that program within the directory of executables allowed in safe mode. And just have a plain http post form to update the password, running over HTTPS.
Does this seem a good plan ... or are there better?
It also begs the question; how do I authenticate an account using php ... to login to their 'change password' feature? I have already spent alot of time trying to merge password files for different uses; Windows shares, Linux ones, for samba, and this and that, so it'd be nice to now have yet another passwd file :)
Siggy
-- Sigurd Magnusson Director www.totallydigital.co.nz
attached mail follows:
First off, if you don't already know, the linux passwords are stored in the /etc/passwd file (unless you have a shadow suite installed, in which case /etc/shadow would be a good bet.) Basing this on a shadow file, the file is a text document with one user per line. The entries are stored in the following format: username:passwd:last:may:must:warn:expire:disable:reserved. All you really need for changing the password is the passwd section, although the other sections could be useful.
The password is not stored as plaintext, has been crypted (may be a new word...). Now, if you aren't familier with crypt, it is based on the DES, which is a symetrical algorithm. The password (called salt in this case) is a two character string chosen from [a-zA-Z0-9./]. This means there are (getting calculator out...) ((2)26+10+2)squared=4096 possible versions of the string.
Now I don't know if a different salt is used for each user or if it is uniform throughout. I'll put together a script that crypts my password with every salt string possible and checks it against my shadow file, then tries that salt with other passwords on my box. Fun project.
So basically, you would have to find the correct salt, crypt the new password, then use PHP's file functions to manipulate the passwd/shadow file- which brings up yet another problem- security. Do you really want to give PHP access to your passwd/shadow file??? Also, if I were you I would verify their old password too... just in case bob tries to change sue's password.
If anything in here is outdated or just plain wrong please tell me.
Evan Nemerson
PS i thought /usr/bin/md5 should exist so here:
#!/usr/local/bin/php -q
<?php unset($argv[0]); echo md5(trim(implode(" ",$argv)))."\n"; ?>
On Thursday 04 October 2001 07:28 pm, you wrote: > What is the best way to change linux passwords using a web .PHP interface? > I currently allow FTP access to php enabled webhosting sites; which use > safe mode, thus use real linux accounts. > > Thus far I thought I would: > > Write a real short C program which would call allow to go > setpasswd <username> <passwd> > passwd could perhaps be the crypt() version to provide better > security? it would just call passwd, and ensure that username is not 'root' > and a few other accounts ;) > > Then I would put that program within the directory of executables allowed > in safe mode. And just have a plain http post form to update the password, > running over HTTPS. > > Does this seem a good plan ... or are there better? > > It also begs the question; how do I authenticate an account using php ... > to login to their 'change password' feature? I have already spent alot of > time trying to merge password files for different uses; Windows > shares, Linux ones, for samba, and this and that, so it'd be nice to now > have yet another passwd file :) > > Siggy
attached mail follows:
Hmmm mandrake 8 uses a different algorithm... not md5... outputs 34 characters, $ and / included (i think DES outputs alpha-numeric only. not sure though). I sent an e-mail to a mandrake mailing list, until then here's what I wrote before I actually looked at my /etc/shadow file. Should work for other distros...
On Thursday 04 October 2001 09:41 pm, you wrote: > First off, if you don't already know, the linux passwords are stored in the > /etc/passwd file (unless you have a shadow suite installed, in which case > /etc/shadow would be a good bet.) Basing this on a shadow file, the file is > a text document with one user per line. The entries are stored in the > following format: > username:passwd:last:may:must:warn:expire:disable:reserved. All you really > need for changing the password is the passwd section, although the other > sections could be useful. > > The password is not stored as plaintext, has been crypted (may be a new > word...). Now, if you aren't familier with crypt, it is based on the DES, > which is a symetrical algorithm. The password (called salt in this case) is > a two character string chosen from [a-zA-Z0-9./]. This means there are > (getting calculator out...) ((2)26+10+2)squared=4096 possible versions of > the string. > > Now I don't know if a different salt is used for each user or if it is > uniform throughout. I'll put together a script that crypts my password with > every salt string possible and checks it against my shadow file, then tries > that salt with other passwords on my box. Fun project. > > So basically, you would have to find the correct salt, crypt the new > password, then use PHP's file functions to manipulate the passwd/shadow > file- which brings up yet another problem- security. Do you really want to > give PHP access to your passwd/shadow file??? Also, if I were you I would > verify their old password too... just in case bob tries to change sue's > password. > > If anything in here is outdated or just plain wrong please tell me. > > Evan Nemerson > > > PS i thought /usr/bin/md5 should exist so here: > > #!/usr/local/bin/php -q > > <?php > unset($argv[0]); > echo md5(trim(implode(" ",$argv)))."\n"; > ?> > > On Thursday 04 October 2001 07:28 pm, you wrote: > > What is the best way to change linux passwords using a web .PHP > > interface? I currently allow FTP access to php enabled webhosting sites; > > which use safe mode, thus use real linux accounts. > > > > Thus far I thought I would: > > > > Write a real short C program which would call allow to go > > setpasswd <username> <passwd> > > passwd could perhaps be the crypt() version to provide better > > security? it would just call passwd, and ensure that username is not > > 'root' and a few other accounts ;) > > > > Then I would put that program within the directory of executables allowed > > in safe mode. And just have a plain http post form to update the > > password, running over HTTPS. > > > > Does this seem a good plan ... or are there better? > > > > It also begs the question; how do I authenticate an account using php ... > > to login to their 'change password' feature? I have already spent alot of > > time trying to merge password files for different uses; Windows > > shares, Linux ones, for samba, and this and that, so it'd be nice to now > > have yet another passwd file :) > > > > Siggy
- text/x-c attachment: passwd
attached mail follows:
Richard Lynch wrote:
> httpd.conf
> php_value Engine Off or somesuch...
>
> --
> WARNING richard
zend.com address is an endangered species -- Use
> ceo
l-i-e.com
> 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
its "php_flag engine off"
---You might be interested in this too:
Copied from http://www.php.net/manual/en/features.safe-mode.php
If you do virutal hosting, you can turn safe mode on and off for different Apache Virutal Hosts using the php_admin_value directive. This also allows you to have customised maximum execution times, disabled functions, etc. By placeing a base_dir for each virutal host, this means PHP CANNOT access files below this heirachy; strongly recoomended for cutsomer hosting.
Eg:
[VirtualHost 127.0.0.1:80] DocumentRoot /var/www/html/safephphost/ ServerName safephp php_admin_value safe_mode 1 php_admin_value open_base_dir /var/www/html/safephphost/ php_admin_value sendmail_from phobo#paradise.net.nz [/VirtualHost]
Siggy
> ----- Original Message ----- > From: Matthew Walker <matt
mountaintopherbs.com> > Newsgroups: php.general > To: <php-general
lists.php.net> > Sent: Tuesday, October 02, 2001 4:30 PM > Subject: Restrict where PHP is Usable? > > >> I've seen this done before on servers, but I'm not sure how to do it. >> >> Is there a way to restrict PHP to certain directories, so that it can >> only be used by files within those directories? >> >> For example: I'm starting a web page hosting service, and I'd like to >> make it so that most users can't use PHP. They'll have to pay a (very >> small) monthly fee to have access to it. This is partly as a very loose >> security measure, so that not everyone has access to PHP. >> >> -- >> Matthew Walker >> Ecommerce Project Manager >> Mountain Top Herbs >> >> --- >> Outgoing mail is certified Virus Free. >> Checked by AVG anti-virus system (http://www.grisoft.com). >> Version: 6.0.282 / Virus Database: 150 - Release Date: 9/25/2001 >> >> > >
-- Sigurd Magnusson Director www.totallydigital.co.nz
attached mail follows:
Anyone know of a tool, linux based, that can mirror a dynamic website down to a static copy?
Can wget do this? I want to take my dynamic website that has a main navigation document such as navigation.php which takes query strings as to which info to pull from the database, and copy that down to a purely static .html version. Most/All of the internal page HREFs need to be rewritten, pages properly named, as well as the images pulled down.
thanks
_______________________________________________
Redhat-list mailing list
Redhat-list
redhat.com
https://listman.redhat.com/mailman/listinfo/redhat-list
attached mail follows:
I can't seem to get a return value, while using the functions, it just puts a 0 on the page, i try putting a <br> after i do the system call, still all that is on the page, 0, something is wrong, anyone know why?!?
I got no telnet access, and i want to do some cron jobs :D
- James "ReDucTor" Mitchell
attached mail follows:
On Fri, 5 Oct 2001 13:19, ReDucTor wrote: > I can't seem to get a return value, while using the functions, it just > puts a 0 on the page, i try putting a <br> after i do the system call, > still all that is on the page, 0, something is wrong, anyone know > why?!? > > I got no telnet access, and i want to do some cron jobs :D > > - James "ReDucTor" Mitchell
Perhaps if you show how you are doing this, it might be easier to help. Are you for instance using the return_var argument?
And in some cases, 0 is a valid return value; some programs may not return a value at all.
-- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIABest way to dispose of the Borg: Give them Windows 3.1.
attached mail follows:
echo System("crontab -l", $var)."<br>";
echo $var;
----- Original Message -----
From: "David Robley" <huntsman
www.nisu.flinders.edu.au>
To: "ReDucTor" <sjdtmv
tpg.com.au>; <php-general
lists.php.net>
Sent: Friday, October 05, 2001 2:21 PM
Subject: Re: [PHP] System(), exec(), Passthru(), etc
> On Fri, 5 Oct 2001 13:19, ReDucTor wrote:
> > I can't seem to get a return value, while using the functions, it just
> > puts a 0 on the page, i try putting a <br> after i do the system call,
> > still all that is on the page, 0, something is wrong, anyone know
> > why?!?
> >
> > I got no telnet access, and i want to do some cron jobs :D
> >
> > - James "ReDucTor" Mitchell
>
> Perhaps if you show how you are doing this, it might be easier to help.
> Are you for instance using the return_var argument?
>
> And in some cases, 0 is a valid return value; some programs may not
> return a value at all.
>
> --
> David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
> CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
>
> Best way to dispose of the Borg: Give them Windows 3.1.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
Dear php-general
lists.php.net,
WE are looking for serious inquires from individuals who want to make a difference!!!
Our company is offering an opportunity for individuals who want to become an E-Mail PROCESSOR. Work from home and be apart of this tremendous opportunity to sustain an income of your choice. Free 30 day trial membership, not MLM.
Requirements: Computer, internet hookup, some basic computer skills and a little time & effort.
SEND AN EMAIL TO: terrycrowe_webdirect2001
yahoo.com
WITH SUBJECT: "SHOW ME".
***Thanks for taking the time to look at this offer. Please
accept my apologies if this email has offended you in
any way. If you wish to no longer receive email please send
an email message to terrycrowe_webdirect2001
yahoo.com with "Remove"
placed in the subject line.***
Web Site; http://www.geocities.com/project_internetca/
attached mail follows:
I just want to thank everyone who helped me get the css stuff to work. All of the IF statements are now working properly --- I've certainly learned a lot from all the messages.
thanks again... Maxim Maletsky Rasmus Lerdorf
and all others who responded to my message!
__________________ Jason Dulberg Extreme MTB http://extreme.nas.net
> I have a common css file that is being used across several virtual > hosts. Basically, what I am trying to do is use the same css file even > though several text colors/sizes need to be changed depending on what > site/platform its being used on.
attached mail follows:
You have the same requirement
Put this wherever you want in your script.
<?php if (true) // whatever the condition { echo "<script language=JavaScript> alert('Message!') </script>"; } ?>
----- Original Message -----
From: "Eduardo Kokubo" <kokubo
inf.univali.br>
To: "Naintara Jain" <naintara.jain
in.velocient.com>
Sent: Thursday, October 04, 2001 4:56 PM
Subject: Re: [PHP] something like alert (javascript)
This is probably the best solution. I'll try something like this. Thanks.
----- Original Message -----
From: Naintara Jain <naintara.jain
in.velocient.com>
To: Eduardo Kokubo <kokubo
inf.univali.br>
Sent: Thursday, October 04, 2001 8:19 AM
Subject: Re: [PHP] something like alert (javascript)
> You could try:
> <?php
> if (files < 4) // whatever the condition
> {
> echo "<script language=JavaScript>
> alert('Unfinished business!') </script>";
> }
> ?>
> -Naintara
>
> ----- Original Message -----
> From: "Eduardo Kokubo" <kokubo
inf.univali.br>
> To: "Maxim Maletsky (PHPBeginner.com)" <php-general
phpbeginner.com>
> Cc: <php-general
lists.php.net>
> Sent: Thursday, October 04, 2001 4:45 PM
> Subject: Re: [PHP] something like alert (javascript)
>
>
> I'm implementing a system that allows the users create pages on-line. They
> can create several different pages to complete a site. What I want to do
is
> alert them that there are still pages to be created before they finish.
I'm
> trying to do it checking the files they create and alerting a message, but
I
> think javascript can not check the files and php can not alert the user
with
> a function like alert(). I'm using a simple print() (PHP) but alert()
would
> be much better.
>
> ----- Original Message -----
> From: Maxim Maletsky (PHPBeginner.com) <php-general
phpbeginner.com>
> To: 'Eduardo Kokubo' <kokubo
inf.univali.br>; <php-general
lists.php.net>
> Sent: Wednesday, October 03, 2001 11:38 AM
> Subject: RE: [PHP] something like alert (javascript)
>
>
> > Then what do you need?
> >
> > We are not any sure on what your question is ...
> >
> > Maxim Maletsky
> > www.PHPBeginner.com
> >
> >
> > -----Original Message-----
> > From: Eduardo Kokubo [mailto:kokubo
inf.univali.br]
> > Sent: mercoledě 3 ottobre 2001 16.31
> > To: php-general
lists.php.net
> > Cc: kokubo
inf.univali.br
> > Subject: [PHP] something like alert (javascript)
> >
> >
> > Is there any function in PHP that is similar to alert() or confirm() of
> > javascript ? I tried die() but that's not what I need.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
----- Original Message -----
From: "Tim Sawyer" <tsawyer
telcom.lgb.cal.boeing.com>
To: <php-general
lists.php.net>
Sent: Friday, October 05, 2001 12:46 AM
Subject: [PHP] popup window under php
I want to open a popup window under php control. So lets say I have an if statement which if true opens the window.
if ($something) { JavaScript:window.open("test.php",blah...); }
Guess I'm saying that I want to call a Javascript function without the user clicking on anything.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
> I always depreciated WYSIWYG software, especially when they mention > those things about HTML. HTML is the alphabet of the internet and as > such should be well known by any webmaster and whoever else is > interested in this kind of software. > > Still, it feels like it is better than Dreamveawer and Microsoft > FrontPage (oh boy, I pronounced devil's name)
Exactly my thoughts but it seems we are more in the minority. My neighbor mentioned his girlfriend taking a web class and he complained that they use Notepad for their editing. "Who uses Notepad?", he asked. Yet he was suprised when she was showing him a thing or two. WYSIWYG editors are nice for general things like layout (I use Dreamweaver to help layout any table in a table stuff) but I haven't ran across a editor yet that makes solid code.
Joel
attached mail follows:
To see exactly what image functions that are or aren't available to you, try running this script.
<?php
$func= array("GetImageSize", "ImageArc", "ImageChar", "ImageCharUp", "ImageColorAllocate", "ImageColorDeAllocate", "ImageColorAt", "ImageColorClosest", "ImageColorExact", "ImageColorResolve" , "ImageGammaCorrect", "ImageColorSet", "ImageColorsForIndex", "ImageColorsTotal", "ImageColorTransparent", "ImageCopy", "ImageCopyResized", "ImageCreate", "ImageCreateFromGIF", "ImageCreateFromJPEG", "ImageCreateFromPNG", "ImageCreateFromWBMP", "ImageCreateFromString", "ImageDashedLine", "ImageDestroy", "ImageFill", "ImageFilledPolygon", "ImageFilledRectangle", "ImageFillToBorder", "ImageFontHeight", "ImageFontWidth", "ImageGIF", "ImagePNG", "ImageJPEG", "ImageWBMP", "ImageInterlace", "ImageLine", "ImageLoadFont", "ImagePolygon", "ImagePSBBox", "ImagePSEncodeFont", "ImagePSFreeFont", "ImagePSLoadFont", "ImagePsExtendFont", "ImagePsSlantFont", "ImagePSText", "ImageRectangle", "ImageSetPixel", "ImageString", "ImageStringUp", "ImageSX", "ImageSY", "ImageTTFBBox", "ImageTTFText", "ImageTypes", "read_exif_data");
?>Have:<br> ------<BR><? for ($i = 0; $i < count($func); $i++) { if (function_exists($func[$i])) { print $func[$i] . "()<BR>"; } } ?><br><Br>Don't Have:<br> ------------<BR><? for ($i = 0; $i < count($func); $i++) { if (!function_exists($func[$i])) { print $func[$i] . "()<BR>"; } }
?>
----- Original Message -----
From: "Richard Lynch" <ceo
l-i-e.com>
To: "Adrian D'Costa" <adrian
pcsadvt.com>
Cc: <php-general
lists.php.net>
Sent: Wednesday, October 03, 2001 12:18 AM
Subject: [PHP] Re: images no appearing
> Older versions of GD will do GIF, but not JPEG, and vice versa...
>
> What versions of GD are on the two servers?
>
> --
> WARNING richard
zend.com address is an endangered species -- Use
> ceo
l-i-e.com
> 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: Adrian D'Costa <adrian
pcsadvt.com>
> Newsgroups: php.general
> To: php general list <php-general
lists.php.net>
> Sent: Monday, September 24, 2001 12:05 AM
> Subject: images no appearing
>
>
> > Hi,
> >
> > I wrote a php script to create a dynamic graph (image/jpeg). On my
> > development system the image appears on my website it gives Image/Jpeg
> > support not compiled.
> >
> > Below are the config settings:
> >
> > My system:
> > Configure Command ^
'./configure' '--prefix=/usr'
> > ^
'--with-config-file-path=/etc' '--disable-debug'
> > ^
'--enable-pic' '--enable-inline-optimization'
> > ^
'--enable-sockets' '--with-apxs=/usr/sbin/apxs'
> > ^
'--disable-static' '--with-exec-dir=/usr/bin'
> > ^
'--with-regex=system' '--with-gd'
> > ^
'--with-jpeg-dir=/usr' '--with-png' '--with-gdbm'
> > ^
'--enable-debugger' '--enable-magic-quotes'
> > ^
'--enable-safe-mode' '--enable-track-vars'
> > ^
'--enable-ftp' '--with-mysql' '--with-xml'
> > ^
'--enable-trans-sid'
> > ^
'--with-readline=/usr/include/readline'
> >
> > My webserver the info can be got from vvmm.net/phpinfo.php.
> >
> > They my provider has given --with-jpeg-dir=/usr/lib still the image does
> > not appear. Even in the gd section it does not give JPG Support
> > enabled. Only give. Right now I have changed the program to work with
> > gif. My question, why not Jpg??
> >
> > Adrian
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
hi all,
I've been asked to do some work on some servers where php can only run as cgi. Unfortunately it seems that php has a bug which means that
#!/usr/local/bin/php
gets printed out at the top of each page if I do this.
Are there any workarounds for this? Is it fixed in the cvs versions?
thanks,
James.
-- "I'm not vegetarian becuase I love animals; I'm vegetarian because I hate plants." - unknown.
attached mail follows:
Did you uncomment the LoadModule/AddModule for PHP?
Or add an Action line?...
AddType is only half the puzzle piece...
It sets up a mime-type (application/x-httpd-php) for an extension (.php) but doesn't say what to *DO* with that mime-type.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com 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: Rg <rg
blanktv.com> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Tuesday, October 02, 2001 11:51 PM Subject: help! linux 7 problems
> hi, > > i installed php4 onto my linux 7.0 system along with apache and mysql. > > the apache and mysql work. > > once i did 'make install' for php, i changed the http.conf file in > apache so that the > AddType lines were uncommented out and the file extensions should be > recongized. > > i've done this on windows and it worked. > > now, however, when i try to path to a .php file like localhost/test.php, > it tries > to save the file to disk instead of executing the code. > > anybody know why? > > thanks, > > rg >
attached mail follows:
I'm no expert install guy, but...
I believe errno.h should be in one or more of these places where PHP can find it:
/usr/include /usr/src/linux-blah-blah-blah
Or, try this: updatedb <---- might take a while locate errno.h
Figure out why errno.h isn't where PHP expects it to be, and make it be there by copying it or creating a symlink (man ln)
Odds are good that if errno.h is missing, is every other .h file sitting next to it, so get them all in one go.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com 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: Augusto cesar castoldi <accastoldi
yahoo.com.br> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Wednesday, October 03, 2001 6:00 AM Subject: Really need HELP on PHP install > Error in "make"
> Hi... I really need help for compile PHP. I have to > compile because the previous compiling didn't have > "-with-dom" option. > > I "./configure" my php-4.0.6 in RedHat 6.2 with this > command line: > "./configure --with-mysql > --with-apache=../apache_1.3.20 --enable-track-vars > --with-dom=../libxml2-2.4.5 > --with-java=/usr/local/jdk1.3.1/ > --with-zlib-dir=/usr/src/redhat/SOURCES/zlib-1.1.3/" > > Worked fine, but when I "make", this error occurs: > ----------------------------------------------------- > [root
vendaval php-4.0.6]# make > Making all in Zend > make[1]: Entering directory > `/home/augusto/src/php-4.0.6/Zend' > /bin/sh ../libtool --silent --mode=compile gcc > -DHAVE_CONFIG_H -I. -I. -I../main -DSUPPORT_UTF8 > -DXML_BYTE_ORDER=12 -g -O2 -c zend_language_scanner.c > In file included from /usr/include/errno.h:36, > from zend_language_scanner.c:2718: > /usr/include/bits/errno.h:25: linux/errno.h: No such > file or directory > make[1]: *** [zend_language_scanner.lo] Error 1 > make[1]: Leaving directory > `/home/augusto/src/php-4.0.6/Zend' > make: *** [all-recursive] Error 1 > [root
vendaval php-4.0.6] > ------------------------------------------------------ > > can you help? > > regards, > > Augusto > > > ____________________________________________________________________________ ___________________ > Yahoo! GeoCities > Tenha seu lugar na Web. Construa hoje mesmo sua home page no Yahoo! GeoCities. É fácil e grátis! > http://br.geocities.yahoo.com/
attached mail follows:
You could roll your own...
% and (int) / and round() are all you need.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com 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: Bill Rausch <bill
numerical.com> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Wednesday, October 03, 2001 10:40 AM Subject: printf scientific notation?
> I'll try this again, with a new topic and a better description. > > Can PHP print floating point numbers using scientific notation? > (like 1.32e+5) sscanf reads them ok using %f, but I'd like to print > them with %e or %g and the printf documentation doesn't mention them. > > I've tried %e anyway and it fails to print the exponent part. > > I've looked at the source code to PHP a little but with the IFDEFs > I'm not sure which routine is actually being used. I sort of have the > impression it is just calling the C routines directly so the %e and > %g should work? > > Linux (RH 7.1), Apache (1.3.20), PHP (4.0.6) > > Thanks. > -- > Bill Rausch, Software Development, Unix, Mac, Windows > Numerical Applications, Inc. 509-943-0861 bill
numerical.com
attached mail follows:
You have to http://php.net/fopen (or http://php.net/curl for SSL page) the login page, get the headers, snarf out the cookies or whatever, generate the appropriate cookie headers to send back on the next page (and every page thereafter).
Your goal is to "fake out" the web server into thinking you're really a web-browser.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com 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: _lallous <elias_bachaalany
yahoo.com> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Thursday, October 04, 2001 4:48 AM Subject: How can I simulate the login process?
> I want to write a script that simulates the login process and logs on and > grabs some pages (that can only be viewed when logged in) and the logs > out... > how can i do that? > > consider the authentication system is done via session variables method... > > any ideas would help. > >
attached mail follows:
what if they were session variables...how can i fake that out?
can you plz give me an example on how to make a header with cookies before requesting a page?
"Richard Lynch" <ceo
l-i-e.com> wrote in message
news:046401c14d62$917ce620$c801a8c0
Lynchux100...
> You have to http://php.net/fopen (or http://php.net/curl for SSL page) the
> login page, get the headers, snarf out the cookies or whatever, generate
the
> appropriate cookie headers to send back on the next page (and every page
> thereafter).
>
> Your goal is to "fake out" the web server into thinking you're really a
> web-browser.
>
> --
> WARNING richard
zend.com address is an endangered species -- Use
> ceo
l-i-e.com
> 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: _lallous <elias_bachaalany
yahoo.com>
> Newsgroups: php.general
> To: <php-general
lists.php.net>
> Sent: Thursday, October 04, 2001 4:48 AM
> Subject: How can I simulate the login process?
>
>
> > I want to write a script that simulates the login process and logs on
and
> > grabs some pages (that can only be viewed when logged in) and the logs
> > out...
> > how can i do that?
> >
> > consider the authentication system is done via session variables
method...
> >
> > any ideas would help.
> >
> >
>
attached mail follows:
Read php.ini
Not sure you can set it on a site-by-site basis or within Directory in httpd.conf or not though.
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com 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: Rosen <rosen_dm
dir.bg> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Thursday, October 04, 2001 3:31 AM Subject: Session ID
> Hi, > I'm creating web site with sessions. > Normally the site uses PHPSESSID to pass session ID to next page. > I want to use some script whitch use SID to pass session ID. > Can I set standart (i.e. PHPSESSID ) to use to pass session ID ? > > Thanks, > Rosen > >
attached mail follows:
Sorry, I can't access php.ini. It's on server, outside !!!
Thanks, Rosen
"Richard Lynch" <ceo
l-i-e.com> wrote in message
news:046301c14d62$865a8ea0$c801a8c0
Lynchux100...
> Read php.ini
>
> Not sure you can set it on a site-by-site basis or within Directory in
> httpd.conf or not though.
>
> --
> WARNING richard
zend.com address is an endangered species -- Use
> ceo
l-i-e.com
> 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: Rosen <rosen_dm
dir.bg>
> Newsgroups: php.general
> To: <php-general
lists.php.net>
> Sent: Thursday, October 04, 2001 3:31 AM
> Subject: Session ID
>
>
> > Hi,
> > I'm creating web site with sessions.
> > Normally the site uses PHPSESSID to pass session ID to next page.
> > I want to use some script whitch use SID to pass session ID.
> > Can I set standart (i.e. PHPSESSID ) to use to pass session ID ?
> >
> > Thanks,
> > Rosen
> >
> >
>
attached mail follows:
Did you spell apx like that or apxs like you should?...
You should have ended up with a libphp.so to throw into Apache's modules directory, not a binary for /usr/local/bin...
You needed that binary for cron scripts anyway, though :-)
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com 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: Max <max
demoproject.com> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Thursday, October 04, 2001 11:43 AM Subject: installation prob.
> hi, > I've done my first php installation on a *nix box ... > after unzipping the tar, I've done: > > /configure --with-mysql --with-apx > make > make install > (and I've put the php.ini in the right location) > > Now I have a binary php interpreter (and it works fine) in /usr/local/bin and > so I've tried to configure apache to parse all php file > using /usr/local/bin/php > > on the apache's httpd.conf I've set: > > ScriptAlias /php/ "/usr/local/bin/" > Action application/x-httpd-php "/php/php" > AddType application/x-httpd-php .php .phtml > > but this doens't work ... :( > (I've restarted my apache server) > > Can anyone help me, please? > > many thanks in advance > max >
attached mail follows:
Try following the instructions for core dumps at http://bugs.php.net
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com 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: Edson Toshiya <toshiya
ieg.com.br> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Thursday, October 04, 2001 12:46 PM Subject: Apache + PHP + libswf problems
> Hi, > > I've compiled PHP with swf support, the installation was normal but when I > try to test the swf I got this on Apache error log: > > [Thu Oct 4 13:15:58 2001] [notice] child pid 27998 exit signal Segmentation > fault (11) > > Any idea ? > > Regards, > > Edson T. > > >
attached mail follows:
It *should* be able to... That's the whole point of the darn things. :-)
Is 0x576a the correct key?... Sure PHP isn't treating that as a string or something?
-- WARNING richardzend.com address is an endangered species -- Use ceo
l-i-e.com 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: Rick Turbeville <rickt
cfw.com> Newsgroups: php.general To: <php-general
lists.php.net> Sent: Thursday, October 04, 2001 2:52 PM Subject: Problem with sem_get and semaphores
> Hi, > > I am trying to do a sem_get on a semaphore that has already been created by > a c program. Instead of getting back the semaphore id, I get: > > Warning: semget() failed for key 0x576a: Inva