php-general Digest 28 Feb 2007 19:34:49 -0000 Issue 4651
Topics (messages 249575 through 249607):
Re: echo text - anti-spam-spider measure
249575 by: Stut
249585 by: Jochem Maas
249589 by: tedd
249591 by: Dave Goodchild
249607 by: John Taylor-Johnston
Re: Who in this list would you...
249576 by: Chris
249588 by: Robert Cummings
249593 by: Jay Blanchard
Your input would be appreciated.
249577 by: lmth.deakin.edu.au
Re: Audio CAPTCHA
249578 by: Németh Zoltán
Re: PHP Documentation in XML
249579 by: Roman Neuhauser
Re: Extract printable text from web page using preg_match
249580 by: Colin Guthrie
Re: IE6 session issues
249581 by: Dave Goodchild
ID problem
249582 by: Delta Storm
249583 by: Németh Zoltán
249595 by: tedd
249597 by: Tim
249598 by: Tim
Re: destructor sequence explained
249584 by: Satyam
Re: getting authentication information from apache
249586 by: Jochem Maas
Re: Include file path.. please help im newby
249587 by: Jochem Maas
FTP issues
249590 by: Larry Bradley
249602 by: Jochem Maas
Re: Combining sound files
249592 by: tedd
249599 by: Colin Guthrie
Re: how to retrieve pictures from postgreSQL DB
249594 by: tedd
Config language support
249596 by: edwardspl.ita.org.mo
249600 by: Seak, Teng-Fong
249601 by: edwardspl.ita.org.mo
249604 by: Seak, Teng-Fong
249605 by: Richard Lynch
PDF Overflow
249603 by: Eddie Schnell
SimpleXML & libxml options (XInclude)
249606 by: Ben Roberts
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
John Taylor-Johnston wrote:
Neat, and thnaks.
How spam-spider-proof is it? I will try this though.
But I will also try it with "mailto:" in entities as well.
Thanks!
John
<!-- HERE ARE THE ENTITIES -->
<a
href="mailto:me@somewhere.com">me@somewhere.com</a>
<!--ENTITIES ABOVE!-->
Of all the possible methods, entities are the easiest for bots to
handle. They just need to decode the entities.
More reliable methods involve using javascript to write out the mailto:
tag. Do it in several statements. But even then, some of the smarter
spiders will execute simple javascript like that. You can make it better
by using onload to execute the javascript which means the spider will
need to implement that, which I don't believe they do at the moment.
Of course the best way is to use an image and don't link it. If it's
just a way for visitors to contact you, use a contact form. You don't
expose the email address and can control it a lot better.
-Stut
--- End Message ---
--- Begin Message ---
Stut wrote:
> John Taylor-Johnston wrote:
>> Neat, and thnaks.
>> How spam-spider-proof is it? I will try this though.
>> But I will also try it with "mailto:" in entities as well.
>> Thanks!
>> John
>>
>> <!-- HERE ARE THE ENTITIES -->
>> <a
>> href="mailto:me@somewhere.com">me@somewhere.com</a>
>>
>> <!--ENTITIES ABOVE!-->
>
> Of all the possible methods, entities are the easiest for bots to
> handle. They just need to decode the entities.
in the past I found the following to be annoying enough for harvesters not to
bother:
function obsfucateString($str)
{
$ret = '';
for ($i=0;$i<strlen($str);++$i)
$ret.= (mt_rand(0,1) ? '&#x'.sprintf("%X",ord($str{$i})) :
'&#'.ord($str{$i})).';';
return $ret;
}
no idea if it's still even remotely useful.
>
> More reliable methods involve using javascript to write out the mailto:
> tag. Do it in several statements. But even then, some of the smarter
> spiders will execute simple javascript like that. You can make it better
> by using onload to execute the javascript which means the spider will
> need to implement that, which I don't believe they do at the moment.
>
> Of course the best way is to use an image and don't link it. If it's
> just a way for visitors to contact you, use a contact form. You don't
> expose the email address and can control it a lot better.
>
> -Stut
>
--- End Message ---
--- Begin Message ---
At 11:22 PM -0500 2/27/07, John Taylor-Johnston wrote:
I need an anti-spam-spider measure for my site. Too many addresses
are getting raked. In once instance, I created a flash page:
http://erasethis.glquebec.org/English/contact.htm
But I just don't have the time to create a flash image for every
single instance, most of which come from dynamically printed PHP
pages from a MySQL database.
Could I dynamically create a flash image, input the email and tell
the flash image to mailto:[EMAIL PROTECTED]
Do anyone have a solution? Does one already exist?
I agree with Stut that entities are the easiest for bots to handle.
As for myself, I use javascript Enkoder -- you can Google it for a
way to use it.
As for an example of its use, please review:
http://sperling.com/contact.php
and inspect the source.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
On 2/28/07, tedd <[EMAIL PROTECTED]> wrote:
At 11:22 PM -0500 2/27/07, John Taylor-Johnston wrote:
>I need an anti-spam-spider measure for my site. Too many addresses
>are getting raked. In once instance, I created a flash page:
>http://erasethis.glquebec.org/English/contact.htm
>But I just don't have the time to create a flash image for every
>single instance, most of which come from dynamically printed PHP
>pages from a MySQL database.
>
>Could I dynamically create a flash image, input the email and tell
>the flash image to mailto:[EMAIL PROTECTED]
>
>Do anyone have a solution? Does one already exist?
I agree with Stut that entities are the easiest for bots to handle.
As for myself, I use javascript Enkoder -- you can Google it for a
way to use it.
As for an example of its use, please review:
http://sperling.com/contact.php
and inspect the source.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
http://automaticlabs.com/products/enkoderform/
--
http://www.web-buddha.co.uk
--- End Message ---
--- Begin Message ---
Can I PHP generate a flash *.swf? How?
If not how do I PHP generate a *.png or gif?
Jochem Maas wrote:
Stut wrote:
Of course the best way is to use an image and don't link it.
--- End Message ---
--- Begin Message ---
Peter Lauri wrote:
[snap]
[snip]
He would need to work in-house. And the location is somewhere in
Scandinavia. He could work as sub contractor or employed for my company.
[/snip]
I don't know too many list denizens who live in Scandinavia, so that
severely limits your choices.
[/snap]
I live in Thailand but that didn't stop me from joining the project at a
worldly well known company as a consultant. And now we are looking for more
guys as the project is growing...
Eh? You're the one saying they must live in Scandanavia and work
in-house, not Jay...
--
Postgresql & php tutorials
http://www.designmagick.com/
--- End Message ---
--- Begin Message ---
On Wed, 2007-02-28 at 18:43 +1100, Chris wrote:
> Peter Lauri wrote:
> > [snap]
> > [snip]
> > He would need to work in-house. And the location is somewhere in
> > Scandinavia. He could work as sub contractor or employed for my company.
> > [/snip]
> >
> > I don't know too many list denizens who live in Scandinavia, so that
> > severely limits your choices.
> > [/snap]
> >
> > I live in Thailand but that didn't stop me from joining the project at a
> > worldly well known company as a consultant. And now we are looking for more
> > guys as the project is growing...
>
> Eh? You're the one saying they must live in Scandanavia and work
> in-house, not Jay...
But he's also saying that relocating to Scandinavia didn't stop him. So
if it didn't stop him, quite likely it won't stop others. And so others
may also be happy to relocate to Scandinavia. Some people jump at the
opportunity to visit the world -- the usually don't have children :)
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
--- End Message ---
--- Begin Message ---
[snippidge]
[snap]
[snip]
He would need to work in-house. And the location is somewhere in
Scandinavia. He could work as sub contractor or employed for my company.
[/snip]
I don't know too many list denizens who live in Scandinavia, so that
severely limits your choices.
[/snap]
I live in Thailand but that didn't stop me from joining the project at a
worldly well known company as a consultant. And now we are looking for
more
guys as the project is growing...
{/snippidge]
No doubt, but the originally requirement says "work in-house. And the
location s somewhere in Scandinavia."
--- End Message ---
--- Begin Message ---
Hello
My name is Lara Thynne and I am a PhD candidate at Deakin University
Australia.
I am currently running a survey at the following address.
https://dcarf.deakin.edu.au/surveys/oss/
The survey is completely confidential and looks at your views and
motivations to use Open Source software and to participate in the
community.
It will only take a few minutes and your contact details will not be
recorded. You can withdraw your participation at any stage.
I sincerely apologize for the spammish nature of this e-mail - I
don't mean to abuse this list. I am trying to collect responses
from as many open source developers and users as possible and a
mailing list like this is probably the best way to reach many of you.
Please personally CC me with any questions/comments posted to the
list in response.
Thanks again
Lara
P.S The program that I am using is open source, of course
(www.phpsurveyor.org)!
--- End Message ---
--- Begin Message ---
2007. 02. 27, kedd keltezéssel 14.15-kor tedd ezt írta:
> Németh:
(call me Zoltán please as that's my first name ;) )
>
> As you know, I'm having more problems with my
> CAPTCHA experiment, so back to basics. (as my mum
> used to say "No good deed goes unpunished."
>
> I need your review. All you have to do is to test
> if the following links produce sound as indicated
> in the browsers you have?
>
> Link one:
>
> http://www.sperling.com/a/a1/index.php
>
> Clicking "Zero" should produce the sound "Zero"
> and leave your browser cold -- it will probably
> leave it showing a player of some sort.
XP/IE7: opens up windows media player, plays 0.au which says "Zero"
Linux/Firefox: opens 0.au with /usr/lib/mime/playaudio, sound is only
noise
>
> Link two:
>
> http://www.sperling.com/a/a1/index1.php
>
> Clicking "Zero" should produce the sound "Zero"
> and then bring your browser back to the original
> page.
XP/IE7: works fine
Linux/Firefox: tells me I have to install some plugin, then redirects to
the original page
>
> Link three:
>
> http://www.sperling.com/a/a1/index2.php
>
> Clicking "Zero" should produce the sound "Zero"
> and then "One" and then bring your browser back
> to the original page.
XP/IE7: works fine
Linux/Firefox: redirects ok, but needs plugin as above
it's probably an issue that it needs plugin to play .au files, I am not
an expert in browser audio ;)
if so, please tell me what plugin to install and I can try again with
that
hope that helps
Zoltán Németh
>
> For me, all the above sounds work, except for
> Opera 9.0 for the Mac -- it works for "Link one"
> but does not work for "Link two" and "Link three".
>
> IE 5.2 for the Mac needs a refresh to jump start
> it. In other words, the very first time for "link
> two" and "link three" I have to do it twice to
> get it to work.
>
> Take your time -- no rush on this. I just need to
> know what browsers work and which don't.
>
> Thanks for your help.
>
> tedd
--- End Message ---
--- Begin Message ---
# [EMAIL PROTECTED] / 2007-02-27 20:38:37 -0800:
> Does anyone know where I could find PHP Documentation in XML or in an SQL
> dump?
In the source repository. http://www.php.net/anoncvs.php
--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991
--- End Message ---
--- Begin Message ---
M5 wrote:
> No, it's not a very good solution. Striptags will leave everything
> within <head>, <style> and <script> (in the body or out). Comments are
> also included.
>
> I know it's possible to use non reg-ex strpos/substr to extra everything
> within <body>, but as another poster correctly said, this assumes a
> consistent HTML document (which there is not).
>
> I realize now that such a regex would be rather sophisticated, but I
> thought surely it must exist, since text-scrapping the readable content
> of a web page must not be rare.
Said it before, but low-tech solution is to use program "lynx" with the
-dump argument and capture the output back to PHP. I'm assuming you are
on Linux or OSX I guess as I've not heard of using lynx on windows.....
There are loads of command line options to control the way lynx displays
the output so you have a very fine grain of control here.
Col
--- End Message ---
--- Begin Message ---
OK. Blank entries means that as date is passed in and validated via forms,
it is then entered into $_SESSION so data can be persistent as the user goes
back and forth. These values are eventually entered into the database and
are blank, whereas the few values that are entered from $_POST (ie credit
card numbers that I don't want to carry around in the session) are fine.
The system works in IE7, FF and Opera and has also worked on my local
version of IE6. I have created a session name and send the
Cache-control:private header, which fixed similar issues in the past, but no
success in this case.
--
http://www.web-buddha.co.uk
--- End Message ---
--- Begin Message ---
Hi,
I'm building an CMS system (for practice and experience :)).
And of course like many times before I have encountered a problem.
The problem is:
I have a index.php that takes the news from the database and publishes
them. And by the end of every news on index.php I have a link ('<a
href="showfullnews.php?id=$id">Show full news</a>')
That leads to a page that has the full news.
At the beginning of showfullnews i have a variable ( $id = $_GET['id']; )
And in index.php I have the following code:
while ($row = mysql_fetch_array($result))
{
$id= $row['id'];
etc...
}
In the database I have two tables one for a short version of news for
index.php and another for fullNews.
In full news the query is: "select title,newsFull from fullnews where
id='$id'";
In the database i'm 100% sure there is a id = 1 in both rows.
I really dont know what is the problem.
Thank you very much!
--- End Message ---
--- Begin Message ---
2007. 02. 28, szerda keltezéssel 10.24-kor Delta Storm ezt írta:
> Hi,
>
> I'm building an CMS system (for practice and experience :)).
>
> And of course like many times before I have encountered a problem.
>
> The problem is:
>
> I have a index.php that takes the news from the database and publishes
> them. And by the end of every news on index.php I have a link ('<a
> href="showfullnews.php?id=$id">Show full news</a>')
>
> That leads to a page that has the full news.
>
> At the beginning of showfullnews i have a variable ( $id = $_GET['id']; )
>
> And in index.php I have the following code:
>
> while ($row = mysql_fetch_array($result))
> {
> $id= $row['id'];
> etc...
> }
>
> In the database I have two tables one for a short version of news for
> index.php and another for fullNews.
>
> In full news the query is: "select title,newsFull from fullnews where
> id='$id'";
>
> In the database i'm 100% sure there is a id = 1 in both rows.
>
> I really dont know what is the problem.
ehh, what is the problem? you didn't tell.
I guess that the fullnews page don't display the news correctly, right?
if so, please show us the code of that page
btw, why are you using two tables?
everything could be put in one with fields like title,shorttext,fulltext
and so on...
and then there would be only one id for one article, which could reduce
confusion and eliminate some possible problems
hope that helps
Zoltán Németh
> Thank you very much!
>
--- End Message ---
--- Begin Message ---
At 10:24 AM +0100 2/28/07, Delta Storm wrote:
The problem is:
I have a index.php that takes the news from the database and
publishes them. And by the end of every news on index.php I have a
link ('<a href="showfullnews.php?id=$id">Show full news</a>')
Yep, that may be the problem -- try:
<a href="showfullnews.php?id=<?php echo($id);?>">Show full news</a>
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
> -----Message d'origine-----
> De : Delta Storm [mailto:[EMAIL PROTECTED]
> Envoyé : mercredi 28 février 2007 10:24
> À : [email protected]
> Objet : [PHP] ID problem
>
> Hi,
>
> I'm building an CMS system (for practice and experience :)).
>
> And of course like many times before I have encountered a problem.
>
> The problem is:
>
> I have a index.php that takes the news from the database and
> publishes them. And by the end of every news on index.php I
> have a link ('<a href="showfullnews.php?id=$id">Show full news</a>')
>
> That leads to a page that has the full news.
>
> At the beginning of showfullnews i have a variable ( $id =
> $_GET['id']; )
>
> And in index.php I have the following code:
>
> while ($row = mysql_fetch_array($result)) {
> $id= $row['id'];
> etc...
> }
>
> In the database I have two tables one for a short version of
I'd suggest just using one table, and when you display the short version
just display a certain number of characters from the full version say 50
first chars as a preview this is what i use:
function debut_texte($texte, $nb_cars) {
$nb_cars = intval($nb_cars);
if (!$nb_cars || !$texte) return($texte);
if (strlen ($texte) <= $nb_cars) return($texte);
$nouveau_texte = substr($texte, 0, $nb_cars-3);
$nouveau_texte .= '...';
return ($nouveau_texte);
}
Sorry its in french, essentialy you pass it your text ($texte) and the
number of characters ($nb_cars) of that text you want to and it returns the
$nb_cars first characters and appends "..." to the end of the text.. This
will save you some confusion by using two tables for the same data...
> news for index.php and another for fullNews.
>
> In full news the query is: "select title,newsFull from
> fullnews where id='$id'";
>
> In the database i'm 100% sure there is a id = 1 in both rows.
>
> I really dont know what is the problem.
Erm me neither.. Need more code to see problem.
> Thank you very much!
>
> --
> PHP General Mailing List (http://www.php.net/) To
> unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
> -----Message d'origine-----
> De : tedd [mailto:[EMAIL PROTECTED]
> Envoyé : mercredi 28 février 2007 15:54
> À : Delta Storm; [email protected]
> Objet : Re: [PHP] ID problem
>
> At 10:24 AM +0100 2/28/07, Delta Storm wrote:
> >The problem is:
> >
> >I have a index.php that takes the news from the database and
> publishes
> >them. And by the end of every news on index.php I have a link ('<a
> >href="showfullnews.php?id=$id">Show full news</a>')
Is this possibly a quote issue?
echo '<a href="showfullnews.php?id=$id">Show full news</a>';
Will not evaluate $id
Whereas echo '<a href="showfullnews.php?id=' . $id . '">Show full news</a>';
Will evaluate $id..
--- End Message ---
--- Begin Message ---
----- Original Message -----
From: "Richard Lynch" <[EMAIL PROTECTED]>
To: "james james" <[EMAIL PROTECTED]>
Cc: <[email protected]>
Sent: Wednesday, February 28, 2007 1:33 AM
Subject: Re: [PHP] destructor sequence explained
On Tue, February 27, 2007 6:11 pm, james james wrote:
Can someone please help explain how the order of object destructors
called
at shutdown is determined, especially with regards to objects composed
of other objects?
I think that changed from version to version, so unless you are on a
dedicated server, you have to manage any order dependencies for
yourself...
I do not think there *IS* a documented ordering to this.
Actually, I think it is documented that the order of the destructors cannot
be predicted. This means that even if you find how it is done in this
particular version, don't count on that to hold if in a newer version they
change it. By stating that it cannot be predicted, the developers reserve
the right to change it at any time.
When an object is deleted, it is put in the list of things to be dispossed
of, and the garbage collector will call the destructors prior to
deallocating the memory. It can happen at any time when there is no higher
priority stuff to be done. So, it all depends on the whim of the garbage
collector, a background item that the developers might change at any time
and whose behaviour depends on lots of unpredictable things such as server
load.
You get whatever order PHP feels like using.
exactly
Satyam
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.4/703 - Release Date: 26/02/2007
14:56
--- End Message ---
--- Begin Message ---
Ryan wrote:
> Richard et al.,
>
> You are right, the variable was not being provided for the apache
> server. Essentially I found the answer here....
>
> http://httpd.apache.org/docs/1.3/misc/FAQ-F.html#remote-user-var
>
> The document has to be protected in order for apache create the
> REMOTE_USER variable. This was an apache subtlety I didn't know about.
> As soon as I protected it with an .htaccess file, it worked fine and
> the user showed up in this variable.
there is possibly another way by using the Rewrite engine to explicitly
set ENV variables based on apache interal, something like this:
RewriteEngine On
RewriteRule ^.*$ - [C,E=VHOSTS_ROOT:/var/www/vhosts]
the above rule ends up providing $_SERVER['VHOSTS_ROOT'] in your script,
a little contrived but you can also do stuff like:
RewriteRule ^.*$ - [C,E=THING:%{REMOTE_USER}]
the 'C' make the rule chained so that you can include it alongside existing
rules transparently.
>
> $_SERVER['REMOTE_USER']
>
> Thanks,
> Ryan
>
>
> On 2/27/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
>> Use <?php phpinfo();?> and see what *IS* there.
>>
>> If what you want isn't there, then the web server didn't provide it.
>>
>> If the web server didn't provide it, PHP can't be blamed for not
>> passing it on to you, which is *ALL* PHP does here.
>>
>> So what you have is a web-server configuration issue in that case.
>>
>>
>> On Mon, February 26, 2007 11:18 am, Ryan wrote:
>> > Tried that ($PHP_AUTH_USER) and it is also empty.
>> >
>> > On 2/24/07, dave <[EMAIL PROTECTED]> wrote:
> try echo $PHP_AUTH_USER;
>
> Ryan wrote:
>> Richard,
>
>> I looked at phpinfo() as you said, same thing...
>
>> _SERVER["REMOTE_USER"] no value
>
>> You may be right, this may not be available, but I don't want to
> keep
>> throwing a login screen in front of users for no apparent reason.
>
>> Thanks,
>> Ryan
>
>
>
>
>> On 2/23/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
>>> On Wed, February 21, 2007 1:01 pm, Ryan wrote:
>>> > I'm new to php and I have am running php on apache. I already
> have
>>> > ldap
>>> > authentication set up in apache would rather not create a
> separate
>>> > system
>>> > for php. What would be ideal would be to get the current
> authenticated
>>> > user
>>> > from the apache environment. At this point I'm grabbing at
> straws, but
>>> > so
>>> > far I've tried....
>>> >
>>> > $ret = apache_getenv("LDAP_USER");
>>> > echo $ret;
>>> > echo $_SERVER['REMOTE_USER'];
>>> > echo $_SERVER['PHP_AUTH_DIGEST'];
>>> > $ret = apache_getenv('PHP_AUTH_DIGEST');
>>> >
>>> > None of these work. Has anyone done this??
>>>
>>> If the answer you are seeking isn't available in:
>>> <?php phpinfo();?>
>>> run on the page where you are trying to do this, then you
> probably
>>> can't get the answer you want.
>>>
>>> Running http://php.net/ldap to re-connect and re-authenticate
> will
>>> probably be fairly cheap, since LDAP is supposed to be pretty
> dang
>>> fast in the first place, and whatever caching is going on for the
> LDAP
>>> or OS calls behind LDAP virtually guarantees that the data you
> want is
>>> in RAM.
>>>
>>> --
>>> Some people have a "gift" link here.
>>> Know what I want?
>>> I want you to buy a CD from some starving artist.
>>> http://cdbaby.com/browse/from/lynch
>>> Yeah, I get a buck. So?
>>>
>>>
>
>> >>
>> >
>> > --
>> > PHP General Mailing List (http://www.php.net/)
>> > To unsubscribe, visit: http://www.php.net/unsub.php
>> >
>> >
>>
>>
>> --
>> Some people have a "gift" link here.
>> Know what I want?
>> I want you to buy a CD from some starving artist.
>> http://cdbaby.com/browse/from/lynch
>> Yeah, I get a buck. So?
>>
>>
--- End Message ---
--- Begin Message ---
StainOnRug wrote:
> Hello I am a beginner at PHP. I searched for my ? but couldn’t pinpoint it..
> My question is, How do I upload include files onto my website include
> directory. Im hosted through Yahoo, I am not running a server on my
> computer. When I check out my PHP info it tells me the include dir is
> include path .:/include:/usr/lib/php.. how do I acess this folder to put
> files in it so that I can take advantage of the include functions on my PHP
> scripts. Thank you sooo much!
you can change the include_path definition in your script. you can also include
files which live in other directories than those defined in the include_path
ini setting.
I doubt you are allowed to upload any files to /include or /usr/lib/php, so your
recourse is to create your 'include' directory somewhere where you can upload
stuff
to and then optionally redefine include_path to point to your personal
'include' dir,
something like:
ini_set('include_path',
ini_get('include_path').':/path/to/your/personal/inc/dir');
see also Peter's comments in his reply to your post.
--- End Message ---
--- Begin Message ---
The following issues are not really PHP issues, but more properly FTP
server issues, but perhaps people on the list have some ideas on how to
solve my problems.
I've written a PHP program to "mirror" data on a local drive to a remote
FTP server. It compares file mod times, and only uploads files that are
newer. Works like a charm. Except ---
The remote FTP server is running on a Fedora LINUX system, but I think any
server would present the same issues.
To examine the remote directories, I use ftp_rawlist() to get a directory
listing which I parse. However, the file modification time does not have a
year, and does not show the seconds. I get around this by "assuming" the
year is the current one, and then compare the file times of the local and
remote files ignoring local file seconds. If they are different, I use
ftp_mdtm() to get the real remote time, and then do my compare. This slows
things down a bit, as I have to go to the FTP server one more time.
Any thoughts on how to get around this? Is there a way to get a better
directory listing?
Second and more serious problem is that when I FTP the file to the server,
the file mod time gets set to the current (file-creation) time. The same
thing happens in a local-to-local file copy using copy(), but I can use
touch() to update the mod time.
Any thoughts on how I might get the remote FTP server to do the equivalent
of touch()?
I realize that these are not actual PHP problems, but maybe one of you has
run across similar issues.
Many thanks.
Larry Bradley
Orleans (Ottawa), Ontario, CANADA
--- End Message ---
--- Begin Message ---
is your 'local system' linux? then the totally non answer is probably
that you should be using rsync.
if it's a windows machine you can probably still use rsync there by running
it on top of cygwin.
I would also recommend tunnelling the rsync traffic through an SSH connection.
Larry Bradley wrote:
> The following issues are not really PHP issues, but more properly FTP
> server issues, but perhaps people on the list have some ideas on how to
> solve my problems.
>
> I've written a PHP program to "mirror" data on a local drive to a remote
> FTP server. It compares file mod times, and only uploads files that are
> newer. Works like a charm. Except ---
>
> The remote FTP server is running on a Fedora LINUX system, but I think
> any server would present the same issues.
>
> To examine the remote directories, I use ftp_rawlist() to get a
> directory listing which I parse. However, the file modification time
> does not have a year, and does not show the seconds. I get around this
> by "assuming" the year is the current one, and then compare the file
> times of the local and remote files ignoring local file seconds. If they
> are different, I use ftp_mdtm() to get the real remote time, and then do
> my compare. This slows things down a bit, as I have to go to the FTP
> server one more time.
>
> Any thoughts on how to get around this? Is there a way to get a better
> directory listing?
>
> Second and more serious problem is that when I FTP the file to the
> server, the file mod time gets set to the current (file-creation) time.
> The same thing happens in a local-to-local file copy using copy(), but I
> can use touch() to update the mod time.
>
> Any thoughts on how I might get the remote FTP server to do the
> equivalent of touch()?
>
> I realize that these are not actual PHP problems, but maybe one of you
> has run across similar issues.
>
> Many thanks.
>
> Larry Bradley
> Orleans (Ottawa), Ontario, CANADA
--- End Message ---
--- Begin Message ---
At 5:28 PM -0600 2/27/07, Richard Lynch wrote:
On Sun, February 25, 2007 9:22 am, tedd wrote:
> However, I can't do the same with .WAV files. Does anyone know a way
to combine .WAV files similar to the way shown above?
The first 256 bytes of a .WAV file contains magic numbers indicating
the bit-size (16-bit, 8-bit, whatever) and sampling rate (44.1 kHz,
22.05 kHz, 96kHz, etc) and imaging (stereo, mono, and I think maybe
others) as well as the total number of samples (I.e., file length).
There are also some slots for things like copyright, comments etc, as
I recall.
You're going to have to find specs on that header info, read the first
256 bytes of each file, compute new numbers to put into the .wav
header, and write out the new 256 bytes and then the remainders of the
two files.
If the two files are NOT both the same bit/sample rate, then you'd
have some REAL fun trying to scale/re-sample the actual audio... :-)
You may find it easier/faster to just locate a .wav splicer command
line tool and run exec with it. Though perhaps not nearly as fun,
depending on your definition of fun.
I'm not sure I can or need to run exec, nor do I actually know how.
I'll deal with that later in my life.
For the moment, I can use a HEX Editor and inspect the first 256
bytes of a wav file and find out all the goodies therein, but do you
know if I strip out the first 256 bytes can I then combine the files
so they will work (providing the sample rates, frequencies, and such
as the same)?
Thanks for your help.
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
tedd wrote:
> I'm not sure I can or need to run exec, nor do I actually know how. I'll
> deal with that later in my life.
Go on, it's easy!
http://uk2.php.net/manual/en/function.exec.php
That said, depending on your hosting, you may be banned from exec.
> For the moment, I can use a HEX Editor and inspect the first 256 bytes
> of a wav file and find out all the goodies therein, but do you know if I
> strip out the first 256 bytes can I then combine the files so they will
> work (providing the sample rates, frequencies, and such as the same)?
No need for a hex editor...
1) Take all your .wav files and use sox on command line (or another tool
if you prefer) to convert them all to RAW PCM files (e.g. no header).
2) Take the filesize of the WAV and subtract the filesize of the RAW
PCM. The value you have left is the size of the WAV header, so take the
first n bytes of one of your WAVs and save it to e.g. "wav.hdr". Double
check with your hex editor as I'm not 100% sure about this (OK, you do
need it after all :p)
3) In theory to create the full wav you just concatenate the wav.hdr +
the correct combination of your letters/numbers RAW PCM files.
4) You should be left with a proper, valid .wav file (I think).
Not really sure of the above but I think it's all true!!
Take care.
Col.
--- End Message ---
--- Begin Message ---
At 5:12 PM -0600 2/27/07, Richard Lynch wrote:
Personally, I think your first mistake was putting the image into the
DB at all.
Unless you're the CIA doing pixel comparisons actually in SQL stored
procedures or something. :-)
Richard:
I highly respect your opinion and on this list you provide tremendous
help -- however -- I must disagree with you about storing images in
dB's. Both techniques (using dB or the file system) have their
up-sides and down-sides and neither have anything to do about CIA
pixel comparisons?
This idea of CIA pixel comparisons has been brought up before and
it's pointless. There is no way for anyone to do a pixel search in
MySQL. Images are not text and thus can't be subject to a "full text"
like search. There are no functions in MySQL that will permit pixel
searches AND that isn't important anyway -- not everything stored in
a dB has to be search-able. That's not a requirement for entry!
When someone uses a dB for storing images, that's what they are doing
-- storing. I never store images without other data, like image type,
size, description and such. So, why would I want to separate out that
single attribute from a record and store that in a remote file system
when I could just as easily store it in a dB? It's like saying "Never
use css to display an image, only use html" when both work well under
different needs.
Furthermore, I have yet to talk with a single MySQL expert nor read a
single MySQL book that claims what you claim. Could you be mistaken?
Perhaps you might rethink your position. You know, we all learn -- I
do everyday.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
Dear all,
How to config the default Character Set and Collation with big5 ?
Edward.
--- End Message ---
--- Begin Message ---
Why still use Big5, this pre-historical encoding? Come on, we're in
the 21st century. You should use Unicode!
[EMAIL PROTECTED] wrote:
> Dear all,
>
> How to config the default Character Set and Collation with big5 ?
>
> Edward.
>
----------
* Zoner PhotoStudio 8 - Your Photos perfect, shared, organised!
www.zoner.com/zps
You can download your free version.
--- End Message ---
--- Begin Message ---
Seak, Teng-Fong wrote:
> Why still use Big5, this pre-historical encoding? Come on, we're in
>the 21st century. You should use Unicode!
>
>[EMAIL PROTECTED] wrote:
>
>
>>Dear all,
>>
>>How to config the default Character Set and Collation with big5 ?
>>
>>Edward.
>>
>>
>>
>
>
>
>----------
>* Zoner PhotoStudio 8 - Your Photos perfect, shared, organised!
>www.zoner.com/zps
> You can download your free version.
>
>
>
Hello,
Due to some of DB data still stored with big5...
Edward.
--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] wrote:
>
> Seak, Teng-Fong wrote:
>> Why still use Big5, this pre-historical encoding? Come on, we're in
>> the 21st century. You should use Unicode!
>>
> Hello,
>
> Due to some of DB data still stored with big5...
>
> Edward.
You could export your data out of your DB, convert them to Unicode
(normally in UTF-8), then import them into the DB.
This might, at first glance, be overkilling and useless. But in
long term, you'll be rid of a lot of problems due to encoding
conversions and support to old encodings.
And there's an even stronger argument for you in case the previous
one can't convince you. Big-5 only supports traditional Chinese
characters. As Macao is a part of China, and people tend to use
simplified Chinese more and more, you'll sooner or later confront the
problem of not being able to support simplified Chinese. Unicode, on
the other hand, supports traditional as well as simplified Chinese (and
a lot a lot other languages, but you're not concerned in this matter).
Unicode is really the way to go in long term.
----------
* Zoner PhotoStudio 8 - Your Photos perfect, shared, organised!
www.zoner.com/zps
You can download your free version.
--- End Message ---
--- Begin Message ---
On Wed, February 28, 2007 8:52 am, [EMAIL PROTECTED] wrote:
> Dear all,
>
> How to config the default Character Set and Collation with big5 ?
Web page:
http://php.net/header and charset on Content-type
Plus you need it in META HTTP-EQUIV tag for IE and off-line saved HTML.
MySQL:
SET CHARACTER SET 'big5'
or something like that
More info at http://dev.mysql.com
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
--- End Message ---
--- Begin Message ---
I am writing a PHP file that outputs a PDF file that will have a bunch
of data from the data base. After the ammount of data hits 24 pieces(23
with 0) i need it to go to a new page. I am using the PDFB Library which
contains a custom barcode thing, FPDI+FPDF.
Thank's for your help in advance, Eddie
--- End Message ---
--- Begin Message ---
Hi there. I'm hoping someone can help me with what I think might be a
slightly obscure problem.
I'm trying to get the SimpleXML extension to read an XML file and
process the XInclude statements within the XML file.
The SimpleXML docs state that libxml options may be specified using the
predefined constants that are available when PHP is compiled with libxml
support (as it is when you use SimpleXML).
http://uk2.php.net/manual/en/function.simplexml-element-construct.php
So, looking at the libxml options, I see there is a predefined constant
LIBXML_XINCLUDE which when specified should implement XInclude
substitution. So my SimpleXML object I define as follows:
$xml_file = './master.xml';
$xml = new SimpleXMLElement($xml_file, LIBXML_XINCLUDE, true);
print_r($xml);
Viewing the resulting datastructure shows me that it has not honoured
the request to implement the XInclude directives.
Does anyone know if a) I'm using the correct syntax for this, and b)
have any experience of getting this working.
My master.xml file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns:xi="http://www.w3.org/2001/XInclude">
<foo>ssd</foo>
<bar>sss</bar>
<xi:include href="a.xml">
<xi:fallback>
<error>xinclude - a.xml not found</error>
</xi:fallback>
</xi:include>
</root>
and then I have a.xml which looks like:
<?xml version="1.0" encoding="UTF-8"?>
<a_root>
<oranges>test</oranges>
<apples>test more</apples>
</a_root>
I'm running PHP 5.1.5 with libxml 2.6.20 on Fedora Core 4 linux.
Cheers
Ben
--- End Message ---