php-general Digest 23 Feb 2006 02:05:25 -0000 Issue 3979
Topics (messages 230893 through 230924):
Re: php 4 v php 5
230893 by: David Tulloh
auto download
230894 by: Benjamin Adams
230896 by: John Nichel
230898 by: Benjamin Adams
230902 by: John Nichel
230903 by: tedd
Re: CLI utility
230895 by: John Nichel
Wormux
230897 by: yeKcim
Re: Problem with mail() on Debian
230899 by: Jochem Maas
Beta Testers Wanted
230900 by: Matt Palermo
Altering subject of email in a pop3 mailbox
230901 by: IG
230914 by: Chris
Re: array variables with or without quotes
230904 by: Chuck Anderson
230908 by: Jason Karns
Conceptional question on dealing with different languages
230905 by: janbro
230907 by: Philip Hallstrom
Re: "Nested Set Model" or "modified preorder tree traversal"
230906 by: Daevid Vincent
(array)
230909 by: Jay Paulson
230910 by: John Nichel
230911 by: Ray Hauge
How secure is this?
230912 by: tedd
230913 by: Björn Bartels
How can I stop PHP from resolving symlinks?
230915 by: Roy Souther
230917 by: Chris
Case issue with eregi_replace in text highlight function
230916 by: Nicolas Verhaeghe
230918 by: Chris
230919 by: Nicolas Verhaeghe
230920 by: Chris
230921 by: Chrome
Issue with encrypted string created with Crypt_CBC and urls and mod_rewrite
230922 by: Dan Rossi
parse_url not parsing hosts with www properly in php 5.1.2
230923 by: Dan Rossi
230924 by: Chris
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:
php-general@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
tedd wrote:
> Hi:
>
> Curt. said:
>
>> PHP 4.4.2 - Released Jan 13 2006
>> php 5.1.2 - Released Jan 12 2006
>> PHP 5.0.5 - Released Sept 6 2005
>>
>> I wouldn't expect any more releases of 5.0.x version.
>
>
> Pardon my ignorance -- I have enough problems pounding out code to spend
> time following what's happening at the higher levels. But, considering
> the above statement, are there continuing development paths for both php
> 4 and 5 independently?
>
> If so, what's the distinction between the two, oop? And if so, what
> about non-oop stuff -- do they share common libraries, or what?
> Generally, how does all of this fit together?
>
> Thanks.
>
> tedd
>
PHP 5.1 is the active development branch. 5.1.2 is the latest release
of that branch.
4.4 and 5.0 are old branches, they are not actively being developed.
Security and some bug fixes are applied to these branches, hence the
recent releases.
If you are developing new code, I'd recomend using 5.1. Some servers
still use 4.4 and should probably be avoided. There's fairly
substantial differences between 4 & 5 making upgrading an issue; I
suspect the devs will get tired of patching up version 4 soon, making
security an issue.
David Tulloh
--- End Message ---
--- Begin Message ---
I have three links. The code already auto selects one.
I'm trying to take that one link and automaticly start the download.
I tryed with header('location:$link');
but it tells me "Warning: Cannot modify header information"
what would I use to start downloading?
one of the link is another page so I need it to pop up in a new window.
Thanks for any help
--- End Message ---
--- Begin Message ---
Benjamin Adams wrote:
I have three links. The code already auto selects one.
I'm trying to take that one link and automaticly start the download.
I tryed with header('location:$link');
but it tells me "Warning: Cannot modify header information"
what would I use to start downloading?
one of the link is another page so I need it to pop up in a new window.
Thanks for any help
http://us2.php.net/header
--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
I have it working with javascript but the if statements are not working:
<?php
$num_download = rand(0,100);
echo $num_download;
if($num_downlaod <= 50){
?>
<script type="text/javascript">
window.open('<?=$conf[$links]['link1']?>');
</script>
<?php
}else if(($num_download > 50) && ($num_download <= 75) && ($conf
[$links]['link2'] != '')){
?>
<script type="text/javascript">
window.open('<?=$conf[$links]['link2']?>');
</script>
<?php
}else if(($num_download > 75) && ($num_download <= 100) && ($conf
[$links]['link3'] != '')){
?>
<script type="text/javascript">
window.open('<?=$conf[$links]['link3']?>');
</script>
<?php
}else{
?>
<script type="text/javascript">
window.open('<?=$conf[$links]['link1']?>');
</script>
<?php
}
?>
Only the first if runs and is true all the time.
What is wrong with the code?
On Feb 22, 2006, at 12:41 PM, John Nichel wrote:
Benjamin Adams wrote:
I have three links. The code already auto selects one.
I'm trying to take that one link and automaticly start the download.
I tryed with header('location:$link');
but it tells me "Warning: Cannot modify header information"
what would I use to start downloading?
one of the link is another page so I need it to pop up in a new
window.
Thanks for any help
http://us2.php.net/header
--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Benjamin Adams wrote:
I have it working with javascript but the if statements are not working:
<?php
$num_download = rand(0,100);
-------^^^^^^^^
echo $num_download;
if($num_downlaod <= 50){
----------^^^^^^^^
See a problem?
--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
I have three links. The code already auto selects one.
I'm trying to take that one link and automaticly start the download.
I tryed with header('location:$link');
but it tells me "Warning: Cannot modify header information"
what would I use to start downloading?
one of the link is another page so I need it to pop up in a new window.
Thanks for any help
Check out:
http://www.weberdev.com/get_example-3938.html
If you have additional problems, contact me I have code that I use.
tedd
--
--------------------------------------------------------------------------------
http://sperling.com
--- End Message ---
--- Begin Message ---
Ray Cantwell wrote:
Hello again,
I was wondering if any of you knew of a good command line utility for
php5 on linux? The box i write on has no X-windows.
Ray.
A command line utility to do what?
--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Hello.
Wormux is an opensource clone of Worms (Team17) :
http://www.wormux.org.
My name is CARRÉ Anthony (yeKcim) and i'm a Wormux
contributor, i draw some characters (skins) for this
game : http://www.wormux.org/wiki/en/skins.php.
My idea is to use opensource software mascots to draw
funny characters. I already drew : Tux team (Linux),
GNU team (GNU), Konqui team (KDE), Firefox team
(Firefox), Wilber team (Gimp), Nupik team (NuFW), PHP
Team (PHP), Snort Team (Snort). The next team i will
draw should certainly be the Thunderbird.
All skins are now integrated in Wormux but now the
Wormux team want to be sure that no licence problems
will appear ?
Of course, i don't use original pictures.
I know that NuFW team is happy to see Nupik in Wormux
(http://www.nufw.org/+Nupik-NuFW-s-mascotte-in-wormux+.html).
I don't know what is your opinion for your mascott. If
your project team don't want to see your mascott in
Wormux, we will delete it.
If this message is not addressed to the good mail, if
you know who can inform me, thank you to contact me
and sorry for the disturbance.
I'm french, sorry for my english.
Thank you
yeKcim
PS @ Mr Nitot : Je sais que je vous ai déjà dérangé
avec cette question et je m'excuse de vous déranger à
nouveau mais l'équipe de Wormux me demande de
contacter les équipes de developpeurs avant chaque
nouvelle création. Je n'ai pas trouvé d'adresse ou de
liste de diffusion adaptée à cette question, si vous
savez ou je devrais écrire, merci. Pour info,
thunderbird pourrait ressembler à :
http://yeknan.free.fr/thunder.png il n'a pas un
physique gracieux mais c'est voulu.
___________________________________________________________________________
Nouveau : téléphonez moins cher avec Yahoo! Messenger. Appelez le monde entier
à partir de 0,012 /minute !
Téléchargez sur http://fr.messenger.yahoo.com
--- End Message ---
--- Begin Message ---
George Pitcher wrote:
Hi,
I am in the process of moving from Windows (NT/XP) to Linux. I'm starting
with a new small application which I have working on my Windows XP laptop.
On my Linux box, I have php.ini saying:
search this page for 'exim' - it should help:
http://php.net/mail
sendmail_path /usr/sbin/sendmail
this may need to become:
sendmail_path /usr/sbin/sendmail -t
and it may require quotes:
sendmail_path "/usr/sbin/sendmail -t"
That 'sendmail' is a symbolic link to exim4 in the same directory. I can
send mail using exim4 from the command line, but not using PHP. I couldn't
find anything in the manual or on Google that helps me solve the problem.
Can anyone give me a clue where to look to solve this problem?
Cheers
George, in Oxford
--- End Message ---
--- Begin Message ---
Hey guys. I would like to first say thanks for all the help you have all
given me in the past (especially in my early programming days). Once again,
I would like to show my appreciation by offering an opportunity to use a new
PHP program I have created. The program is called TotalXplorer. Basically
it's an online file manager for your website that uses PHP's FTP
functionality to perform actions on files/folders (this get's rid of the
need to make them writable for PHP). The file manager also has a built-in
file upload feature, file editor, mp3 music player (to play tracks directly
from your site without downloading them first), and more. You can view the
demo of it here:
http://sweetphp.com/projects/TotalXplorer/
I'm looking for 5-10 people who would be willing to help test it out and
give feedback about it. In exchange for this, you will receive a free copy
of the software when it's ready to go. If you are interested, please let me
know. This will be first come, first server, but please be willing to put
in a little time with the testing of it. I have offered similar beta
testing programs for some of the other scripts I have available at
http://sweetphp.com and they have become very successful because of all your
help.
Thanks,
Matt Palermo
[EMAIL PROTECTED]
http://sweetphp.com
--- End Message ---
--- Begin Message ---
Hi all.
Tried to find this and can't find any info.
I am writing a spam filter to run over multiple pop3 mail boxes which
will work on keywords and Bayesian. With a very high score the filter
will simply delete the email, with a med-high it will back the email in
a 'bulk-mail' folder and delete it from the mailbox. with medium score I
was wanting it to append the keyword [spam?] to the subject line and
keep it in the pop3 mailbox. I can't work out how to do this in php. Can
anyone help me on this one? Is it possible to alter a subject line (or
body for that matter) of an email in a pop3 mailbox?
Thanks.
--
------------------------
[EMAIL PROTECTED]
www.selectperformers.com
--- End Message ---
--- Begin Message ---
IG wrote:
Is it possible to alter a subject line (or
body for that matter) of an email in a pop3 mailbox?
If it's already in the mailbox, then I highly doubt you can do this.
You need to do this on the way in before it gets to the account.
Consider the ramifications if you could:
Anyone could login to your mail account and change the emails already there.
Eek!
--
Postgresql & php tutorials
http://www.designmagick.com/
--- End Message ---
--- Begin Message ---
2dogs wrote:
I recently encountered a situation where I had to retrieve data from a MYSQL
database table with a field named "include". My code looked like this:
$content_result = mysql_query('SELECT * FROM calander') or
die(mysql_error());
$content_row = mysql_fetch_array($content_result);
if ($content_row[include])
{go do something;}
When I tried to run this, PHP treated the word -include- as a control
structure rather than an index name. Understandable. So, I put it in single
quotes ('include') to see what would happen and it works fine. But I don't
understand why!
What is the difference between $content_row [include] and
$content_row['include']? I have been unable to resolve this question in the
php manual, I need enlightenment.
2dogs
http://www.php.net/manual/en/language.types.array.php#language.types.array.foo-bar
--
*****************************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Integrity is obvious.
The lack of it is common.
*****************************
--- End Message ---
--- Begin Message ---
I believe it is because without the quotes, it is expecting a predefined
constant. With the quotes, it is expecting an array key. This is why if you
use a word that is not defined as a constant, php will first look for it as
a constant, won't find it, then looks through the array treating it like a
key. If it is found as a constant, then the constant's value is used as the
key.
Jason
-----Original Message-----
From: Chuck Anderson [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 22, 2006 3:30 PM
To: php-general@lists.php.net
Subject: [PHP] Re: array variables with or without quotes
2dogs wrote:
>I recently encountered a situation where I had to retrieve data from a
>MYSQL database table with a field named "include". My code looked like
this:
>
>$content_result = mysql_query('SELECT * FROM calander') or
>die(mysql_error()); $content_row = mysql_fetch_array($content_result);
>if ($content_row[include])
> {go do something;}
>
>When I tried to run this, PHP treated the word -include- as a control
>structure rather than an index name. Understandable. So, I put it in
>single quotes ('include') to see what would happen and it works fine.
>But I don't understand why!
>
>What is the difference between $content_row [include] and
>$content_row['include']? I have been unable to resolve this question in
>the php manual, I need enlightenment.
>
>2dogs
>
>
http://www.php.net/manual/en/language.types.array.php#language.types.array.f
oo-bar
--
*****************************
Chuck Anderson . Boulder, CO
http://www.CycleTourist.com
Integrity is obvious.
The lack of it is common.
*****************************
--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
smime.p7s
Description: S/MIME cryptographic signature
--- End Message ---
--- Begin Message ---
Hello list,
it has been a while since I've posted the last time, but now I need your
help/ opinion again. I'm re-designing an existing page for an online
shop which is supposed to be used in different languages. The former
design was just a plan echo for an output since the page was only
intended for the German market. But now the output depends on the
language the user selected. Currently we think of two languages, but
that might change sooner or later (management decision...).
Of course I don't want to ad an case of $language for every former echo.
I want to export the content to one central file/ object / table...
The infrastructure is PHP5 MySQL.
Now my ideas, where I would need your opinion:
1. a XML File which I read via SimplXML
2. a plan Text file
3. a PHP class where I delviver the content out of arrays
4. or a table in MySQL
Do you have other options, that might be useful? Which would you prefer?
thx Jan
--- End Message ---
--- Begin Message ---
Hello list,
it has been a while since I've posted the last time, but now I need your
help/ opinion again. I'm re-designing an existing page for an online
shop which is supposed to be used in different languages. The former
design was just a plan echo for an output since the page was only
intended for the German market. But now the output depends on the
language the user selected. Currently we think of two languages, but
that might change sooner or later (management decision...).
Of course I don't want to ad an case of $language for every former echo.
I want to export the content to one central file/ object / table...
The infrastructure is PHP5 MySQL.
Now my ideas, where I would need your opinion:
1. a XML File which I read via SimplXML
2. a plan Text file
3. a PHP class where I delviver the content out of arrays
4. or a table in MySQL
Do you have other options, that might be useful? Which would you prefer?
Haven't used it, but see it everywhere...
http://us3.php.net/gettext
--- End Message ---
--- Begin Message ---
Peter Brawley on the mySQL list pointed me at:
http://www.artfulsoftware.com/mysqlbook/sampler/mysqled1ch20.html
Which uses mySQL 5's procedures and such.
I haven't implemented this yet, but it appears to be what I wanted for the
most part.
> -----Original Message-----
> From: Curt Zirzow [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 21, 2006 10:58 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] "Nested Set Model" or "modified preorder
> tree traversal"
>
> On Tue, Feb 21, 2006 at 09:38:53PM -0800, Daevid Vincent wrote:
> > I've been searching the web for the past few hours trying
> to find a simple
> > drop-in class or functions to implement "Nested Set Model"
> or "modified
> > preorder tree traversal".
>
> I actually fell in love of this method of doing trees when I
> discovered it about a year ago, when researching a fast way to do
> a parent child retrieval.
>
> >
> > I've found several tutorials and related links:
> >
> >
> http://dev.mysql.com/tech-resources/articles/hierarchical-data.html
> > http://www.sitepoint.com/article/hierarchical-data-database
> >
> >
> http://www.zend.com/zend/tut/tutorial-ferrara2.php?article=tut
> orial-ferrara2
> > &id=3453&open=1&anc=0&view=1
> > http://simon.incutio.com/archive/2003/06/19/storingTrees
> > http://istherelifeafter.com/joecelko.html
> > http://www.codeproject.com/cs/database/Trees_in_SQL_databases.asp
>
> oh i have to add some of these to my list, i didn't have a couple
> of them.
>
> >
> > I even found some outdated PEAR DB_NestedSet class from
> 2003 that seemed way
> > to overly complicated. And some other PHP4_Mysql3MPTTA
> class on PHP Classes
> > that was equally complicated and written for ancient PHP4
> and mySQL 3!!
>
> yeah, i kind of got that feeling with the PEAR class as well, i
> think it was designed that way to be as flexible as possible. I'm
> not familiar with the other class, i tend to avoid anything from
> PHP Classes.
>
> >
> > Hasn't anyone else done this before (recently)?
> > Did everyone just write their own code every time?
> > Anyone have some easy to use code that allows for:
> > Add, delete, update/rename, select, show tree, bread crumb
> display, etc.
>
> It would be nice to have a tool to manage the functionality. There
> will always be the issue with any common tool that is built for
> this purpose is how do you relate the table that defines the nested
> with the table that actually holds the data.
>
> I believe that why the PEAR and other classes you came across
> seemed to be overly complicated. I have found that it is easier to
> write my own management (as awful as that sounds) for the job at
> hand.
>
> >
> > I use PHP 5.0.5 and mySQL 5.0.18, so ideally it would take
> advantage of all
> > the optimizations and bells & whistles of those more modern
> versions.
>
> 5.0.5? you mentioned that php4 is ancient, 5.0.5 is more ancient
> than php4.. infact 5.0.x is rather dead.
>
> PHP 4.4.2 - Released Jan 13 2006
> php 5.1.2 - Released Jan 12 2006
> PHP 5.0.5 - Released Sept 6 2005
>
> I wouldn't expect any more releases of 5.0.x version.
>
>
> Curt.
> --
> cat .signature: No such file or directory
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Just came across some code I haven't seen before and can't find anything on
php.net or google about it (maybe I'm not searching for the right thing?).
What is the following doing?
// $dataobject is holding a bunch of variables like:
// $dataobject->var1
// $dataobject->var2
// etc...
(array)$dataobject;
Is this making the $dataobject an associative array like:
$dataobject["var1"]
$dataobject["var2"]
Or is it doing something different?
Thanks!
--- End Message ---
--- Begin Message ---
Jay Paulson wrote:
Just came across some code I haven't seen before and can't find anything on
php.net or google about it (maybe I'm not searching for the right thing?).
What is the following doing?
// $dataobject is holding a bunch of variables like:
// $dataobject->var1
// $dataobject->var2
// etc...
(array)$dataobject;
Is this making the $dataobject an associative array like:
$dataobject["var1"]
$dataobject["var2"]
Or is it doing something different?
Yes, I believe it's type-casting the object into an array. Do a print_r
( $dataobject ) on it before and after the casting.
--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
On Wednesday 22 February 2006 15:09, John Nichel wrote:
> Jay Paulson wrote:
> > Just came across some code I haven't seen before and can't find anything
> > on php.net or google about it (maybe I'm not searching for the right
> > thing?). What is the following doing?
> >
> > // $dataobject is holding a bunch of variables like:
> > // $dataobject->var1
> > // $dataobject->var2
> > // etc...
> >
> > (array)$dataobject;
> >
> > Is this making the $dataobject an associative array like:
> >
> > $dataobject["var1"]
> > $dataobject["var2"]
> >
> > Or is it doing something different?
>
> Yes, I believe it's type-casting the object into an array. Do a print_r
> ( $dataobject ) on it before and after the casting.
>
> --
> John C. Nichel IV
> Programmer/System Admin (ÜberGeek)
> Dot Com Holdings of Buffalo
> 716.856.9675
> [EMAIL PROTECTED]
I was curious about this myself, so I took a look at the "Types" section of
the PHP manual, and an array is really a compound type. With that in mind it
makes sense that you could typecast to an array.
http://www.php.net/manual/en/language.types.php
--
Ray Hauge
Programmer/Systems Administrator
American Student Loan Services
http://www.americanstudentloan.com
1.800.575.1099
--- End Message ---
--- Begin Message ---
Hi gang:
A few days ago I posted my first attempt ajax. I posed the question
"Could a bot find my email address contained within the code?"
There was some discussion, but I wasn't sure as to what the decision
was, so I made another example, which can be found at:
http://www.xn--ovg.com/aja
How secure is this from bots? Could a bot (or anyone) get to my
email address via the code? Of course, you can read my email address
by looking at the site, but I think I've hidden the code well enough
from bots -- am I wrong? And if so, how would a bot, or anyone for
that matter, find it?
Thanks for looking and any suggestions you may have.
tedd
PS: This site works for: Opera 8.5+, Safari, Netscape 7.2+, Mozillia
1.6+, FireFox 1.0.7+, Konqueror 3.4.0+, and IE 5+ (except Mac)
--
--------------------------------------------------------------------------------
http://sperling.com
--- End Message ---
--- Begin Message ---
Hi tedd...
is this enough... : http://www.xn--ovg.com/aja/rpc.php?action=start
in my opinion, an <img src="crt_eml_btn.php" onclick="contact()"> is a
handy way...
cheers
bb
>Hi gang:
>
>A few days ago I posted my first attempt ajax. I posed the question
>"Could a bot find my email address contained within the code?"
>
>There was some discussion, but I wasn't sure as to what the decision
>was, so I made another example, which can be found at:
>
>http://www.xn--ovg.com/aja
>
>How secure is this from bots? Could a bot (or anyone) get to my
>email address via the code? Of course, you can read my email address
>by looking at the site, but I think I've hidden the code well enough
>from bots -- am I wrong? And if so, how would a bot, or anyone for
>that matter, find it?
>
>Thanks for looking and any suggestions you may have.
>
>tedd
>
>PS: This site works for: Opera 8.5+, Safari, Netscape 7.2+, Mozillia
>1.6+, FireFox 1.0.7+, Konqueror 3.4.0+, and IE 5+ (except Mac)
>
>--
>>--------------------------------------------------------------------------------
>http://sperling.com
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Björn Bartels
-Development/IT-Services-
----------------------------------------------
dbusiness.de gmbh
digital business & printing gmbh
Greifswalder Str. 152
D-10409 Berlin
Fon: [0.30] 4.21.19.95
Fax: [0.30] 4.21.19.74
www.dbusiness.de
[EMAIL PROTECTED]
ftp://dbusiness.dyndns.org
--- End Message ---
--- Begin Message ---
I am trying to stop PHP from resolving symlinks. I have a PHP CMS that I use to host dozens of sites using Apache virtual hosting features. I need all the sites to run the exact same PHP CMS code but use their unique directories to host the different config files. The problem is that the PHP scripts are running from the directory that the links point to and not the directory where the site is. The big problem with that is the CMS tries to read a configuration file that is in a relative location to the PHP script like ../config.php.
[EMAIL PROTECTED] ls -l /usr/local/cms
-rw-r--r-- 1 user users 20 Jan 16 02:17 index.php
drwxr-xr-x 9 user users 4096 Feb 22 16:40 admin
[EMAIL PROTECTED] ls -l /vhost/test01.com/var/www/html/
-rw-r--r-- 1 user users 20 Jan 16 02:17 config.php
lrwxrwxrwx 1 root root 31 Feb 22 14:05 index.php -> /usr/local/cms/index.php
lrwxrwxrwx 1 root root 31 Feb 22 14:05 admin -> /usr/local/cms/admin
[EMAIL PROTECTED] cd /vhost/test01.com/var/www/html/admin/
[EMAIL PROTECTED] pwd
/vhost/test01.com/var/www/html/admin
[EMAIL PROTECTED][admin]#
Bash is doing what I need. It sees the current directory as the full path of the symlink.
The admin.php at this point only has system("pwd"); in it and it prints out /usr/local/cms/admin as the directory it is in, not what I want. It will never see the ../config.php file.
I tried doing this
chdir ($_SERVER[DOCUMENT_ROOT]."/".$_SERVER[REQUEST_URI]);
but it still resolves the link and does not accept the path that I constructed.
How can I make PHP use the symlink and stop trying to resolve the original files?
signature.asc
Description: This is a digitally signed message part
--- End Message ---
--- Begin Message ---
Roy Souther wrote:
How can I make PHP use the symlink and stop trying to resolve the
original files?
Can you try:
$mydir = dirname(__FILE__);
include($mydir . '/../config.php');
?
or
$mydir = dirname(__FILE__);
include(dirname($mydir) . '/config.php');
--
Postgresql & php tutorials
http://www.designmagick.com/
--- End Message ---
--- Begin Message ---
Hi all!
I have a text highlight function which does not behave exactly as
needed. Behavior is logical but result is cumbersome.
Instead of replacing the portion of the text with the same portion of
text with some highlighting code added before and after, it replaces the
said text with the chunk of text looked for (highlight), which is an
issue when there is a difference in case.
It is used in a product search engine and it is important to keep the
case the same.
Here is the function:
function highlight_text($text, $highlight) {
return eregi_replace($highlight, "<span class=highlight>" . $highlight .
"</span>", $text);
}
In this case, if the text to highglight is:
MacOS X Super Gizmo
And a client searches for the string "macos", the result will be:
<span class=highlight>macos</span> X Super Gizmo
Not very pritty.
How complicated would it be to prevent this from happening?
Thanks a lot in advance!
--- End Message ---
--- Begin Message ---
Here is the function:
function highlight_text($text, $highlight) {
return eregi_replace($highlight, "<span class=highlight>" . $highlight .
"</span>", $text);
}
In this case, if the text to highglight is:
MacOS X Super Gizmo
And a client searches for the string "macos", the result will be:
<span class=highlight>macos</span> X Super Gizmo
You're using the eregi_replace function - which does case insensitive
replaces (read the man page).
Change it to use
ereg_replace
--
Postgresql & php tutorials
http://www.designmagick.com/
--- End Message ---
--- Begin Message ---
That's not where the issue is.
Eregi_replace conducts a case insensitive SEARCH but how the REPLACE
operates has nothing to do with it.
If you use ereg_replace, then it is most obviously not going to replace
"MacOS" with "<span class=highlight>macos</span>" or even "<span
class=highlight>MacOS</span>", because the string searched for is of a
different case.
But thanks for helping.
-----Original Message-----
From: Chris [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 22, 2006 5:39 PM
To: Nicolas Verhaeghe
Cc: php-general@lists.php.net
Subject: Re: [PHP] Case issue with eregi_replace in text highlight
function
> Here is the function:
>
> function highlight_text($text, $highlight) {
> return eregi_replace($highlight, "<span class=highlight>" . $highlight
> . "</span>", $text); }
>
> In this case, if the text to highglight is:
>
> MacOS X Super Gizmo
>
> And a client searches for the string "macos", the result will be:
>
> <span class=highlight>macos</span> X Super Gizmo
You're using the eregi_replace function - which does case insensitive
replaces (read the man page).
Change it to use
ereg_replace
--
Postgresql & php tutorials
http://www.designmagick.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Nicolas Verhaeghe wrote:
That's not where the issue is.
Eregi_replace conducts a case insensitive SEARCH but how the REPLACE
operates has nothing to do with it.
If you use ereg_replace, then it is most obviously not going to replace
"MacOS" with "<span class=highlight>macos</span>" or even "<span
class=highlight>MacOS</span>", because the string searched for is of a
different case.
Good point, I had it around the wrong way.
function highlight_text($text, $highlight) {
return eregi_replace($highlight, "<span class=highlight>" . $highlight
. "</span>", $text);
}
So where does 'highlight' come from when you pass it in ?
--
Postgresql & php tutorials
http://www.designmagick.com/
--- End Message ---
--- Begin Message ---
How about
function highlight_text($text, $highlight) {
return preg_replace('/(' . $highlight . ')/i', '<span
class="highlight">$1</span>', $text);
}
Case should be retained and the search is case insensitive
HTH
Dan
-------------------
http://chrome.me.uk
-----Original Message-----
From: Nicolas Verhaeghe [mailto:[EMAIL PROTECTED]
Sent: 23 February 2006 00:55
To: 'Chris'
Cc: php-general@lists.php.net
Subject: RE: [PHP] Case issue with eregi_replace in text highlight function
That's not where the issue is.
Eregi_replace conducts a case insensitive SEARCH but how the REPLACE
operates has nothing to do with it.
If you use ereg_replace, then it is most obviously not going to replace
"MacOS" with "<span class=highlight>macos</span>" or even "<span
class=highlight>MacOS</span>", because the string searched for is of a
different case.
But thanks for helping.
-----Original Message-----
From: Chris [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 22, 2006 5:39 PM
To: Nicolas Verhaeghe
Cc: php-general@lists.php.net
Subject: Re: [PHP] Case issue with eregi_replace in text highlight
function
> Here is the function:
>
> function highlight_text($text, $highlight) {
> return eregi_replace($highlight, "<span class=highlight>" . $highlight
> . "</span>", $text); }
>
> In this case, if the text to highglight is:
>
> MacOS X Super Gizmo
>
> And a client searches for the string "macos", the result will be:
>
> <span class=highlight>macos</span> X Super Gizmo
You're using the eregi_replace function - which does case insensitive
replaces (read the man page).
Change it to use
ereg_replace
--
Postgresql & php tutorials
http://www.designmagick.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
__________ NOD32 1.1416 (20060222) Information __________
This message was checked by NOD32 antivirus system.
http://www.eset.com
--- End Message ---
--- Begin Message ---
hi there im having issue decoding an encoded string created with a pear
package Crypt_CBC which i am encoding a uri into the string and sending
to a rewrite url. The query string is not returning the encoded part of
the url properly for some reason and not decoding properly.
I have already sent this to the pear list, but maybe someone here has
experienced issues with encoded strings and mod_rewrite not relocating
with a url encoded string ?
The encoded string without mod_rewrite rules is
RandomIVQ%83%80%E6%0F%E7%E4%7CdY%E7%BA%9B%14%5B%60%98%A1%1D%04%94L_%16%E
4%19%EF%F1%FE%5C%D6%CE%09%C8DI%A7%1F%04%25%A8%7B%FA%19%B51%1D%7C%0D%04%1
3%E3%21%F1%60f%C6%91%A8b%82%11YK%21l+%C5%D0W%D9%9A%2B%CD3%C3%FA%82LE%D8%
1EA%07%25%F5%BB%22%EA%B7%B8%82%F0WZ%40
With rewritten urls its from viewing source.
RandomIVQƒ€æçä|dY纛[`˜¡”L_äïñþ\ÖÎ ÈDI§%¨{úµ1|
ã!ñ`fÆ‘¨b‚YK!l+ÅÐWÙš+Í3Ãú‚LEØA%õ»"ê·¸‚ðWZ@
The rewrite rule is
RewriteEngine on
RewriteBase /
RewriteRule ^feeds/(.*) refer.php?$1 [L]
Any ideas why its not urlencoding the urlencoded string in the rewrite
url ?
I may have to use the request_uri instead of sending it as a query
string if this is a flaw in mod_rewrite ?? I think however if i use the
request_uri things could break a little.
Let me know.
Dan
--- End Message ---
--- Begin Message ---
Ive just discovered a strange issue where parse_url is not splitting up
the url properly. in the host key its returning like //www.php.net
where the url is http://www.php.net. any ideas ?
--- End Message ---
--- Begin Message ---
Dan Rossi wrote:
Ive just discovered a strange issue where parse_url is not splitting up
the url properly. in the host key its returning like //www.php.net where
the url is http://www.php.net. any ideas ?
If the behaviour changed between versions without it being documented or
noted somewhere, post a bug report - http://bugs.php.net.
--
Postgresql & php tutorials
http://www.designmagick.com/
--- End Message ---