Chris wrote:
Richard Heyes wrote:
well if you take a string (filename) and wish to change the end of it
somone
then I don't think str_replace() is the correct function. what's to
say a script
doesn't exist called 'my.cfm.php'?
How does this:
/\.cfm$/
take into account that?
$ in regex's
Richard Heyes wrote:
Chris wrote:
Richard Heyes wrote:
well if you take a string (filename) and wish to change the end of
it somone
then I don't think str_replace() is the correct function. what's to
say a script
doesn't exist called 'my.cfm.php'?
How does this:
/\.cfm$/
take into
one of these should give you something to go on:
echo preg_replace('\.cfm$', '-meta.cfm', parse_url($_SERVER['REQUEST_URI'],
PHP_URL_PATH)), \n;
echo preg_replace('\.cfm$', '-meta.cfm', $_SERVER['PATH_TRANSLATED']), \n;
echo preg_replace('\.cfm$', '-meta.cfm', $_SERVER['SCRIPT_FILENAME']), \n;
Richard Heyes wrote:
one of these should give you something to go on:
echo preg_replace('\.cfm$', '-meta.cfm',
parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)), \n;
echo preg_replace('\.cfm$', '-meta.cfm', $_SERVER['PATH_TRANSLATED']),
\n;
echo preg_replace('\.cfm$', '-meta.cfm',
well if you take a string (filename) and wish to change the end of it somone
then I don't think str_replace() is the correct function. what's to say a script
doesn't exist called 'my.cfm.php'?
How does this:
/\.cfm$/
take into account that?
--
Richard Heyes
+44 (0)800 0213 172
Richard Heyes wrote:
well if you take a string (filename) and wish to change the end of it
somone
then I don't think str_replace() is the correct function. what's to
say a script
doesn't exist called 'my.cfm.php'?
How does this:
/\.cfm$/
take into account that?
WTF
--
PHP
Richard Heyes wrote:
well if you take a string (filename) and wish to change the end of it
somone
then I don't think str_replace() is the correct function. what's to
say a script
doesn't exist called 'my.cfm.php'?
How does this:
/\.cfm$/
take into account that?
$ in regex's means 'end of
Hi,
I'm working on redesigning the backend of the website for work. It was
originally done in ColdFusion, but I'm switching it over to PHP - probably
going to transfer the website from where it's currently hosted to something
a lot cheaper, too, hence the switching to PHP. Anyway.
Because we
At 12:18 PM -0600 11/24/07, Amanda Loucks wrote:
Hi,
I'm working on redesigning the backend of the website for work. It was
originally done in ColdFusion, but I'm switching it over to PHP - probably
going to transfer the website from where it's currently hosted to something
a lot cheaper, too,
Amanda Loucks wrote:
Hi,
I'm working on redesigning the backend of the website for work. It was
originally done in ColdFusion, but I'm switching it over to PHP - probably
going to transfer the website from where it's currently hosted to something
a lot cheaper, too, hence the switching to
I've got a URL like this:
http://www.naturalist.com/~fungae/index.php
which is stored in $http_referer (as parse_url from
$HTTP_REFERER).
I'm trying to extract the username (~fungae). I've
read the docs on parse_url(), and have tried to get
$http_referer[user], but it comes up with zilch. I've
http://www.php.net/manual/en/function.parse-url.php
At 06:39 18-12-02 -0800, Mako Shark wrote:
I've got a URL like this:
http://www.naturalist.com/~fungae/index.php
which is stored in $http_referer (as parse_url from
$HTTP_REFERER).
I'm trying to extract the username (~fungae). I've
read the
: Wednesday, December 18, 2002 2:39 PM
Subject: [PHP] URL parsing
I've got a URL like this:
http://www.naturalist.com/~fungae/index.php
which is stored in $http_referer (as parse_url from
$HTTP_REFERER).
I'm trying to extract the username (~fungae). I've
read the docs on parse_url
http://www.php.net/manual/en/function.parse-url.php
If you're going to help, at least read the question. The poster already said
they tried that and it's not even a solution, anyhow. The username it
refers to in parse_url() is for URLs in the format of
http://username:[EMAIL PROTECTED].
I am trying to write software that will allow me to pass variables to a php
script like:
index.php/option=contact/step=view
When I do this, I get the varibal PATH_INFO which contains
/option=contact/step=view. Now, what I want is to have the following:
$option = contact
$step = view
I tried
$myPairs = explode( /, $PATH_INFO );
while( list( $key, $val ) = each( $myPairs ) ){
if( !empty( $val ) ){
$myVar = explode( =, $val );
${$myVar[0]} = $myVar[1];
}
}
For you example URI, index.php/option=contact/step=view
you would then have
Actually, I found a simpler way:
$vars = str_replace(/,,$PATH_INFO);
parse_str($vars);
But thanks for your help...
Christopher William Wesley wrote:
$myPairs = explode( /, $PATH_INFO );
while( list( $key, $val ) = each( $myPairs ) ){
if( !empty( $val ) ){
$myVar =
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] (Jaxon) wrote:
Any way to combine both forms of url parsing?
I want to use standard slash notation for navigation ,but also account for
the occasional variable used within a single page.
e.g. URL can be either:
oops :)
http://www.domain.com/index.php/main/index.html?ii=1
versus
http://www.domain.com/index.php/main/index.html
I want to get "index.html" and "main" into variables, as the two items will
always be present - if $ii is set, I want to strip it from the URI before
parsing the items out.
I
Hi!
Check out these two related articles (and user comments) :
Building Dynamic Pages With Search Engines in Mind :
* http://phpbuilder.com/columns/tim19990117.php3
* http://phpbuilder.com/columns/tim2526.php3
Also
K, read em all, and understood more than I thought I :)
I still don't see how you can 'sanitize' a URI, eg discard anything
including and after "//" or "??". I think this is needed if you want to
discard a query string or irregular syntax from your URI.
ereg's don't work reliably, due to the
why can't you str_replace the $QUERY_STRING frm the $REQUEST_URI?
give an example of what you are trying to do? (I'm sorry if you did
and I missed it)
-aaron
At 9:06 PM -0500 3/25/01, Jaxon wrote:
K, read em all, and understood more than I thought I :)
I still don't see how you can
whups, sorry - here is the example:
I want to turn URI's like:
/script.php/main/index.html?junk=junk
/script.php/main/index.html//
/script.php/main/index.html??
all into:
/script.php/main/index.html
best regards,
jaxon
On 3/25/01 9:25 PM, "Aaron Tuller" [EMAIL PROTECTED] wrote:
why can't
ore/
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: Dave Smith [EMAIL PROTECTED]
Newsgroups: php.general
Sent: Saturday, March 17, 2001 10:55 AM
Subject: [PHP] URL parsing
I
e Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: Dave Smith [EMAIL PROTECTED]
Newsgroups: php.general
Sent: Saturday, March 17, 2001 10:55 AM
Subject: [PHP] URL parsing
I have heard
Newsgroups: php.general
Sent: Saturday, March 17, 2001 10:55 AM
Subject: [PHP] URL parsing
I have heard that the new standard for URLS is ...test.php?op=3;op2=6...
using the semi colon as a seperator. Is this currently supported by php
4.0.3?
Cheers
Dave Smith
--
PHP
- Original Message -
From: Dave Smith [EMAIL PROTECTED]
Newsgroups: php.general
Sent: Saturday, March 17, 2001 10:55 AM
Subject: [PHP] URL parsing
I have heard that the new standard for URLS is ...test.php?op=3;op2=6...
using the semi colon as a seperator. Is this currently s
I have heard that the new standard for URLS is ...test.php?op=3;op2=6...
using the semi colon as a seperator. Is this currently supported by php 4.0.3?
Cheers
Dave Smith
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands,
28 matches
Mail list logo