|
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: Sat May 11 2002 - 03:55:18 CDT
php-general Digest 11 May 2002 08:55:18 -0000 Issue 1338
Topics (messages 97004 through 97072):
Re: Debugger
97004 by: Austin Marshall
97006 by: 1LT John W. Holmes
97063 by: Jason Wong
97064 by: Rasmus Lerdorf
97065 by: Jason Wong
Re: Alternating table rows...
97005 by: Juan Pablo Aqueveque
97045 by: David Freeman
Alternating Table Rows, Part Deux..
97007 by: Glenn Sieb
97008 by: Robert Cummings
97011 by: 1LT John W. Holmes
97013 by: Robert Cummings
97021 by: Austin Marshall
97022 by: Miguel Cruz
97024 by: Austin Marshall
97026 by: Glenn Sieb
97027 by: Shaun Thomas
97028 by: Glenn Sieb
97031 by: Glenn Sieb
Re: eregi(mail)
97009 by: Manuel Lemos
97014 by: Nathan Cassano
97015 by: Miguel Cruz
Re: Apache is not rendering php pages. Config problem?
97010 by: Eugene Lee
97016 by: Andy
97018 by: Sven Herrmann
97025 by: Andy
97029 by: Javier
97030 by: Eugene Lee
97033 by: Andy
97049 by: Liam MacKenzie
Re: Using caching to reduce database queries
97012 by: Manuel Lemos
Getting PHP on FreeBSD to talk to MSSQL Server 7...
97017 by: Glenn Sieb
97020 by: Dave Goodrich
97056 by: Michael Kimsal
Re: "Self Destruct Code" & "Copy Protection"
97019 by: [-^-!-%-
Script Cannot Read File Field
97023 by: Dr. Shim
97066 by: Jason Wong
Re: virtual host problem
97032 by: Ian Newlands
httpS connection with FILE
97034 by: Bert Buckley
97035 by: Stuart Dallas
97036 by: Danny Shepherd
Re: log analysis
97037 by: Josh Edwards
Re: register_globals in php4
97038 by: Luc Saint-Elie
Layout Help
97039 by: Jason Soza
97044 by: David Freeman
97050 by: Austin Marshall
Using function in PHP script n DOCROOT in PHP script in subfolder
97040 by: Phil Powell
97060 by: Analysis & Solutions
97062 by: Miguel Cruz
97071 by: Miguel Cruz
Re: problems with <form></form>
97041 by: David Freeman
Re: Genus who came up with "Self Destruct Code" & "Copy Pro tection"
97042 by: David Freeman
MySQL or FlatFile
97043 by: David Duong
97048 by: Liam MacKenzie
97053 by: Austin Marshall
Re: randomize?
97046 by: David Freeman
Register Globals - Article
97047 by: Justin French
DOMXML [revisited]
97051 by: Thalis A. Kalfigopoulos
Any difference between these 2 forms of syntax?
97052 by: Richard Davey
97054 by: Austin Marshall
97055 by: Richard Davey
97057 by: Austin Marshall
97058 by: php3.developersdesk.com
97061 by: Miguel Cruz
PHP >? for current PEAR
97059 by: Brad Hubbard
Packages Installed In html/doc root
97067 by: Dennis Gearon
PHP Powers FreeMovie API for Flash
97068 by: Jacek Artymiak
Display mail
97069 by: Uma Shankari T.
97070 by: Miguel Cruz
protecting downloads with php
97072 by: Nick Wilson
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:
Jose Leon wrote:
>>php -l will let you know where your syntax errors are.
>
>
> What?
>
> Regards
>
If you invoke the interpreter from the command line (CGI). You can use
the -l flag to enable lint mode... that will check your script for parse
errors. So in a way, PHP does have a "debug" mode.
attached mail follows:
> > php -l will let you know where your syntax errors are.
>
> What?
>
He said "php -l will let you know where your syntax errors are."
Helping out where I can,
---John Holmes...
attached mail follows:
On Saturday 11 May 2002 04:07, Austin Marshall wrote:
> Jose Leon wrote:
> >>php -l will let you know where your syntax errors are.
> >
> > What?
> >
> > Regards
>
> If you invoke the interpreter from the command line (CGI). You can use
> the -l flag to enable lint mode... that will check your script for parse
> errors. So in a way, PHP does have a "debug" mode.
He wants a /real/ debugger. One in which you can step through instructions,
set break points, examine state of variables etc.
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Integrity has no need for rules. */
attached mail follows:
See DBG (http://dd.cron.ru/dbg/)
On Sat, 11 May 2002, Jason Wong wrote:
> On Saturday 11 May 2002 04:07, Austin Marshall wrote: > > Jose Leon wrote: > > >>php -l will let you know where your syntax errors are. > > > > > > What? > > > > > > Regards > > > > If you invoke the interpreter from the command line (CGI). You can use > > the -l flag to enable lint mode... that will check your script for parse > > errors. So in a way, PHP does have a "debug" mode. > > He wants a /real/ debugger. One in which you can step through instructions, > set break points, examine state of variables etc. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > Integrity has no need for rules. > */ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
On Saturday 11 May 2002 12:17, Rasmus Lerdorf wrote: > See DBG (http://dd.cron.ru/dbg/)
I think the OP has already looked at it, and wanted something better :)
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Never commit yourself! Let someone else commit you. */
attached mail follows:
Just another version. <?php
function useColor() {
static $ColorValue; // remember the last color
if ($ColorValue == "#00FF00") { $ColorValue ="#CCFFCC"; else { $ColorValue ="#00FF00"; }
return($ColorValue); }
?> the call ... $RowColor = useColor(); ... echo '<td bgcolor='.$RowColor.'>';
- Jp
At 15:46 10/05/02, you wrote: >[snip] ><? >$rowcount = 0; >while($dbrowa = mysql_fetch_object($dbseta)){ > $dbrowb = mysql_fetch_object($dbsetb); >//change the color of alternating rows >$rowcount ++; >if ($rowcount == 1){........too many lines of code >[/snip] > >I get humbled by this list every day. Could I have Single PHP Lines for a >thousand Alex? Dammit, still thinking like an old Basic programmer... > >Jay > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php
________________________________________________________
Juan Pablo Aqueveque <juque
uct.cl>
Ingeniero de Sistemas
Departamento de Redes y Comunicaciones http://www.drc.uct.cl
Universidad Católica de Temuco.
Tel:(5645) 205 630 Fax:(5645) 205 628
attached mail follows:
> I've been asked if I can alternate the colors of the > rows to make the report more legible.
What I usually do is something like this:
if ($colour == "blue") $colour = "red" else $colour = "blue";
Then the bit where you actually output display you use $colour to set display attributes and away you go.
CYA, Dave
attached mail follows:
Hey everyone!
Thanks for all the hints--here's what my boss and I eventually came out with:
/* ###################### ## And for every row of data we pull, we create a table row... ###################### */ $company = 0; $previous = ""; for ($i = 0; $i < mssql_num_rows( $stmt ); ++$i) { $line = mssql_fetch_row($stmt); $company += (strcmp($previous,$line[0]) ? 1 : 0); $color = (($company%2) ? "FFFFFF" : "FFFF00"); $cname = (strcmp($previous,$line[0]) ? $line[0] : " "); print ("<TR BGCOLOR=#$color>\n\t<TD>$line[2]</TD>\n\t<TD>$cname</TD>\n\t<TD>$line[3]</TD>\n</TR>\n"); $previous = $line[0]; } print ("</TABLE>");
This not only takes care of the table row colors, but also removes duplicate company names so it looks MUCH neater this way :))))
Thanks again! Glenn (who's still trying to get it all down lol.. between trying to learn SQL, MySQL,PHP, PostgreSQL, and VBScript lately, I'm surprised I haven't had my head explode yet!)
--- Glenn E. Sieb, System Administrator Lumeta Corp. mailto:geslumeta.com +1 732 357-3514 (V) +1 732 564-0731 (Fax)
attached mail follows:
Glenn Sieb wrote: > > Hey everyone! > > Thanks for all the hints--here's what my boss and I eventually came out with: > > /* ###################### > ## And for every row of data we pull, we create a table row... > ###################### */ > $company = 0; > $previous = ""; > for ($i = 0; $i < mssql_num_rows( $stmt ); ++$i) > { > $line = mssql_fetch_row($stmt); > $company += > (strcmp($previous,$line[0]) ? 1 : 0); > $color = (($company%2) ? "FFFFFF" : > "FFFF00"); > $cname = (strcmp($previous,$line[0]) > ? $line[0] : " "); > print ("<TR > BGCOLOR=#$color>\n\t<TD>$line[2]</TD>\n\t<TD>$cname</TD>\n\t<TD>$line[3]</TD>\n</TR>\n"); > $previous = $line[0]; > } > print ("</TABLE>"); > > This not only takes care of the table row colors, but also removes > duplicate company names so it looks MUCH neater this way :))))
YIKES! I thought there was a SQL keyword for returning a unique rowset.
Cheers, Rob.
-- .-----------------. | Robert Cummings | :-----------------`----------------------------. | Webdeployer - Chief PHP and Java Programmer | :----------------------------------------------: | Mail : mailto:robert.cummingswebmotion.com | | Phone : (613) 731-4046 x.109 | :----------------------------------------------: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `----------------------------------------------'
attached mail follows:
----- Original Message -----
From: "Robert Cummings" <robert.cummings
webmotion.com>
> Glenn Sieb wrote:
> > $cname =
(strcmp($previous,$line[0])
> > ? $line[0] : " ");
> > print ("<TR
> >
BGCOLOR=#$color>\n\t<TD>$line[2]</TD>\n\t<TD>$cname</TD>\n\t<TD>$line[3]</TD
>\n</TR>\n");
> > $previous = $line[0];
> > }
> > print ("</TABLE>");
> >
> > This not only takes care of the table row colors, but also removes
> > duplicate company names so it looks MUCH neater this way :))))
>
> YIKES! I thought there was a SQL keyword for returning a unique
> rowset.
Read the code again, that's what I first thought, too. He's just not printing multiple values for the first table cell. So if the current row has the same company name, just print a blank cell, then print the rest of the data for that row.
---John Holmes...
attached mail follows:
"1LT John W. Holmes" wrote: > > Read the code again, that's what I first thought, too. He's just not > printing multiple values for the first table cell. So if the current row has > the same company name, just print a blank cell, then print the rest of the > data for that row.
In the words of a great man: "Doh!"
Cheers, Rob.
-- .-----------------. | Robert Cummings | :-----------------`----------------------------. | Webdeployer - Chief PHP and Java Programmer | :----------------------------------------------: | Mail : mailto:robert.cummingswebmotion.com | | Phone : (613) 731-4046 x.109 | :----------------------------------------------: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `----------------------------------------------'
attached mail follows:
Glenn Sieb wrote:
> Hey everyone!
>
> Thanks for all the hints--here's what my boss and I eventually came out
> with:
>
> /* ######################
> ## And for every row of data we pull, we create a table row...
> ###################### */
> $company = 0;
> $previous = "";
> for ($i = 0; $i < mssql_num_rows( $stmt ); ++$i)
> {
> $line = mssql_fetch_row($stmt);
> $company +=
> (strcmp($previous,$line[0]) ? 1 : 0);
> $color = (($company%2) ? "FFFFFF" :
> "FFFF00");
> $cname =
> (strcmp($previous,$line[0]) ? $line[0] : " ");
> print ("<TR
> BGCOLOR=#$color>\n\t<TD>$line[2]</TD>\n\t<TD>$cname</TD>\n\t<TD>$line[3]</TD>\n</TR>\n");
>
> $previous = $line[0];
> }
> print ("</TABLE>");
>
> This not only takes care of the table row colors, but also removes
> duplicate company names so it looks MUCH neater this way :))))
>
> Thanks again!
> Glenn
> (who's still trying to get it all down lol.. between trying to learn
> SQL, MySQL,PHP, PostgreSQL, and VBScript lately, I'm surprised I haven't
> had my head explode yet!)
>
> ---
> Glenn E. Sieb, System Administrator
> Lumeta Corp. mailto:ges
lumeta.com
> +1 732 357-3514 (V)
> +1 732 564-0731 (Fax)
>
Is there not a GROUP BY clause in MS SQL? I'm pretty sure there is. If you group the query by company name then you don't have to worry about duplicate company names... and it will help with performance, since the db is optimized for that and you don't have to waste PHP to determine if the row is a duplicate.
attached mail follows:
On Fri, 10 May 2002, Austin Marshall wrote: >> This not only takes care of the table row colors, but also removes >> duplicate company names so it looks MUCH neater this way :)))) > > Is there not a GROUP BY clause in MS SQL? I'm pretty sure there is. If > you group the query by company name then you don't have to worry about > duplicate company names... and it will help with performance, since the > db is optimized for that and you don't have to waste PHP to determine if > the row is a duplicate.
But he's dealing with cases where the company name remains the same but other data in the row changes (for instance, a company with multiple offices, where you wanted to list the phone number and address for each). GROUP BY would discard that other data.
miguel
attached mail follows:
Miguel Cruz wrote: > On Fri, 10 May 2002, Austin Marshall wrote: > >>>This not only takes care of the table row colors, but also removes >>>duplicate company names so it looks MUCH neater this way :)))) >> >>Is there not a GROUP BY clause in MS SQL? I'm pretty sure there is. If >>you group the query by company name then you don't have to worry about >>duplicate company names... and it will help with performance, since the >>db is optimized for that and you don't have to waste PHP to determine if >>the row is a duplicate. > > > But he's dealing with cases where the company name remains the same but > other data in the row changes (for instance, a company with multiple > offices, where you wanted to list the phone number and address for each). > GROUP BY would discard that other data. > > miguel >
Yeah, apparently i wasn't the first to not catch that either. I realy should start paying attention.
attached mail follows:
On 04:58 PM 5/10/2002 -0500, Miguel Cruz wrote: >But he's dealing with cases where the company name remains the same but >other data in the row changes (for instance, a company with multiple >offices, where you wanted to list the phone number and address for each). >GROUP BY would discard that other data.
*nod* We're just doing this for ease-of-reading. Right now it'd look something along these lines:
Marvin BlahBlah, Inc. 5/10/02 Notes on meeting Davis 5/10/02 More Notes on meeting
etc.
Glenn
--- Glenn E. Sieb, System Administrator Lumeta Corp. mailto:geslumeta.com +1 732 357-3514 (V) +1 732 564-0731 (Fax)
attached mail follows:
On Fri, 10 May 2002, Glenn Sieb wrote:
> Thanks for all the hints--here's what my boss and I eventually came > out with:
This could use a few tweaks. First off, putting mysql_num_rows in the actual for loop executes it every iteration. Bad. Second, consider giving your code some readability by returning an associative array. You also duplicate your if statements for company name. You can also rotate your column in the same IF statement to rotate the color. Try this (I'll assume column names...):
----------------------------- CUT HERE ----------------------------- $sPrevCompany = $sColor = ''; while ($aRow = mysql_fetch_assoc($stmt)) { $sCompanyName = $aRow['companyname'];
// If our previous company name is the same as this one, don't print // the company name, but print the data. if ($sPrevCompany == $sCompanyName) { $sColor = ($sColor == 'FF') ? '00' : 'FF'; $sCompanyName = ' ' }
// We're past our if statement, so save the previous company for // nex time. $sPrevCompany = $aRow['companyname'];
print "<TR BGCOLOR=#FFFF$sColor>\n". "\t<TD>$aRow[somecolumn]</TD>\n". "\t<TD>$sCompanyName</TD>\n". "\t<TD>$line[anothercolumn]</TD>\n". "</TR>\n"; } ----------------------------- CUT HERE -----------------------------
And done. Infinitely more maintainable.
-- +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+ | Shaun M. Thomas INN Database Administrator | | Phone: (309) 743-0812 Fax : (309) 743-0830 | | Email: sthomastownnews.com AIM : trifthen | | Web : www.townnews.com | | | | "Most of our lives are about proving something, either to | | ourselves or to someone else." | | -- Anonymous | +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
attached mail follows:
Thanks! I'll play with this!!! :)
Glenn
On 05:11 PM 5/10/2002 -0500, Shaun Thomas wrote: >This could use a few tweaks. First off, putting mysql_num_rows in the >actual for loop executes it every iteration. Bad. Second, consider >giving your code some readability by returning an associative array. >You also duplicate your if statements for company name. You can also >rotate your column in the same IF statement to rotate the color. Try >this (I'll assume column names...):
--- Glenn E. Sieb, System Administrator Lumeta Corp. mailto:geslumeta.com +1 732 357-3514 (V) +1 732 564-0731 (Fax)
attached mail follows:
On 05:11 PM 5/10/2002 -0500, Shaun Thomas wrote: >This could use a few tweaks.
Ok I got it now... This exhibits the behaviour I was looking for, and, thanks to you, is much easier to read and maintain! :)))
Thanks, Shaun! Glenn
$sPrevCompany = $sColor = ''; while ($aRow = mssql_fetch_row($stmt)) { $sCompanyName = $aRow[$companyname];
/* If our previous company name is the same as this one, don't print the company name, but print the data. */
if ($sPrevCompany !== $sCompanyName) { $sColor = ($sColor == 'FF') ? '00' : 'FF'; $sPrevCompany = $sCompanyName; } else { $sCompanyName = ' '; }
/* We're past our if statement, so save the previous company for next time. */
print ( "<TR BGCOLOR=#FFFF$sColor>\n". "\t<TD>$aRow[0]</TD>\n". "\t<TD>$aRow[1]</TD>\n". "\t<TD>$sCompanyName</TD>\n". "\t<TD>$aRow[2]</TD>\n". "\t<TD>$aRow[4]</TD>\n". "\t<TD>$aRow[5]</TD>\n". "\t<TD>$aRow[6]</TD>\n". "\t<TD>$aRow[7]</TD>\n". "</TR>\n"); } print ("</TABLE>");
--- Glenn E. Sieb, System Administrator Lumeta Corp. mailto:geslumeta.com +1 732 357-3514 (V) +1 732 564-0731 (Fax)
attached mail follows:
Hello,
On 05/10/2002 01:48 PM, Liam Gibbs wrote:
> Does anyone have a decent eregi statement for
> validating e-mail addresses? I've tried the ones on
> the site, but there seems to be small bugs with each
> of them. They tell me that fdsjklfsd
fdsf.net is an
> invalid e-mail address.
You may want to try this class that provides several levels of e-mail address validation being the first one that uses an appropriate regular expression.
http://www.phpclasses.org/emailvalidation
--Regards, Manuel Lemos
attached mail follows:
This is what I have used.
<?
if(eregi("^[_.+a-z0-9-]+
[a-z0-9-]+(\.[a-z0-9-]+)*(\.([a-z]){2,4})\$",
$email)){
echo "Good Email!";
}
?>
Here is an excellent article on Regular Expressions.
Learning to Use Regular Expressions by Example http://www.phpbuilder.com/columns/dario19990616.php3
attached mail follows:
On Fri, 10 May 2002, Kevin Stone wrote: > As we all know ARPA is thet university network, funded by the government > to build an information infrastructure that eventually became the > internet we have today. But the standards for text messaging within the > ARPA net have been added to over the years in order to accomodate ever > expanding requirments.
Yes, and those changes are codified into new RFCs which eventually become standards. By all means have a look at RFC 2822 which, if passed into use, will obsolete 822.
> For example I have read that a valid email needn't necessarily require
> anything before the
symbol. The ARPA RFC specifically states that it
> does. But <foo
bar.com> can be just as valid as <
foo.bar.com> if the the
> domain resolves and the server is setup to parse from a catch all account
> named ''. Is this not true?
Sure, and if a web server is set up to respond to a request like:
SPLEARGH www.boogermax.com/greebles ? 888 *** 3424235667
then web browsers could send it and get something in return, but it doesn't mean it's a valid HTTP request.
> If this is true then eregi(/^[a-z0-9]+/, $email ) wouldn't necessarily be
> valid. We could then say that eregi(/^[a-z0-9]*/, $email) is pointless
> becuase if nothing has to be there then there isn't any reason to look for
> it. And thus we return to the original assertion that ereg('
', $email) is
> the only way to know that the string is a properly formated email address.
"Properly formatted email address" is a term whose meaning derives from a prescriptive, rather than descriptive, definition. A properly-formatted email address is one which has been properly formatted in accordance with the rules governing mail addressing, and nothing any more arbitrary than that.
> So why even validate that format beyond the most basic rules (
, length, and
> invalid characters)? The result of which is useless, unless the address is
> sendable, in which case the string format is irrelevant.
Why even look for an
sign then? I can address a message to 'mnc' and it
will arrive just fine - within my zone of control.
The reason that we use standards is to ensure that hardware and software from various vendors can communicate with each other without unexpected results. As soon as you start giving that up, you subdivide the internet into smaller zones of mutual compatibility. About 99.9% of the time, there is no constructive reason for doing it. Given the flexibility already allowed in email addressesing, I certainly don't see this as one of the exceptions.
miguel
attached mail follows:
On Fri, May 10, 2002 at 09:53:10PM +0200, andy wrote: : : I did just build abpache and php. Unfortuanatelly the http.conf looks quit : different to one I did install last year. : There is no phpmodule in there, so I cant activate it. I did include some : lines from my old config: : : AddType application/x-httpd-php .php4 .php3 .php : AddType application/x-httpd-php-source .phps : : but does not help anything. Did I miss something? I did compile php with : apxs and apache with --enable-module=so
This configuration option enables DSO support, but does not automatically turn your modules into DSOs. What does "httpd -l" report?
-- Eugene Lee eugenefsck.net
attached mail follows:
there is not much inside the log. (I do asume you mean the logs) Nothing related to that prob.
What yould be a propper config command for apache to build. I would like to run php as an apache module apxs
Thanx,
Andy
"Eugene Lee" <list-php-general
fsck.net> schrieb im Newsbeitrag
news:20020510152802.A24183
ns1.chairmancs.com...
> On Fri, May 10, 2002 at 09:53:10PM +0200, andy wrote:
> :
> : I did just build abpache and php. Unfortuanatelly the http.conf looks
quit
> : different to one I did install last year.
> : There is no phpmodule in there, so I cant activate it. I did include
some
> : lines from my old config:
> :
> : AddType application/x-httpd-php .php4 .php3 .php
> : AddType application/x-httpd-php-source .phps
> :
> : but does not help anything. Did I miss something? I did compile php with
> : apxs and apache with --enable-module=so
>
> This configuration option enables DSO support, but does not
> automatically turn your modules into DSOs. What does "httpd -l"
> report?
>
>
> --
> Eugene Lee
> eugene
fsck.net
attached mail follows:
> There is no phpmodule in there, so I cant activate it. I did include some > lines from my old config: > > AddType application/x-httpd-php .php4 .php3 .php > AddType application/x-httpd-php-source .phps >
if you're using Apache 1.x you need to add: LoadModule php4_module libexec/libphp4.so
or if you're using Apache 2.x LoadModule php4_module modules/libphp4.so
Sven
attached mail follows:
leider funktioniert das nicht. nach ausfuehren von configtest bekomme ich dann:
Syntax error on line 953 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/libexec/libphp4.so into server: /usr/local/apache/libexec/libphp4.so: cannot open shared object file: No such file or directory
die datei libphp4.so befindet sich auch definitiv nicht auf der maschine. Hab ich da was bei der compillierung falsch gemacht?
Gruss Andy
"Sven Herrmann" <woodoo
woodoomagic.de> schrieb im Newsbeitrag
news:20020510214204.82867.qmail
pb1.pair.com...
>
> > There is no phpmodule in there, so I cant activate it. I did include
> some
> > lines from my old config:
> >
> > AddType application/x-httpd-php .php4 .php3 .php
> > AddType application/x-httpd-php-source .phps
> >
>
> if you're using Apache 1.x you need to add:
> LoadModule php4_module libexec/libphp4.so
>
> or if you're using Apache 2.x
> LoadModule php4_module modules/libphp4.so
>
>
> Sven
>
>
attached mail follows:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
What version of php and apache do you use?
Andy wrote:
| leider funktioniert das nicht. nach ausfuehren von configtest bekomme ich
| dann:
|
| Syntax error on line 953 of /usr/local/apache/conf/httpd.conf:
| Cannot load /usr/local/apache/libexec/libphp4.so into server:
| /usr/local/apache/libexec/libphp4.so: cannot open shared object file: No
| such file or directory
|
| die datei libphp4.so befindet sich auch definitiv nicht auf der maschine.
| Hab ich da was bei der compillierung falsch gemacht?
|
| Gruss Andy
|
|
| "Sven Herrmann" <woodoo
woodoomagic.de> schrieb im Newsbeitrag
| news:20020510214204.82867.qmail
pb1.pair.com...
|
|>>There is no phpmodule in there, so I cant activate it. I did include
|>
|>some
|>
|>>lines from my old config:
|>>
|>>AddType application/x-httpd-php .php4 .php3 .php
|>>AddType application/x-httpd-php-source .phps
|>>
|>
|>if you're using Apache 1.x you need to add:
|>LoadModule php4_module libexec/libphp4.so
|>
|>or if you're using Apache 2.x
|>LoadModule php4_module modules/libphp4.so
|>
|>
|>Sven
|>
|>
|
|
|
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (MingW32) Comment: For info see http://www.gnupg.org
iEYEARECAAYFAjzcTU4ACgkQNcG5oyVditsjtwCdH5LLJ+mPJz27xiuZXDrESbeR gf4An3f37WvVJMcXuNPQmUIYyoHDbh/1 =MLof -----END PGP SIGNATURE-----
attached mail follows:
On Fri, May 10, 2002 at 11:34:28PM +0200, Andy wrote:
: "Eugene Lee" <list-php-general
fsck.net> asked:
: > On Fri, May 10, 2002 at 09:53:10PM +0200, andy wrote:
: > :
: > : I did just build abpache and php. Unfortuanatelly the http.conf
: > : looks quit different to one I did install last year. There is no
: > : phpmodule in there, so I cant activate it.
[...]
: > : Did I miss something? I did compile php with
: > : apxs and apache with --enable-module=so
: >
: > This configuration option enables DSO support, but does not
: > automatically turn your modules into DSOs. What does "httpd -l"
: > report?
:
: there is not much inside the log. (I do asume you mean the logs) Nothing
: related to that prob.
Nope, not the logs.
$ /usr/local/apache/bin/httpd -l (or whatever your Apache root directory is)
: What yould be a propper config command for apache to build. I would like to : run php as an apache module apxs
The online instructions should be okay:
http://www.php.net/manual/en/install.apache.php
-- Eugene Lee eugenefsck.net
attached mail follows:
I did find the prob!
So for all guys struggeling with the same one.. First install apache, then php! I did reinstall apache after php.
After compiling php again it is up and running.
Thanx guys,
Andy
"Javier" <javier
leeloo.mine.nu> schrieb im Newsbeitrag
news:3CDC4D51.9010502
leeloo.mine.nu...
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> What version of php and apache do you use?
>
> Andy wrote:
> | leider funktioniert das nicht. nach ausfuehren von configtest bekomme
ich
> | dann:
> |
> | Syntax error on line 953 of /usr/local/apache/conf/httpd.conf:
> | Cannot load /usr/local/apache/libexec/libphp4.so into server:
> | /usr/local/apache/libexec/libphp4.so: cannot open shared object file: No
> | such file or directory
> |
> | die datei libphp4.so befindet sich auch definitiv nicht auf der
maschine.
> | Hab ich da was bei der compillierung falsch gemacht?
> |
> | Gruss Andy
> |
> |
> | "Sven Herrmann" <woodoo
woodoomagic.de> schrieb im Newsbeitrag
> | news:20020510214204.82867.qmail
pb1.pair.com...
> |
> |>>There is no phpmodule in there, so I cant activate it. I did include
> |>
> |>some
> |>
> |>>lines from my old config:
> |>>
> |>>AddType application/x-httpd-php .php4 .php3 .php
> |>>AddType application/x-httpd-php-source .phps
> |>>
> |>
> |>if you're using Apache 1.x you need to add:
> |>LoadModule php4_module libexec/libphp4.so
> |>
> |>or if you're using Apache 2.x
> |>LoadModule php4_module modules/libphp4.so
> |>
> |>
> |>Sven
> |>
> |>
> |
> |
> |
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.6 (MingW32)
> Comment: For info see http://www.gnupg.org
>
> iEYEARECAAYFAjzcTU4ACgkQNcG5oyVditsjtwCdH5LLJ+mPJz27xiuZXDrESbeR
> gf4An3f37WvVJMcXuNPQmUIYyoHDbh/1
> =MLof
> -----END PGP SIGNATURE-----
>
attached mail follows:
That's strange.. I always compile in this order...
1. MySQL 2. PHP 3. Apache
----- Original Message -----
From: "Andy" <news.letters
gmx.de>
To: <php-general
lists.php.net>
Sent: Saturday, May 11, 2002 9:10 AM
Subject: [PHP] Re: Apache is not rendering php pages. Config problem?
I did find the prob!
So for all guys struggeling with the same one.. First install apache, then php! I did reinstall apache after php.
After compiling php again it is up and running.
Thanx guys,
Andy
"Javier" <javier
leeloo.mine.nu> schrieb im Newsbeitrag
news:3CDC4D51.9010502
leeloo.mine.nu...
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> What version of php and apache do you use?
>
> Andy wrote:
> | leider funktioniert das nicht. nach ausfuehren von configtest bekomme
ich
> | dann:
> |
> | Syntax error on line 953 of /usr/local/apache/conf/httpd.conf:
> | Cannot load /usr/local/apache/libexec/libphp4.so into server:
> | /usr/local/apache/libexec/libphp4.so: cannot open shared object file: No
> | such file or directory
> |
> | die datei libphp4.so befindet sich auch definitiv nicht auf der
maschine.
> | Hab ich da was bei der compillierung falsch gemacht?
> |
> | Gruss Andy
> |
> |
> | "Sven Herrmann" <woodoo
woodoomagic.de> schrieb im Newsbeitrag
> | news:20020510214204.82867.qmail
pb1.pair.com...
> |
> |>>There is no phpmodule in there, so I cant activate it. I did include
> |>
> |>some
> |>
> |>>lines from my old config:
> |>>
> |>>AddType application/x-httpd-php .php4 .php3 .php
> |>>AddType application/x-httpd-php-source .phps
> |>>
> |>
> |>if you're using Apache 1.x you need to add:
> |>LoadModule php4_module libexec/libphp4.so
> |>
> |>or if you're using Apache 2.x
> |>LoadModule php4_module modules/libphp4.so
> |>
> |>
> |>Sven
> |>
> |>
> |
> |
> |
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.6 (MingW32)
> Comment: For info see http://www.gnupg.org
>
> iEYEARECAAYFAjzcTU4ACgkQNcG5oyVditsjtwCdH5LLJ+mPJz27xiuZXDrESbeR
> gf4An3f37WvVJMcXuNPQmUIYyoHDbh/1
> =MLof
> -----END PGP SIGNATURE-----
>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hello,
On 05/10/2002 04:15 PM, Jeff Bearer wrote: > Does anybody know of a class, module, extension that caches database > output? > > I've asked this before, and I've looked high and low to no avail. I've > used APC cache to do caching and it works great, but it doesn't save > database queries, which easily becomes the bottleneck with highly > dynamic site. It's a pretty big itch for me and I'm sure other's and > I'm surprised that there isn't anybody scratching that itch. > > Just hoping something new is out there. Thanks
This class can do exactly what you need.
http://www.phpclasses.org/filecache
It caches arbitrary data to files in disk. If you want to cache query results, store them all in a single array and use serialize() to generate a data stream to store in the cache files.
However, practice recommends that you do not just cache queries but rather cache the data that is generated from those queries, being that HTML pages or something else.
--Regards, Manuel Lemos
attached mail follows:
Hi.. it's me again :)
We have a few different servers here, most of which are FreeBSD, including our internal web server (Apache 1.3.24). We have PHP 4.2.0 installed as well.
Currently I'm running my MSSQL query scripts on a Win2k webserver, as I can't seem to get PHP to talk to MSSQL on the FreeBSD side. I'd really prefer to have my PHP scripts all running on the FreeBSD side, rather than on Win2k.
We do have Perl able to talk to the MSSQL server using FreeTDS and the DBI::Sybase package on the same FreeBSD machine.
My ./configure:
./configure --prefix=/usr/local --with-apache=/home/src/Apache/Apachetoolbox -1.5.56/apache_1.3.24 --enable-exif --enable-track-vars --with-calendar=shared - -enable-safe-mode --enable-magic-quotes --enable-trans-sid --enable-wddx --enabl e-ftp --with-gd=/usr/local --with-zlib --enable-gd-native-tt --with-t1lib=/usr/l ocal --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-zlib-dir=/usr - -with-ttf --with-freetype-dir=/usr/local --with-unixodbc=/usr/local/unixODBC --w ith-openssl=/usr/local --with-curl=/usr/local --enable-apc --with-mysql=/sw/mysq l --with-mssql=/usr/local/etc/freetds --with-sybase=/usr/local/etc/freetds
(built using ApacheToolbox, 1.5.56)
FreeTDS' interfaces file is located in /usr/local/etc/freetds, which it is/was my understanding that this is what's supposed to be there. Yet not only does PHP give me:
Fatal error: Call to undefined function: mssql_connect() in /usr/home/inweb/inside.lumeta.com/htdocs/TaskInfoCompletedProj1.php on line 82
(and yes, if I put the sybase_connect() in I get the same error only it says sybase*)
What am I missing here? Is there another package I need that I neglected to install? Am I just not configured properly? *sigh* Debugging this stuff is always fun :)
Thanks in advance.. hope I'm not bein a PITA :) Glenn
--- Glenn E. Sieb, System Administrator Lumeta Corp. mailto:geslumeta.com +1 732 357-3514 (V) +1 732 564-0731 (Fax)
attached mail follows:
Look into Openlink.
We used, they still use, MSSQL with PHP running on Unix/Linux at my last employer. I was a happy customer not a spokesperson. It worked as advertised, no fuss, no problems. In a production environment that is what you want.
DAve
> Hi.. it's me again :)
>
> We have a few different servers here, most of which are FreeBSD,
> including our internal web server (Apache 1.3.24). We have PHP 4.2.0
> installed as well.
>
> Currently I'm running my MSSQL query scripts on a Win2k webserver, as
> I can't seem to get PHP to talk to MSSQL on the FreeBSD side. I'd
> really prefer to have my PHP scripts all running on the FreeBSD side,
> rather than on Win2k.
>
> We do have Perl able to talk to the MSSQL server using FreeTDS and the
> DBI::Sybase package on the same FreeBSD machine.
>
> My ./configure:
>
> ./configure --prefix=/usr/local
> --with-apache=/home/src/Apache/Apachetoolbox
> -1.5.56/apache_1.3.24 --enable-exif --enable-track-vars
> --with-calendar=shared -
> -enable-safe-mode --enable-magic-quotes --enable-trans-sid
> --enable-wddx --enabl e-ftp --with-gd=/usr/local --with-zlib
> --enable-gd-native-tt --with-t1lib=/usr/l ocal
> --with-jpeg-dir=/usr/local --with-png-dir=/usr/local
> --with-zlib-dir=/usr - -with-ttf --with-freetype-dir=/usr/local
> --with-unixodbc=/usr/local/unixODBC --w ith-openssl=/usr/local
> --with-curl=/usr/local --enable-apc --with-mysql=/sw/mysq l
> --with-mssql=/usr/local/etc/freetds
> --with-sybase=/usr/local/etc/freetds
>
> (built using ApacheToolbox, 1.5.56)
>
> FreeTDS' interfaces file is located in /usr/local/etc/freetds, which
> it is/was my understanding that this is what's supposed to be there.
> Yet not only does PHP give me:
>
> Fatal error: Call to undefined function: mssql_connect() in
> /usr/home/inweb/inside.lumeta.com/htdocs/TaskInfoCompletedProj1.php on
> line 82
>
> (and yes, if I put the sybase_connect() in I get the same error only
> it says sybase*)
>
> What am I missing here? Is there another package I need that I
> neglected to install? Am I just not configured properly? *sigh*
> Debugging this stuff is always fun :)
>
> Thanks in advance.. hope I'm not bein a PITA :)
> Glenn
>
> ---
> Glenn E. Sieb, System Administrator
> Lumeta Corp. mailto:ges
lumeta.com
> +1 732 357-3514 (V)
> +1 732 564-0731 (Fax)
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Glenn Sieb wrote: > Hi.. it's me again :) > > We have a few different servers here, most of which are FreeBSD, > including our internal web server (Apache 1.3.24). We have PHP 4.2.0 > installed as well. > > Currently I'm running my MSSQL query scripts on a Win2k webserver, as I > can't seem to get PHP to talk to MSSQL on the FreeBSD side. I'd really > prefer to have my PHP scripts all running on the FreeBSD side, rather > than on Win2k. > > We do have Perl able to talk to the MSSQL server using FreeTDS and the > DBI::Sybase package on the same FreeBSD machine. > > My ./configure: > > ./configure --prefix=/usr/local > --with-apache=/home/src/Apache/Apachetoolbox > -1.5.56/apache_1.3.24 --enable-exif --enable-track-vars > --with-calendar=shared - > -enable-safe-mode --enable-magic-quotes --enable-trans-sid --enable-wddx > --enabl > e-ftp --with-gd=/usr/local --with-zlib --enable-gd-native-tt > --with-t1lib=/usr/l > ocal --with-jpeg-dir=/usr/local --with-png-dir=/usr/local > --with-zlib-dir=/usr - > -with-ttf --with-freetype-dir=/usr/local > --with-unixodbc=/usr/local/unixODBC --w > ith-openssl=/usr/local --with-curl=/usr/local --enable-apc > --with-mysql=/sw/mysq > l --with-mssql=/usr/local/etc/freetds --with-sybase=/usr/local/etc/freetds > > (built using ApacheToolbox, 1.5.56) > > FreeTDS' interfaces file is located in /usr/local/etc/freetds, which it > is/was my understanding that this is what's supposed to be there. Yet > not only does PHP give me:
the --with-sybase= line needs to point to where freetds was compiled, not the interfaces file. We don't use the interfaces file, which seems to be primarily a way to map names to IPs. We just use the IP address directly in the mssql_connect() functions and it works.
Michael Kimsal http://www.phphelpdesk.com
attached mail follows:
I agree. We have many out of states clients, and all were required to (and have) sign a contract. There are many ways to deliver contracts, you should not have to risk not getting paid because of delivery logistics.
You can use:
e-mail fax fedEx, Ups, or any other delivery systems.
-use Adobe's PDF Writer to convert to contracts to PDF, so clients cannot change the content.
We've successfully used the following processes:
1) E-mail original contract--> client sign and mail it back.
2) E-mail original contract--> Client signed and fax it back to us.
3) E-mail original contract --> Client signed it, scanned the pages, and e-mail us the scanned pages (in this case, the scanned images). We then print the scanner pages, eh voila! A signed contract.
3) For rushed jobs, we've even had clients submit an electronic agreement/permission, in conjunction with a hard copy. The electronic letter would state (a) that they've agreed to our terms (b) that the hard copy is in the mail, and should arrive by a certain date (c) we have permission to begin development with the prices listed in the contract (d) If the hard copy is not received within the listed timeline, then the electronic copy will take precedence over all documents, and they automatically agree to ALL of our terms. Those that were, and that were not listed, on the original contact. {small encouragement to get the original docs in}
Overall, we pretty much have zero tolerance when it comes to contracts. No contract, no work. Clients have the tendency to want a lot more than their budgets can support, and they will try to get over the 'little people'. They also tend to want to change things, late in the development process. This can give a new definition to the word 'HELL'.
The best way to prevent being cheated, is to have a WRITTEN agreement. Once that agreement has been signed, stick to it. Do not change any portion of it, because it will comeback to haunt you.
====On the technology front=== How about this idea?
PHP's FOPEN() function makes it really easy to access remote information. Suppose, for example, that you leave the application's configuration file on your server, and have the program access it via FOPEN().
Whenever the program runs, it will need to access the configuration file on your server, to initial the application's parameters.
if the client doesn't pay, then you simple disable the configuration file on your server. Since they will not have access to the configuration file, then they will not be able to change anything. Plus, changes they make to their own servers (like changing login info) will not prevent you from controlling the unpaid program.
Once all payments are in, you can transfer the configuration file to their server.
I haven't tried this, but I've been thinking about it. Just thought I'll put it out there. The only limitation, AFAIK, is that of FOPEN(). If I remember correctly, fopen() will not process any codes in the file that it is opening.
You'll have to work around that.
Just add that to the Idea Bin, it may lead to a better solution.
-john
_+-----------------------------------+_ P E P I E D E S I G N S www.pepiedesigns.com "Providing Solutions That Increase Productivity" -+___________________________________+-
On Wed, 8 May 2002, Jay Blanchard wrote:
> [snip] > As any good developer out there knows, first you call them "new friends" > then "clients" and sometimes it goes to "S.O.Bs" and "bast**ds" and the > worst part for me is I am not in the states but offer services to a lot of > U.S clients so a actual contract is pretty much out of the question. > [/snip] > > Why is an actual contract out of the question? With FedEx, UPS, Fax > Machines, postal services of all types, and electronic contracts with > electronic signatures it shouldn't matter where the programmer is, even if > it is not the same locale as the client. > > Jay > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
I have a very nicely organized form, with a file field. The script can read all the fields, exepet for this one file field! I have no idea what is wrong. Maybe its scope? Well, anyhow, I could really use some help. The form's "enctype" is set to "multipart/form-data", so that can't be the problem. The file field is named "image", and in the script - to read the field - I use "$_FILES['image']". Everything seems fine to me.
My script is rather large. The HTML was generated by Dreamweaver, so its large, and messy. The script is below, tell me if I have to include the HTML in my post too...
===================================================================== <?php if (isset($_POST['form_post'])) { verify(); } else { exit; }
function verify() { $name = $_POST['name']; $reviewer = $_POST['reviewer']; $summery = $_POST['summery']; $review = $_POST['review'];
if (!$name or !$reviewer or !$summery or !$review) { if (!$name) { echo "<p class=\"required\">Error: <b>Title of Show</b> field is empty</p>"; } if (!$reviewer) { echo "<p class=\"required\">Error: <b>Your Name</b> field is empty</p>"; } if (!$summery) { echo "<p class=\"required\">Error: <b>Summery of Review</b> field is empty</p>"; } if (!$review) { echo "<p class=\"required\">Error: <b>Television Review</b> field is empty</p>"; }
exit ("<p>Please correct the above errors before reposting the review</p>"); } else { insert(); } }
function insert() { $title = $_POST['title']; $name = $_POST['name']; $reviewer = $_POST['reviewer']; $summery = $_POST['summery']; $review = $_POST['review']; $day = $_POST['day']; $time = $_POST['time']; $channel = $_POST['channel']; $image = $_FILES['image'];
if (!$_FILES['image'] == "none") { if(!is_dir("../../../../images/")) { echo "Directory does not exist, creating...<br>\n"; mkdir("../../../../images"); }
if (copy($_FILES['image']['tmp_name'], "../../../../images/" . $_FILES['image']['name'])) { echo "<img src=\"../../../../images/".$_FILES['image']['name']."\"></img>"; }
$filename = $_FILES['image']['name']; $filepath = "../../../../images/".$filename; // this will be put in the database. }
// Replace any apostrophies found in the variables with double ("''") apostrophies. $title = ereg_replace("'", "''", $title); $name = ereg_replace("'", "''", $name); $reviewer = ereg_replace("'", "''", $reviewer); $summery = ereg_replace("'", "''", $summery); $review = ereg_replace("'", "''", $review); $day = ereg_replace("'", "''", $day); $time = ereg_replace("'", "''", $time); $channel = ereg_replace("'", "''", $channel); $filepath = ereg_replace("'", "''", $filepath);
$SQLQuery = "INSERT INTO tblTelevision(fldTitle, fldName, fldReviewer, fldDate, fldSummery, fldReview, fldDay, fldTime, fldChannel, fldPoster) VALUES('$title', '$name', '$reviewer', NOW(), '$summery', '$review', '$day', '$time', '$channel', '$filepath')";
$db = odbc_connect('ReviewDatabase', 'root', ''); $cursor = odbc_exec($db, $SQLQuery);
echo "<p>Review posted successfully!</p>"; odbc_close($db); } ?> =====================================================================
I appreciat any help given. _____ Sinceriously Cheerious, Dr. Shim
attached mail follows:
On Saturday 11 May 2002 05:59, Dr. Shim wrote: > I have a very nicely organized form, with a file field. The script can read > all the fields, exepet for this one file field! I have no idea what is > wrong. Maybe its scope? Well, anyhow, I could really use some help. The > form's "enctype" is set to "multipart/form-data", so that can't be the > problem. The file field is named "image", and in the script - to read the > field - I use "$_FILES['image']". Everything seems fine to me. > > My script is rather large. The HTML was generated by Dreamweaver, so its > large, and messy. The script is below, tell me if I have to include the > HTML in my post too...
Use:
print_r($_FILES);
to see what it contains.
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Law stands mute in the midst of arms. -- Marcus Tullius Cicero */
attached mail follows:
Re question 2:
You can set this using the php_value command in apache. I think you need to have the SAPI version configured for this to work though. You might want to check that out. I have only done this on XP, haven't tried it on linux yet.
<VirtualHost *>
ServerAdmin blah
blah.com
DocumentRoot "D:\web\wilson\www"
ServerName blah.blah.com
ErrorLog "D:\web\blah\logs\error.log"
CustomLog "D:\web\blah\logs\access.log" common
php_value include_path "D:\web\blah\includes"
</VirtualHost>
So your www directory would exist within D:\web\blah\www, keeping your includes safe. In your php.ini you can leave your includes line blank.
Hope it helps!
Regards,
Ian Newlands
"1lt John W. Holmes" <holmes072000
charter.net> wrote in message
news:003f01c1f76f$9df452f0$2f7e3393
TB447CCO3...
> > To learn more, I put the phpinfo(); function in my document root, and
> > lo and behold, I get this long a gnarly virtual path:
> > /home/virtual/site26/fst/var/www/html/
> > as my document root. So I try:
> > /home/virtual/site26/fst/var/www/rsrcs/.... for my includes, and still
> > can't get to it.
>
> You've probably got an ensim system, don't you? The host for falkware.com
is
> like that and it's a pain. Through ssh, the path to the file is
> /var/www/html/etc..., but like you, we have to use the whole "hidden" path
> /home/virtual/site26/fst/var/www/rsrcs/... That should work for you. What
> kind of error are you getting when you use the entire path?
>
> > SECOND QUESTION: are there any virtual host gurus who can tell me how to
> > get Apache/PHP to include files from outside of the document root on
> > virtual hosted systems?
>
> You can use an absolute path, with /home/virtual ... or use a relative
path
> from the script you're in ../../includes/ etc..
>
> ---John Holmes...
>
attached mail follows:
I would like very much to retrieve data from an https server using the file function, but it only supports an http call.
1. Can someone suggest a good alternative
2. I understand this will be in PHP 4.3. Does anyone know a possible release date.
Thanks
Bert
attached mail follows:
On 10 May 2002 at 16:07, Bert Buckley wrote: > I would like very much to retrieve data from an > https server using the file function, but it only > supports an http call. > > 1. Can someone suggest a good alternative
-- Stuart
attached mail follows:
It will be really cool when we can do that (in PHP4.3) but until then you'll have to make do with cURL (http://www.php.net/manual/en/ref.curl.php)
HTH
Danny.
----- Original Message -----
From: "Bert Buckley" <bbuckley
trilan.com>
To: <php-general
lists.php.net>
Sent: Saturday, May 11, 2002 12:07 AM
Subject: [PHP] httpS connection with FILE
> > I would like very much to retrieve data from an > https server using the file function, but it only > supports an http call. > > 1. Can someone suggest a good alternative > > 2. I understand this will be in PHP 4.3. Does > anyone know a possible release date. > > Thanks > > Bert > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Thanks for replying Miguel
I'm new to php and wonder how I would check if the first field is an IP address. Do I open the file fget it and then use a regular expression to check. Also if I want to break up the first line of my array what delimiter do I look at as the fields in the log are seperated by spaces.
J
"Miguel Cruz" <mnc
stoic.net> wrote in message
news:Pine.LNX.4.44.0205101321370.2680-100000
stoic.net...
> On Fri, 10 May 2002, Josh Edwards wrote:
> > I'm working on using php to analyse an access log on an apache server.
> >
> > If a user inputs a file path I want to be able to use PHP to determine
if
> > it's a log file. Is there a function that will reject if it's not a
binary
> > file. If it's a binary file how would I then
> > compare it to whats expected in a log file.
>
> 1. Apache logs are text files.
>
> 2. The difference between a binary file and a text file is not something
> that can be observed, only declared. Well, it can be observed by humans,
> but not by machines. Who knows how picky a given application is going to
> be about line endings? Who knows what text encodings are valid in the
> context?
>
> 3. The format for Apache log files depends on the configuration of the
> server (directives like LogFormat).
>
> 4. If you know the configuration of the server, then it's trivial to
> determine whether you have a valid log file. If the first column is
> supposd to be an IP address, check for an IP address. If the fourth column
> is supposed to be a date, check for a date.
>
> miguel
>
attached mail follows:
Mike,
Both of your bit of code are not equal.
On my ISP in 4.0.6 isset returned false if the variable was not existing OR empty
in 4.2 isset returns true if the variable exists but is empty, so you may want to check with empty instead of isset
Luc
At 12:16 10/05/2002 +0100, Ford, Mike [LSS] wrote: > > -----Original Message----- > if (isset($password)): // register_globals on > $super_user = $password==$super_password; > endif; > > if ($super_user): > // sensitive admin stuff > endif; > >is more secure than: > > if (isset($_GET['password'])): // register_globals off > $super_user = $_GET['password']==$super_password; > endif; > > if ($super_user): > // sensitive admin stuff > endif;
attached mail follows:
Hey all... I really do want to thank everyone for all the help and advice you give. I know my questions sometimes are probably more annoying than anything else, but your input really does help.
Anyway, I have a stack of 76 playlists I need to consolidate and display. These are from radio shows, so each playlist has the date, the name of the radio show, and anywhere from 20 - 27 tracks, artists, and albums on them.
I know I could simply stick these into a MySQL database using fields like, date, show, track1, artist1, album1, track2, artist2, album2, etc. but would that really be efficient and would I be able to use PHP effectively to retrieve all that information and display it correctly?
Has anyone out there done a similar project? If so, what was your approach? Thanks in advance,
Jason Soza
attached mail follows:
> Anyway, I have a stack of 76 playlists I need to consolidate and > display. These are from radio shows, so each playlist has > the date, the name of the radio show, and anywhere from 20 - 27 tracks, > artists, and albums on them.
It's really more an sql question than a php question but...
Have a table that contains dates and names of shows.
Have another table that contains artists.
Have another table that contains songs.
Have another table that contains tracks.
Each of these also has an ID in addition to the other data in the table.
Have a "linking" table that contains artist ID's and song ID's. This lets you, for example, look up all songs for a particular artists or, potentially, all artists for a song.
Have another linking table that contains song ID's and album ID's. This lets you relate songs to albums and, through the previous table, artists. This way, though, you can have compilation albums with multiple artists on a single album.
Last of all create another linking table with song ID's and show ID's. This gets you songs for a show but, through the other linking tables you get information on everything else.
For any additional information just store it in the relevant table (ie. If you want to keep track of song lengths then it would go in the songs table, if you wanted artist bios that would be in the artist table and so on).
You'll obviously need to be doing a fair number of joins in your queries but it will give you a more versatile structure.
Then write your php for the interface (oh, the easy bit, and finally some mention of php, does that make this message on-topic now?)
CYA, Dave
attached mail follows:
Jason Soza wrote: > Hey all... I really do want to thank everyone for all the help and > advice you give. I know my questions sometimes are probably more > annoying than anything else, but your input really does help. > > Anyway, I have a stack of 76 playlists I need to consolidate and > display. These are from radio shows, so each playlist has the date, the > name of the radio show, and anywhere from 20 - 27 tracks, artists, and > albums on them. > > I know I could simply stick these into a MySQL database using fields > like, date, show, track1, artist1, album1, track2, artist2, album2, > etc. but would that really be efficient and would I be able to use PHP > effectively to retrieve all that information and display it correctly? > > Has anyone out there done a similar project? If so, what was your > approach? Thanks in advance, > > Jason Soza >
Using MySQL or any database for that matter will be most efficient, however, they way you lay it out may not be. You'd want to store tracks individually which would have columns associated with it for example, Artist, title, album, show date, and most importantly the playlist it is associated with. You could have a seperate table for information specific to the playlist, so you don't have to repeat information when you insert songs into the track table, but isn't necessary as long as you maintain some consistency.
If you want to get really fancy, then you could have at least 3 tables like the following...
A songs table with title, author, album, song_id, where each song title and author combination are unique and only occur once.
A playlist table which stores the song_id in the order that is played and the playlist_id, the date of the show and the show_id that the playlist is associated with.
and a Show table which stores information specific to the show.
with three tabels you will minimize the amount of information that is repeated, since you'd only need to insert a particular song once, and build playlists from that list of songs.
The other less sexy option is to use flatfiles. Which wouldn't be pretty straight forward. Just right some information about the playlist at the beginning of the file in a consistent manner and fill it with song titles, one on each line.
I think you are on the right track with MySQL though, you just need to break it down to at least more than one table since having 20+ columns that store song names is rather ineeficient.
Hope that provides some insight.
attached mail follows:
<?
// This function is the PHP version of the TCL proc PRODUCE_MENUBAR which // will produce the menubar for all PHP files // // Syntax: echo PRODUCE_MENUBAR() //
function PRODUCE_MENUBAR() { global $HTTP_HOST; $tcl = (preg_match("/\bdyndns\b/i", $HTTP_HOST)) ? "tclsh83" : "tclsh"; $path = (preg_match("/\bdyndns\b/i", $HTTP_HOST)) ? "cgi-bin" : "cgi-bin/cgiwrap/ppowell"; $fileID = fopen("http://$HTTP_HOST/$path/menubar.cgi", "r"); $menubar = fread($fileID, 1000000); fclose($fileID); return $menubar; }
?>
This function exists in the file "menubar_functions.php" which is in the docroot. I have a PHP script in a subfolder /chat that produces a Fatal Error (call to undefined function PRODUCE_MENUBAR()) each time it tries to find it.
How do I fix this problem? I do not want to duplicate the PHP script per folder as there will be an enormous amount of dynamically-created subfolders and I will have to copy a version per folder. I want to be able to use the one PHP script in the DOCROOT for every PHP script in every subfolder, how is this done?
Thanx Phil
attached mail follows:
Phil:
On Fri, May 10, 2002 at 08:01:46PM -0400, Phil Powell wrote: > > How do I fix this problem? I do not want to duplicate the PHP script per > folder as there will be an enormous amount of dynamically-created subfolders > and I will have to copy a version per folder. I want to be able to use the > one PHP script in the DOCROOT for every PHP script in every subfolder, how > is this done?
Have a file in each directory called, for the sake of example, "directory.inc" In that file, set a variable called, "$root" The value of it should be the relative path used to find the root directory, eg "../../". This will vary depending on the directory depth. Each script on your site then should have "require('./directory.inc');" at the top. Now, you'll always know where to find the root. This also makes things easy to move from one server to another in the future.
Another way to do this is to use the auto_prepend_file setting to include your file that has the function in it. http://www.php.net/manual/en/configuration.php#ini.auto-prepend-file
Enjoy,
--Dan
--
PHP classes that make web design easier
SQL Solution | Layout Solution | Form Solution
sqlsolution.info | layoutsolution.info | formsolution.info
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409
attached mail follows:
On Fri, 10 May 2002, Phil Powell wrote: > How do I fix this problem? I do not want to duplicate the PHP script per > folder as there will be an enormous amount of dynamically-created subfolders > and I will have to copy a version per folder. I want to be able to use the > one PHP script in the DOCROOT for every PHP script in every subfolder, how > is this done?
Check out the include_path directive in php.ini (or .htaccess or whatever).
miguel
attached mail follows:
miguel
On Sat, 11 May 2002, Phil Powell wrote:
> I can't alter php.ini as this is occurring on a remote site (not on my own
> site). :(
>
> Phil
>
> ----- Original Message -----
> From: "Miguel Cruz" <mnc
stoic.net>
> To: "Phil Powell" <soazine
erols.com>
> Cc: <php-general
lists.php.net>
> Sent: Friday, May 10, 2002 11:08 PM
> Subject: Re: [PHP] Using function in PHP script n DOCROOT in PHP script in
> subfolder
>
>
> > On Fri, 10 May 2002, Phil Powell wrote:
> > > How do I fix this problem? I do not want to duplicate the PHP script per
> > > folder as there will be an enormous amount of dynamically-created
> subfolders
> > > and I will have to copy a version per folder. I want to be able to use
> the
> > > one PHP script in the DOCROOT for every PHP script in every subfolder,
> how
> > > is this done?
> >
> > Check out the include_path directive in php.ini (or .htaccess or
> > whatever).
> >
> > miguel
> >
> >
>
>
attached mail follows:
> I've only just picked up on this thread, but why not put > each form inside a <td> element? > > i.e. > <table> > <tr> > <td><form> ... </form></td> > <td><form> ... </form></td> > </tr> > </table
A closing </form> includes an implied <p> so if you keep it inside your <td></td> you'll end up with extra space in your cell. If your table has no different backgrounds or whatever then this probably won't matter all that much but if you're using colours or images as backgrounds in your table cells then it may will stuff up your nice layout.
CYA, Dave
attached mail follows:
> So I should buy a commerical product from zend to > protect my code but since my code will be reversed > engineered anyways then what's the point of buying > from zend?
That's your choice. It's also my point. If you can't be 100% secure then perhaps you should be looking at what you're trying to do.
Some observable facts:
1. Some companies remain, from what I can tell, highly successful and can give away their source code for free.
2. Some companies remain, from what I can tell, highly successful without giving away any of their source.
3. Some companies fail, even if they are giving away their source.
4. Some companies fail, even if they don't give away their source.
The conclusion I draw from that is that protecting or giving away your source is not a single make or break decision for a company. Rather, there are a myriad of decisions involved, of which the status of any source code is but one. Protect it, don't protect it, by itself it doesn't mean squat. In association with other things it might.
For example, if you aren't prepared to pursue, in the courts as necessary, your closed source proprietary code then sooner or later someone will figure that out and take it for their own use. Do you think Microsoft would be as successful if it wasn't as agresive about protecting it's "intellectual property"?
Speaking only for myself, I believe the effort involved to be not worth it, so I have no current intention of trying to protect, encode, conceal, booby trap or whatever any of my code.
What you do is your business. You'd probably do well to understand the implications first - what are you protecting? Why? How far will you go to protect it? Will you take legal action? Etc etc etc
CYA, Dave
attached mail follows:
To store large values (100k+) and load them as much as 6+ times within the same hour what would be better MySql or Flatfile?
attached mail follows:
MySQL
----- Original Message -----
From: "David Duong" <davidduong1
hotmail.com>
To: <php-general
lists.php.net>
Sent: Saturday, May 11, 2002 10:29 AM
Subject: [PHP] MySQL or FlatFile
To store large values (100k+) and load them as much as 6+ times within the same hour what would be better MySql or Flatfile?
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
David Duong wrote: > To store large values (100k+) and load them as much as 6+ times within the > same hour what would be better MySql or Flatfile? > >
I think it really depends on the content. If you are storing 100K+ per entry it sounds like it is probably something along the lines of an image or some other binary file. If what you are storing is pure unformatted text, then i'd definitely go with MySQL, but if you are storing something else, like an image or an audio file, then it would be best to keep the files as they are and just store information about the files in MySQL.
A possible middle-ground (for text at least) if you want it to be searchable is to maintain both flatfile and mysql records. Keep the flatfiels as text, untouched, but index the file and store the index information in MySQL. And what i mean by indexing it is each entry into the database is one word only, with information about the word like the file it's associated with. That way you can serve up flat files but search through them quite easily and won't have to dea lwith such a memory hog every time you make a query.
attached mail follows:
> I have a group table with 16 items, and I want them to be > randomly put in 4 different groups, with 4 in each group, > I've seen the $rand(x,x) thing, but is there any way to > limit to 4 in each group without 47839 rows of code? :P
Wouldn't you just randomise all 16 items and take them on at a time to fill your table?
CYA, Dave
attached mail follows:
Hi all,
Since the hot topic of the last few weeks has definately been the new register_globals deal, I thought the following article will be of huge assistance to many.
http://www.WebmasterBase.com/article.php?pid=0&aid=758
It's short, to the point, explains why the old way is bad, explains why the new way is good, shows some simple examples, shows you how to get your old scripts up to date, etc etc.
Justin French
-------------------- Creative Director http://Indent.com.au --------------------
attached mail follows:
Hi again and sorry to pose same question, but I'm about to pull out my hair here. There were some DOMXML questions in the past 24h but none replied to. Two of us till now have had the same problem: compiled DOM just fine and see it is there with phpinfo(); but cannot use its functions[1]. Can anoyone at least verify that they got DOM working fine under PHP4.2?
thanks in advance, Thalis
[1] The following code prints 'WTF?' $domdoc=xmldoc($xmlstring); if(!method_exists($domdoc,"document_element")){ print("WTF?"); }
attached mail follows:
Hi,
I am wondering if there is any tangible difference between the following two commands:
$x = $foo["status"]; $x = $foo['status'];
The part in question being the use of ' or " around the "status" element of the array $foo. Both have the same end result in my case, I'm just purely wondering which is the correct form of syntax to use?
Cheers,
Rich
-- Fatal Design http://www.fatal-design.com Atari / DarkBASIC / Coding / Since 1995
attached mail follows:
Richard Davey wrote: > Hi, > > I am wondering if there is any tangible difference between the following two > commands: > > $x = $foo["status"]; > $x = $foo['status']; > > The part in question being the use of ' or " around the "status" element of > the array $foo. > Both have the same end result in my case, I'm just purely wondering which is > the correct form of syntax to use? > > Cheers, > > Rich > -- > Fatal Design > http://www.fatal-design.com > Atari / DarkBASIC / Coding / Since 1995 > >
It all depends on what you use as a key... you just follow the normal string standards. If you want a variable evaluated within the key, then you must use "s if you purely use text then you just need 's.
For example $x=$foo["status $y"]; vs. $x=$foo['status'];
attached mail follows:
"Austin Marshall" <amars
pdq.net> wrote in message
news:3CDC6E17.8020801
pdq.net...
> It all depends on what you use as a key... you just follow the normal
> string standards. If you want a variable evaluated within the key, then
> you must use "s if you purely use text then you just need 's.
>
> For example $x=$foo["status $y"]; vs. $x=$foo['status'];
No variables included in the keys, so it looks like it's ' all the way - excellent, thank you.
I wonder if it matters from an overhead point of view, is PHP doing more work than it ought to using " instead of ' because it's expecting variables?
Cheers,
Rich
-- Fatal Design http://www.fatal-design.com Atari / DarkBASIC / Coding / Since 1995
attached mail follows:
Richard Davey wrote:
> "Austin Marshall" <amars
pdq.net> wrote in message
> news:3CDC6E17.8020801
pdq.net...
>
>>It all depends on what you use as a key... you just follow the normal
>>string standards. If you want a variable evaluated within the key, then
>>you must use "s if you purely use text then you just need 's.
>>
>>For example $x=$foo["status $y"]; vs. $x=$foo['status'];
>
>
> No variables included in the keys, so it looks like it's ' all the way -
> excellent, thank you.
>
> I wonder if it matters from an overhead point of view, is PHP doing more
> work than it ought to using " instead of ' because it's expecting variables?
>
> Cheers,
>
> Rich
> --
> Fatal Design
> http://www.fatal-design.com
> Atari / DarkBASIC / Coding / Since 1995
>
>
that's a possibility, but i'd suspect the overhead comes from when variables are actually inserted/replaced and/or characters escaped. I doubt there would be much of a difference between "status" and 'status' Nor would there be much of a diffrence between 'status '.$foo.' blah'; and "status $foo blah";
I'd be interested to see if there were much a difference performance-wise though.
attached mail follows:
Addressed to: "Richard Davey" <rich
fatal-design.com>
php-general
lists.php.net
** Reply to note from "Richard Davey" <rich
fatal-design.com> Sat, 11 May 2002 01:54:43 +0100
>
> Hi,
>
> I am wondering if there is any tangible difference between the following two
> commands:
>
> $x = $foo["status"];
> $x = $foo['status'];
>
$foo['status']; should be marginaly faster as PHP doesn't have to look for $ in the value that need to be converted to their values.
Rick
Rick Widmer Internet Marketing Specialists http://www.developersdesk.com
attached mail follows:
On Fri, 10 May 2002, Austin Marshall wrote: >> I wonder if it matters from an overhead point of view, is PHP doing >> more work than it ought to using " instead of ' because it's expecting >> variables? > > I'd be interested to see if there were much a difference > performance-wise though.
Quick-and-dirty speed test (comments on my methodology are welcome):
<? $z = array('one' => 1, 'two' => 2, 'three' => 3, 'four' => 4); list ($msec, $sec) = explode(' ', microtime()); $start_time = $msec + $sec; $total = 0; for ($i = 0; $i < 100000; $i++) $total += $z["three"]; list ($msec, $sec) = explode(' ', microtime()); printf ('Elapsed: %f seconds.', ($msec + $sec) - $start_time);
?>
I ran it this way and then changed the $total += line to use 'single quotes' instead of "double".
There was no noticeable difference in times; the variation from one run to the next (between 0.33 and 0.35 seconds) was far greater than the variation between quote types.
Nevertheless I find myself irresistably compelled to keep using the single quotes when I know no string variable substitution is required. Call me an irrational old fool.
miguel
attached mail follows:
I'm trying to install PEAR and having some problems.
What's the minimum PHP version for the current PEAR?
Cheers, Brad
attached mail follows:
I've looked at a bunch of CMS(content management system)'s lately. There are some good ones, and I like the directions they're going.
nadmin studio has the most incredible admin front end for midgard that you would believe. It's at: http://cmsdemo.hklc.com just type in demo for each of the blocks and leave everything else the same. WOW, GOOD STUFF!
As far as I know, midgard has to be installed as an apache mod. This gives it the power to run php scripts written by end users who are part of a site, YET, be subject to permissions by the midgard package, kind of like a cgi wrapper around the file system AND the database contents as well.
A lot of ISP's don't want to mess with their current installed Apache server, and who can blame them? I'm not sure if midgard can be a shared object or not?
Anyway, stuff like PHPNuke, and maybe PostNuke just install in the html/doc root, make everything basically 777(or close to that), and get protection from inadvertent serving of xxx.inc files which have passwords in them with '.htaccess' files containing 'deny all'. It works, BUT ......
------------------------------------------
FINALLY, my question. If some newbie sysadmin at a shared ISP accidentally turned off the php engine AND turned off the user being able to use .htaccess files, all the files in the html/doc root could be served, unprocessed, right? BIG SECURITY problem, huh?
I have heard that it's better to put everything OUT of the doc root to avoid this, or at least, anything with passwords and important parameters. Is there any circumstance where Apache could server outside of the doc root?
-- ----------------------------------------------------------------- Joy is just a thing (to be).. raised on, Love is just the way to Live and Die, John Denver. ----------------------------------------------------------------- He lost a friend, but kept his Memory (also John Denver), Thank you...John Corones...my friend always. ----------------------------------------------------------------- Look lovingly upon the present, for it holds the only things that are forever true. ----------------------------------------------------------------- Sincerely, Dennis Gearon (Kegley)
attached mail follows:
"PHP Powers FreeMovie API for Flash" http://www.oreillynet.com/pub/a/javascript/2002/05/09/freemovie.html
Jacek
attached mail follows:
Hello,
Can anyone please tell me is there any to display the mails like mailing archieve, in one of the folder in Pine..
Regards, Uma
attached mail follows:
On Sat, 11 May 2002, Uma Shankari T. wrote: > Can anyone please tell me is there any to display the mails like mailing > archieve, in one of the folder in Pine..
Open the file with fopen and read through it at your leisure. Every time you come across a line that starts with "From " (From followed by a space), that's a new message.
miguel
attached mail follows:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi all I've been asked to protect an area containing 'course material' (pdf's etc) and have just thought of a gaping hole in what I've done.
I use an class to handle all the auth stuff and each page checks the value of $obj->logged_in :: No problem.
but what if someone links to www.thesite/theProtectedArea/file.tar.gz
that file cannot check if the downloader is logged in can it.
So, any suggestions or words of wisdom would be much appreciated :-)
- -- Nick Wilson // www.explodingnet.com
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux)
iD8DBQE83N09HpvrrTa6L5oRAlSZAJwNVHXfeP3w8aaJTtRUmPH2v/nvNwCfaqp4 HpXVvWLn87rkhCQxnBtszAc= =St/c -----END PGP SIGNATURE-----
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]