php-general Digest 28 Jul 2007 15:30:08 -0000 Issue 4929
Topics (messages 259727 through 259743):
Re: Hide the real URL
259727 by: Eric Butera
259730 by: brian
259731 by: Eric Butera
259732 by: Tom Ray [Lists]
Re: Authentication
259728 by: Instruct ICC
259739 by: Richard Heyes
Re: how to use imagestring() function with Chinese String
259729 by: brian
259734 by: Davis Chan
259736 by: Richard Davey
Re: About XML XSLT
259733 by: mamad876
Re: Solution for writing a function layer between pecl-memcache and PHP
259735 by: Sascha Braun - CEO . Braun Networks
ODF creation functions
259737 by: Dotan Cohen
Re: Pirate PHP books online?
259738 by: Dotan Cohen
Comment modes behavior in HTML and PHP
259740 by: C.R.Vegelin
259741 by: Robert Degen
259742 by: Paul Novitski
259743 by: Daniel Brown
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 ---
On 7/27/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
> On Fri, July 27, 2007 8:20 am, Eric Butera wrote:
> > Not everyone has the option to do that. Plus I think it is
> > unintuitive to have things outside of your actual "web site." You can
> > disallow traffic with Apache fairly easily if you're paranoid of such
> > things.
>
> I used to do this.
>
> Until one day I tar-ed up a site to move to a new webhost.
>
> tar -cf htdocs.tar htdocs
>
> Then I un-tar-ed it, of course:
>
> tar -xf htdocs.tar
>
> For about 15 minutes there, *ALL* the files I didn't want public, were
> public.
>
> I caught the mistake only because something else was broken as well, a
> dynamic PHP-generated image.
>
> Now I don't do that anymore, and I put anything private outside the
> webtree.
>
> If your host doesn't give you a directory outside the webtree, find a
> new host that does :-)
>
> --
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some indie artist.
> http://cdbaby.com/browse/from/lynch
> Yeah, I get a buck. So?
>
>
We have our own dedicated server that we host client sites on. If I
were to back out into the root then I would be at the level of all the
other sites. It just doesn't make sense in my case.
--- End Message ---
--- Begin Message ---
Eric Butera wrote:
On 7/27/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
On Fri, July 27, 2007 8:20 am, Eric Butera wrote:
Not everyone has the option to do that. Plus I think it is
unintuitive to have things outside of your actual "web site." You can
disallow traffic with Apache fairly easily if you're paranoid of such
things.
If your host doesn't give you a directory outside the webtree, find a
new host that does :-)
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
We have our own dedicated server that we host client sites on. If I
were to back out into the root then I would be at the level of all the
other sites. It just doesn't make sense in my case.
Then you haven't set up your directories properly, IMHO.
Let's say you want all of your client web directories under
/var/www/vhosts. Create a dir for each client and set up each of your
DocumentRoots as a dir inside of that one. This way all of your clients
now have a directory above their web root that they can place into
anything they want to keep private.
/var/www/vhosts/client_[1 .. n]/htdocs
brian
--- End Message ---
--- Begin Message ---
On 7/28/07, brian <[EMAIL PROTECTED]> wrote:
> Eric Butera wrote:
> > On 7/27/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
> >
> >>On Fri, July 27, 2007 8:20 am, Eric Butera wrote:
> >>
> >>>Not everyone has the option to do that. Plus I think it is
> >>>unintuitive to have things outside of your actual "web site." You can
> >>>disallow traffic with Apache fairly easily if you're paranoid of such
> >>>things.
> >>
> >>If your host doesn't give you a directory outside the webtree, find a
> >>new host that does :-)
> >>
> >>--
> >>Some people have a "gift" link here.
> >>Know what I want?
> >>I want you to buy a CD from some indie artist.
> >>http://cdbaby.com/browse/from/lynch
> >>Yeah, I get a buck. So?
> >>
> >
> > We have our own dedicated server that we host client sites on. If I
> > were to back out into the root then I would be at the level of all the
> > other sites. It just doesn't make sense in my case.
> >
>
> Then you haven't set up your directories properly, IMHO.
>
> Let's say you want all of your client web directories under
> /var/www/vhosts. Create a dir for each client and set up each of your
> DocumentRoots as a dir inside of that one. This way all of your clients
> now have a directory above their web root that they can place into
> anything they want to keep private.
>
> /var/www/vhosts/client_[1 .. n]/htdocs
>
> brian
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
I didn't set it up. It is how things have been and will continue to
be regardless of my opinion. :)
--- End Message ---
--- Begin Message ---
Eric Butera wrote:
On 7/28/07, brian <[EMAIL PROTECTED]> wrote:
Eric Butera wrote:
On 7/27/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
On Fri, July 27, 2007 8:20 am, Eric Butera wrote:
Not everyone has the option to do that. Plus I think it is
unintuitive to have things outside of your actual "web site." You can
disallow traffic with Apache fairly easily if you're paranoid of such
things.
If your host doesn't give you a directory outside the webtree, find a
new host that does :-)
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
We have our own dedicated server that we host client sites on. If I
were to back out into the root then I would be at the level of all the
other sites. It just doesn't make sense in my case.
Then you haven't set up your directories properly, IMHO.
Let's say you want all of your client web directories under
/var/www/vhosts. Create a dir for each client and set up each of your
DocumentRoots as a dir inside of that one. This way all of your clients
now have a directory above their web root that they can place into
anything they want to keep private.
/var/www/vhosts/client_[1 .. n]/htdocs
brian
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I didn't set it up. It is how things have been and will continue to
be regardless of my opinion. :)
I use this type of structure for my virtual hosting:
domainname.com
--> cgi-bin (CGI and Perl scripts here)
--> error_docs (Custom error pages here. 400, 401, 403, 404 & 500
templates already in place)
--> ftp (Holds virtual FTP user information along with a data directory
for ftp only upload/downloads)
--> htdocs (the website)
--> logs (the site log file)
--> other (where all non-web accessible files/directories/etc go)
Even if they where to go above the domainname.com folder it would just
lead them to /home/user anyways and the FTP server locks them into their
home directories. This allows one user to control multiple domains under
his account.
The beauty about the "other" directory is that you can store anything
you need there. I put hidden .password directories for htaccess
authentication files, attachments for email, data files for things I
don't want web accessible.
--- End Message ---
--- Begin Message ---
From: "Dan Shirah" <[EMAIL PROTECTED]>
All,
I looked on PHP.net but I couldn't not find anything suitable to answer my
question.
Within PHP, is there a way to pull the name of the user that is currently
logged into the PC?
I know with some of the _SERVER functions you can pull the IP of the
machine
and other data, is there a function within this family that would work?
Thanks,
Dan
What operating system is being run on this personal computer?
Who is running the PHP script?
Is the PHP script being run from a web page or the command line?
On a Mac, if I run phpinfo from a command line script, I see my user name in
6 entries with variants of USER and LOGNAME.
If the user was logged into a PHP web page with say htaccess or a custom
HTML Form, I could see the name he logged in with.
_________________________________________________________________
Don't get caught with egg on your face. Play Chicktionary!
http://club.live.com/chicktionary.aspx?icid=chick_hotmailtextlink2
--- End Message ---
--- Begin Message ---
I looked on PHP.net but I couldn't not find anything suitable to answer my
question.
Within PHP, is there a way to pull the name of the user that is currently
logged into the PC?
I know with some of the _SERVER functions you can pull the IP of the machine
and other data, is there a function within this family that would work?
If you're running your PHP script on IIS, maybe. Use print_r():
<?php
print_r($_SERVER);
?>
--
Richard Heyes
+44 (0)844 801 1072
http://www.websupportsolutions.co.uk
Knowledge Base and HelpDesk software
that can cut the cost of online support
--- End Message ---
--- Begin Message ---
Davis Chan wrote:
Hi! I am trying to use the imagestring() function to put a string of
Chinese characters from a $_GET variable onto an image. However, the
characters do not display right (English is fine). Is there a way I can
fix this or it is the limitation of the function itself? Thanks.
Does the font you're using support Chinese characters? Are the
characters coming through in $_GET ok?
How *are* the characters coming through in $_GET?
--- End Message ---
--- Begin Message ---
brian wrote:
Does the font you're using support Chinese characters? Are the
Good point, I think I am just using the "default" and size 1. Are there
other fonts? Where can I find the font file for imageloadfont()?
characters coming through in $_GET ok?
echo $_GET[...]; is fine.
How *are* the characters coming through in $_GET?
May I ask what does this mean?
Thanks.
--- End Message ---
--- Begin Message ---
Hi Davis,
Saturday, July 28, 2007, 1:54:22 AM, you wrote:
> Hi! I am trying to use the imagestring() function to put a string of
> Chinese characters from a $_GET variable onto an image. However, the
> characters do not display right (English is fine). Is there a way I can
> fix this or it is the limitation of the function itself? Thanks.
Using the built-in fonts will not give you Chinese character support.
You need to either build your own font, or find a True Type font that
does have the character set you require, and use the image ttf
functions instead.
Cheers,
Rich
--
Zend Certified Engineer
http://www.corephp.co.uk
"Never trust a computer you can't throw out of a window"
--- End Message ---
--- Begin Message ---
Hi all,
I agree with Jim,
for start you can play with .htaccess and ModRewrite module.
for more information see apache docs or you can also check out how in
httpd.conf accessing .htaccess from clients browser is limited and you can
use the same code for all of your .xml and .xslt files.
Best
M
Kelvin Park wrote:
>
> I had to Parse XML with PHP with database from mysql.
>
> On 7/20/07, Kelvin Park <[EMAIL PROTECTED]> wrote:
>>
>> I'm trying to make a web site that it entirely XML/XSLT/PHP driven,
>> without MYSQL.
>> However, since I need to reuse the database from my last web site, I had
>> to parse XML with PHP and save it as a file (e.g. xmlFile.xml) in my
>> htdocs folder in FTP. However, I understand that this can cause some
>> security issues such as someone just accessing the xml file from the
>> htdocs
>> folder. Would it be the best way to just place the parsed/saved XML file
>> in
>> the root folder of the FTP server for security purposes? Root folder
>> meaning, the parent folder of htdocs, where it cannot be accessed
>> normally
>> through the browser.
>>
>
>
--
View this message in context:
http://www.nabble.com/About-XML-XSLT-tf4120874.html#a11839995
Sent from the PHP - General mailing list archive at Nabble.com.
--- End Message ---
--- Begin Message ---
Dear Mister Minka,
in the attachment of this file, you will find a complete example for
the problem, decscribed.
There are two working examples, and the main example which is not
working.
Could you please be so kind in between to tell me who you are, because
I couldn't find any mails in the php general list or in the memcache
list which have been written from your mail account.
If your are able to correct the error, please send me a patched version.
Thank you very much.
Best Regards,
Sascha Braun
Am Samstag, den 28.07.2007, 01:53 +0200 schrieb Martin Minka:
> Sascha,
> konntest du ein test PHP Script schicken dass dieses Problem wiederholt ?
>
> Meine erste Vermutung ist dass du irgendwo in deinem Kode Fehler hast.
> Wenn du es aber in einen beispiel Script wiederholen kannst werde ich es
> in C Compiler testen.
> Ich habe nämlich inzwischen die Compilierung von PECL-memcache Kode an
> meinem PC eingeästelt um mein Problem mit "redundancy" zu lösen.
>
> Mit grüssen,
> Martin Minka
>
>
> Sascha Braun - CEO @ Braun Networks wrote:
> > Hi dear Sancar,
> >
> > you seem really the best man in place as what I see in the mailing
> > list :)) Thats really lovely I would like to say.
> >
> > Now lets come to the solution I need:
> >
> > public function memcache($pointer, $data="", $compress="", $timeout="0")
> > // store or load data from the memcache
> > {
> > if (MEMCACHE_SUPPORT == 'true') {
> > $memcached_port = $_SESSION['memcache_port'];
> > if (empty($memcached_port)) { $memcached_port = '99999'; }
> > $memcache = memcache_connect('localhost', $memcached_port);
> > if ($memcache) {
> > $memcache_pointer = PROJECT.$pointer;
> > $cache = $memcache -> get($memcache_pointer);
> > if (!$cache) {
> > $memcache->set($memcache_pointer,$data);
> > $cache = $memcache -> get($memcache_pointer);
> > }
> > return $cache;
> > }
> > }
> > }
> >
> > This is the Funktion I use to load and write data to the memcache
> > a write or restore looks like this here site::memcache('pointer',$data);
> >
> > This is working in many cases pretty fine.
> >
> > Now I have a codepart, where the 'pointer' is getting created dynamical-
> > ly. Which means I do fx. a $content_id.'_'.$translation instead of wri-
> > ting a simple 'pointer' as first parameter to the above function.
> >
> > When I now call my XML Parser, to store data in memcache, and try to
> > recall, the data short after, it says:
> >
> > File not found: This file somewhere in the suburbs.
> >
> > But when I try to output the XML Object before the data is written to
> > the cache, everything goes terribly fine.
> >
> > Now I figured out, that when I use static naming for the memcache data
> > pointer 'pointer' everything goes fine.
> >
> > When I use the memcache directly, which means, I call the
> > $memcache->set() and $memcache->get() function from where I store data
> > everything goes fine again, even with dynamically created, variables.
> >
> > But as soon as I use my function layer, call a to
> > site::memcache($pointername,$dataset); only returnes bullshit.
> >
> > Mh, this makes me a little bit sad.
> >
> > Maybe somebody or even you, can help me :))
> >
> > Best Regards, and a baba Respect from Germany, Dear Sancar!
> >
> > Sascha
> >
> >
>
>
memcached-test.tar.gz
Description: application/compressed-tar
--- End Message ---
--- Begin Message ---
Is there a way to create ODF files with php? I don't see anything in
the manual. I would rather use the open ODF standard than proprietary
PDF for distributing documents. Plain text files are inappropriate for
the layout we need, and html is inappropriate for the distribution.
Thank you.
Dotan Cohen
http://lyricslist.com/
http://what-is-what.com/
--- End Message ---
--- Begin Message ---
On 28/07/07, Larry Garfield <[EMAIL PROTECTED]> wrote:
> If "indirectly affecting the market so that prices change" counts as stealing,
> then Coke and Pepsi build their business models around stealing from each
> other.
>
> Apache/PHP/MySQL are then "stealing actual money" from Microsoft, because they
> reduces sales of Windows, IIS, Visual Studio, and MS SQL Server.
>
> Great, so that means we should shut down Pepsi to stop them from stealing from
> Coke, and shut down PHP to stop them from stealing from Microsoft!
>
> I would say that shows just what pathetically laughable bullshit that argument
> is, except that Microsoft has made it publicly before, albeit phrased
> as "defending capitalism". You see why I find it so offensive?
>
Ah, so you are saying that by pirating software/books/music you are
creating market competition, which drives the producers to produce
higher quality content at affordable prices. I feel so stupid that I
didn't see it that way from the beginning.
Dotan Cohen
http://lyricslist.com/
http://what-is-what.com/
--- End Message ---
--- Begin Message ---
I have a PHP script, as follows:
<!--
<?php
echo "should this be echoed ?";
?>
-->
As expected, the browser shows nothing,
but when I view Source in the browser, I see:
<!-- start HTML comment
should this be echoed ?-->
Shouldn't it be just: <!-- -->, without the echo result ?
I don't expect PHP to be active between <!-- -->.
TIA, Cor
--- End Message ---
--- Begin Message ---
On Sa, Jul 28, 2007 at 03:40:07 +0100, C.R.Vegelin wrote:
> I have a PHP script, as follows:
> <!--
> <?php
> echo "should this be echoed ?";
> ?>
> -->
>
> As expected, the browser shows nothing,
> but when I view Source in the browser, I see:
> <!-- start HTML comment
> should this be echoed ?-->
>
> Shouldn't it be just: <!-- -->, without the echo result ?
> I don't expect PHP to be active between <!-- -->.
No, you're expecting something wrong.
A <!-- ... is a HTML Comment which has nothing to do with the
PHP Script execution on server side. Server sided php
code execution is only bound to <? indicators.
>
> TIA, Cor
So far.
Rob
--
Robert Patrick Degen
pgp-publickey http://www-users.rwth-aachen.de/robert.degen/publickey.asc
e-mail [EMAIL PROTECTED]
cellular 0049 - 176 - 22 08 95 01
private 0049 - 241 - 966 18 72
--- End Message ---
--- Begin Message ---
At 7/28/2007 07:40 AM, C.R.Vegelin wrote:
I have a PHP script, as follows:
<!--
<?php
echo "should this be echoed ?";
?>
-->
As expected, the browser shows nothing,
but when I view Source in the browser, I see:
<!-- start HTML comment
should this be echoed ?-->
Shouldn't it be just: <!-- -->, without the echo result ?
I don't expect PHP to be active between <!-- -->.
<!-- ... --> is an HTML comment.
/* ... */ and //... are PHP comments.
The HTML comment syntax does not affect PHP, and PHP comment syntax
does not affect HTML.
http://www.php.net/manual/en/language.basic-syntax.comments.php
Regards,
Paul
__________________________
Paul Novitski
Juniper Webcraft Ltd.
http://juniperwebcraft.com
--- End Message ---
--- Begin Message ---
On 7/28/07, Paul Novitski <[EMAIL PROTECTED]> wrote:
> At 7/28/2007 07:40 AM, C.R.Vegelin wrote:
> >I have a PHP script, as follows:
> ><!--
> > <?php
> > echo "should this be echoed ?";
> > ?>
> >-->
> >
> >As expected, the browser shows nothing,
> >but when I view Source in the browser, I see:
> ><!-- start HTML comment
> > should this be echoed ?-->
> >
> >Shouldn't it be just: <!-- -->, without the echo result ?
> >I don't expect PHP to be active between <!-- -->.
>
>
> <!-- ... --> is an HTML comment.
>
> /* ... */ and //... are PHP comments.
>
> The HTML comment syntax does not affect PHP, and PHP comment syntax
> does not affect HTML.
>
> http://www.php.net/manual/en/language.basic-syntax.comments.php
>
> Regards,
>
> Paul
> __________________________
>
> Paul Novitski
> Juniper Webcraft Ltd.
> http://juniperwebcraft.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Taking a moment to explain the WHY of what's happening should help
you understand it a bit more, Cor. All HTML markup - including
comments - is parsed on the browser side, while PHP is done on the
server side. The server doesn't parse HTML at all, and PHP doesn't
have any knowledge of it's position within a script, or what else
exists outside of the <? ?> tags. Thus, PHP is parsed, compiled, and
executed prior to the web server serving the end-result as pure HTML,
which is then parsed by the browser upon receipt.
--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107
--- End Message ---