[PHP] Mangling URLs for RewriteRule parsing

2011-07-12 Thread Daevid Vincent
I'm fumbling trying to think of a nice easy way to mangle my URLs within PHP
for SEO and apache's RewriteRules magic.

Given a basic rule like this:

RewriteCond ^/foo/movie/genre/([-a-z\|]*)_([-a-z\|]*)/([0-9]+)/videos.html$ 
RewriteRule /browse_scenes.php?genre_id=${genres:$2}pg=$1%{QUERY_STRING}
[NC,L]

I currently have a wrapper createPageLink() that right now just spits back
the 'ugly' URL style. (ie. the 'Rule' portion), but what I want it to do is
spit back the nice 'Cond' part instead)

Do I just have to make a giant switch/case statement for all the
'browse_scenes.php' and other .php pages?

It seems to me that I should be able to dynamically build the URLs that are
inserted into my .php page (the ones that show up in the browser bottom bar
on hover).

I'm fairly flexible at this point as I'm just starting to do this SEO stuff,
so I thought I'd ask if someone has a nice function or class or something
that has already solved this kind of problem? Or is it such that every site
is unique and no such 'generic' kind of wrapper exists? I guess I'm thinking
of methodology or best practice type code, rather than a turnkey solution if
none exists.

d


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Submitting URLs in IE

2009-04-04 Thread Skip Evans

Hey all,

I have an application that uses AJAX to submit a page created 
in the FCKeditor. It builds a URL and then submits that to the 
server with a JavaScript call like this:


req.open('GET', url, false);

In Firefox it works great for just about any size page you 
could want, but IE just stops on even medium size pages.


Is this some kind of limitation in IE that can be increased 
with a registry setting or something?


Any suggestions would be helpful, as I am a bit perplexed.

Would using POST rather than get to submit the URL to the 
server handle more data?


--

Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://bigskypenguin.com

Those of you who believe in
telekinesis, raise my hand.
 -- Kurt Vonnegut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Submitting URLs in IE

2009-04-04 Thread Phpster



On Apr 4, 2009, at 14:07, Skip Evans s...@bigskypenguin.com wrote:


Hey all,

I have an application that uses AJAX to submit a page created in the  
FCKeditor. It builds a URL and then submits that to the server with  
a JavaScript call like this:


req.open('GET', url, false);

In Firefox it works great for just about any size page you could  
want, but IE just stops on even medium size pages.


Is this some kind of limitation in IE that can be increased with a  
registry setting or something?


Any suggestions would be helpful, as I am a bit perplexed.

Would using POST rather than get to submit the URL to the server  
handle more data?


--

Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://bigskypenguin.com

Those of you who believe in
telekinesis, raise my hand.
-- Kurt Vonnegut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Skip,

Get limits you to about 2Kb of data. Post is the better way to handle it

Bastien

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parsing URLs

2008-10-28 Thread Yeti
One could also abuse basename and pathinfo.
Works in PHP4+

?php
$uri = 'http://www.domain.com/page/file/';
$pathinfo = pathinfo($uri);
$webpageaccess = array();
$webpageaccess[1] = $webpageaccess[2] = '';
if (isset($pathinfo['basename'])) $webpageaccess[1] = $pathinfo['basename'];
if (isset($pathinfo['dirname'])) $webpageaccess[2] =
basename($pathinfo['dirname']);
//var_dump($webpageaccess);
?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Parsing URLs

2008-10-27 Thread Ron Piggott
I would like to parse the URLs in the values after the domain name.  

The URLs are the results of mod re-write statements.  

Example 1:

http://www.domain.com/page/file/

The desired results would be: 
$web_page_access[1] = file

Example 2:

http://www.domain.com/page/file/2/ 

The desired results would be:
$web_page_access[1] = file
$web_page_access[2] = 2

Any help please?

Ron


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parsing URLs

2008-10-27 Thread Eric Butera
On Mon, Oct 27, 2008 at 10:04 PM, Ron Piggott
[EMAIL PROTECTED] wrote:
 I would like to parse the URLs in the values after the domain name.

 The URLs are the results of mod re-write statements.

 Example 1:

 http://www.domain.com/page/file/

 The desired results would be:
 $web_page_access[1] = file

 Example 2:

 http://www.domain.com/page/file/2/

 The desired results would be:
 $web_page_access[1] = file
 $web_page_access[2] = 2

 Any help please?

 Ron


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



// $uri = htmlspecialchars($SERVER['REQUEST_URI'], ENT_QUOTES, 'UTF-8');
$uri = htmlspecialchars('/page/file/2/', ENT_QUOTES, 'UTF-8');;
$uri = trim($uri, /);
$parts = explode(/, $uri);
var_dump($parts);

or use parse_url to get down to the bits you need.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Changing URLs from Relative to Absolute

2007-07-30 Thread Tom Chubb
Dear list,
I was recently trying to write a script where a user copy and pastes their
HTML code to display something on a listings site and tried to find a way to
change the URL of an image from relative to absolute.
For example img src=images/1.jpg becomes img = src=
http://domain.com/images/1.jpg;.
That is easy enough and I created a regexp, but I found that some people
call the img tag differently such as:
img a=A photo src=images/1.jpg
Does anyone have experience of this? How can I create a regexp that will
find it in every case?
Thanks in advance.

Tom



-- 
Tom Chubb
[EMAIL PROTECTED]


Re: [PHP] Changing URLs from Relative to Absolute

2007-07-30 Thread Richard Heyes

I was recently trying to write a script where a user copy and pastes their
HTML code to display something on a listings site and tried to find a way to
change the URL of an image from relative to absolute.
For example img src=images/1.jpg becomes img = src=
http://domain.com/images/1.jpg;.
That is easy enough and I created a regexp, but I found that some people
call the img tag differently such as:
img a=A photo src=images/1.jpg
Does anyone have experience of this? How can I create a regexp that will
find it in every case?


You could try this (from my rather poor memory):

/img.*src=(.*)/Uis

--
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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: URLs

2007-07-12 Thread Mikey

Philip Thompson wrote:

Hi.

This may or may not be a PHP question - I'll let the group decide. Note 
this URL:


http://www.someplace.com/SomeDirectory/SomeFile

compared to this URL:

http://www.someplace.com/SomeDirectory/SomeFile.php

Okay. How does one create the URL with no file extension? Is this done 
through PHP or is this a server setting? Thanks in advance!


~Philip


It is a server setting - see ModRewrite for Apache.

HTH,

Mikey

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP Corrupts URLs

2007-06-08 Thread Nathan Corvino
I have a php script that gets a url from a GET query parameter.  I have 
been running this script on PHP 5.2.2 on Ubuntu Linux, and everything 
works as expected.  I have just installed PHP 5.2.3 on OS X via 
MacPorts, and the same query parameter url has any single quote 
characters escaped with a backslash when I retrieve it from $_REQUEST.


$url = $_REQUEST['url'];
print($url);

For the Query Parameter:

http://localhost/drones/serp.php?def=planetrealtor.com.xmlurl=http%3A%2F%2Fwebapp
s2.planetrealtor.com%2Fidx%2Fpkg_IDX.pr_ListOfIDXProperties%3FsStateID%3DFL%26sRealtorID%3D%26sUserType%3DS%26sTrackNum%3D%26sSear
chType%3D%26sPropertyTypeCode%3DS%26sSQLPreBuiltWhere%3DL.PROPERTY_STATE_ID%2520%3D%2520%27FL%27%2520AND%2520L.NODISPLAY_IDX%2520I
S%2520NULL%2520%2520AND%2520L.NODISPLAY_OWNER%2520IS%2520NULL%2520%2520AND%2520L.VOW_ENABLED_LIST_FIRM_ONLY%2520IS%2520NULL%2520%2
520AND%2520L.STATUS_CODE%2520%3D%2520%27A%27%2520AND%2520L.STATEPROP_ENABLED%2520IS%2520NOT%2520NULL%2520%2520AND%2520%2520L.MLS_I
D%2520IN%2520%28%27flagler%27%2C%27miamimls%27%2C%27spacecoast%27%2C%27staug%27%2C%27neflmlsinc%27%2C%27navarre%27%2C%27sanibel%27
%2C%27sarasota%27%2C%27pensacola%27%2C%27highlands%27%2C%27hernando%27%2C%27franklin%27%2C%27naples%27%2C%27southbrow%27%2C%27indi
an%27%2C%27manatee%27%2C%27baycounty%27%2C%27regional%27%2C%27palmbeach%27%2C%27emerald%27%2C%27citrus%27%2C%27ocala%27%2C%27dixie
%27%2C%27fortlaud%27%2C%27gaines%27%2C%27englewood%27%2C%27westpasco%27%2C%27okee%27%2C%27bonita%27%2C%27capecoral%27%2C%27ftmyers
%27%2C%27venice%27%2C%27talla%27%2C%27chipola%27%2C%27marathon%27%2C%27midfl%27%2C%27miamidade%27%2C%27marco%27%2C%27martin%27%2C%
27puntagorda%27%2C%27keywest%27%2C%27amelia%27%2C%27lakecity%27%2C%27pinellas%27%29%2520AND%2520L.ZIP_CODE%2520IN%2520%28%2734211%
27%29%2520AND%2520L.PROPERTY_TYPE_CODE%2520%3D%2520%27S%27%2520AND%2520L.SALE_PRICE%2520%253E%3D%25200%2520AND%2520L.SALE_PRICE%25
20%253C%3D%2520999%26sSQLPreBuiltOrderBy%3D%26sDisplayPhoto%3DT%26sSearchSource%3DX%26sOnlyCities%3DF%26sRunSearch%3DF%26s
SearchID%3D%26sClientID%3D%26sSavedSearchType%3D%26sLangCode%3DENGLISH%26sSubSystemCode%3D%26nPgNum%3D1%26nNum%3D1 



In Linux becomes:

http://webapps2.planetrealtor.com/idx/pkg_IDX.pr_ListOfIDXProperties?sStateID=FLsRealtorID=sUserType=SsTrackNum=sSearchType=sPropertyTypeCode=SsSQLPreBuiltWhere=L.PROPERTY_STATE_ID%20=%20'FL'%20AND%20L.NODISPLAY_IDX%20IS%20NULL%20%20AND%20L.NODISPLAY_OWNER%20IS%20NULL%20%20AND%20L.VOW_ENABLED_LIST_FIRM_ONLY%20IS%20NULL%20%20AND%20L.STATUS_CODE%20=%20'A'%20AND%20L.STATEPROP_ENABLED%20IS%20NOT%20NULL%20%20AND%20%20L.MLS_ID%20IN%20('flagler','miamimls','spacecoast','staug','neflmlsinc','navarre','sanibel','sarasota','pensacola','highlands','hernando','franklin','naples','southbrow','indian','manatee','baycounty','regional','palmbeach','emerald','citrus','ocala','dixie','fortlaud','gaines','englewood','westpasco','okee','bonita','capecoral','ftmyers','venice','talla','chipola','marathon','midfl','miamidade','marco','martin','puntagorda','keywest','amelia','lakecity','pinellas')%20AND%20L.ZIP_CODE%20IN%20('32714')%20AND%20L.PROPERTY_TYPE_CODE%20=%20'S'%20AND%20L.SALE_PRICE%2
0%3E=%200%20AND%20L.SALE_PRICE%20%3C=%20999sSQLPreBuiltOrderBy=sDisplayPhoto=TsSearchSource=XsOnlyCities=FsRunSearch=FsSearchID=sClientID=sSavedSearchType=sLangCode=ENGLISHsSubSystemCode=nPgNum=1nNum=1

But in OS X becomes:

http://webapps2.planetrealtor.com/idx/pkg_IDX.pr_ListOfIDXProperties?sStateID=FLsRealtorID=sUserType=SsTrackNum=sSearchType=sPropertyTypeCode=SsSQLPreBuiltWhere=L.PROPERTY_STATE_ID%20=%20\'FL\'%20AND%20L.NODISPLAY_IDX%20IS%20NULL%20%20AND%20L.NODISPLAY_OWNER%20IS%20NULL%20%20AND%20L.VOW_ENABLED_LIST_FIRM_ONLY%20IS%20NULL%20%20AND%20L.STATUS_CODE%20=%20\'A\'%20AND%20L.STATEPROP_ENABLED%20IS%20NOT%20NULL%20%20AND%20%20L.MLS_ID%20IN%20(\'flagler\',\'miamimls\',\'spacecoast\',\'staug\',\'neflmlsinc\',\'navarre\',\'sanibel\',\'sarasota\',\'pensacola\',\'highlands\',\'hernando\',\'franklin\',\'naples\',\'southbrow\',\'indian\',\'manatee\',\'baycounty\',\'regional\',\'palmbeach\',\'emerald\',\'citrus\',\'ocala\',\'dixie\',\'fortlaud\',\'gaines\',\'englewood\',\'westpasco\',\'okee\',\'bonita\',\'capecoral\',\'ftmyers\',\'venice\',\'talla\',\'chipola\',\'marathon\',\'midfl\',\'miamidade\',\'marco\',\'martin\',\'puntagorda\',\'keywest\',\'amelia\',\'lakecity\',\'pinellas\')%20AND
%20L.ZIP_CODE%20IN%20(\'32714\')%20AND%20L.PROPERTY_TYPE_CODE%20=%20\'S\'%20AND%20L.SALE_PRICE%20%3E=%200%20AND%20L.SALE_PRICE%20%3C=%20999sSQLPreBuiltOrderBy=sDisplayPhoto=TsSearchSource=XsOnlyCities=FsRunSearch=FsSearchID=sClientID=sSavedSearchType=sLangCode=ENGLISHsSubSystemCode=nPgNum=1nNum=1

As you can see, in OS X the url acquires a the backslashes, which I 
would like to avoid.


I am not much of a PHP programmer at this point--it is a brand new 
language for me, so I don't really now how to investigate this.  Is 
there a PHP configuration option I can look at?  Is 

Re: [PHP] PHP Corrupts URLs

2007-06-08 Thread Richard Davey
Hi Nathan,

Friday, June 8, 2007, 9:47:22 PM, you wrote:

 I have a php script that gets a url from a GET query parameter.  I have
 been running this script on PHP 5.2.2 on Ubuntu Linux, and everything 
 works as expected.  I have just installed PHP 5.2.3 on OS X via 
 MacPorts, and the same query parameter url has any single quote 
 characters escaped with a backslash when I retrieve it from $_REQUEST.

[snip]

 As you can see, in OS X the url acquires a the backslashes, which I 
 would like to avoid.

 I am not much of a PHP programmer at this point--it is a brand new 
 language for me, so I don't really now how to investigate this.  Is 
 there a PHP configuration option I can look at?

Sure.. look at the magic_quotes_gpc setting:

http://uk.php.net/manual/en/ref.info.php#ini.magic-quotes-gpc

Cheers,

Rich
-- 
Zend Certified Engineer
http://www.corephp.co.uk

Never trust a computer you can't throw out of a window

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Rewriting urls

2007-03-26 Thread lists

Hi,

I am having some problems getting my mod_rewrite to work on my development
server. On my
production server (linux) this works fine. But on my development server it
woun't work.

I have a file basicpage.php that is located in the webroot. I then have
a .htaccess file
with the following content:


#DirectoryIndex index.php index.html
#Options +FollowSymLinks
#RewriteBase /relative/web/path/

IfModule mod_rewrite.c
 RewriteEngine On
 RewriteRule ^article/([0-9]+)/[-a-zA-Z]+$ /basicpage.php?id=$1
/IfModule


The rewrite works as expected on the production server, but on the development
server it
don't want to work. I also tried it on a windows machine but it don't want to
work there
either.

Any suggestions/insights?

/Peter

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Rewriting urls

2007-03-26 Thread Erik Jones

On Mar 26, 2007, at 12:14 PM, [EMAIL PROTECTED] wrote:


Hi,

I am having some problems getting my mod_rewrite to work on my  
development

server. On my
production server (linux) this works fine. But on my development  
server it

woun't work.

I have a file basicpage.php that is located in the webroot. I then  
have

a .htaccess file
with the following content:


#DirectoryIndex index.php index.html
#Options +FollowSymLinks
#RewriteBase /relative/web/path/

IfModule mod_rewrite.c
 RewriteEngine On
 RewriteRule ^article/([0-9]+)/[-a-zA-Z]+$ /basicpage.php?id=$1
/IfModule


The rewrite works as expected on the production server, but on the  
development

server it
don't want to work. I also tried it on a windows machine but it  
don't want to

work there
either.

Any suggestions/insights?


Yep, take this to the mod_rewrite forums @ http://www.modrewrite.com/  
as this is a php list :)


erik jones [EMAIL PROTECTED]
software developer
615-296-0838
emma(r)





Re: [PHP] Rewriting urls

2007-03-26 Thread Peter Lauri
On Monday 26 March 2007 19:49:48 Erik Jones wrote:
 Yep, take this to the mod_rewrite forums @ http://www.modrewrite.com/  
 as this is a php list :)

Thanks. This solved it for me:

http://forum.modrewrite.com/viewtopic.php?p=10796#10796

/Peter

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Rewriting urls

2007-03-26 Thread Erik Jones


On Mar 26, 2007, at 1:18 PM, Peter Lauri wrote:


On Monday 26 March 2007 19:49:48 Erik Jones wrote:

Yep, take this to the mod_rewrite forums @ http://www.modrewrite.com/
as this is a php list :)


Thanks. This solved it for me:

http://forum.modrewrite.com/viewtopic.php?p=10796#10796

/Peter


Glad I could be of indirect help :)

erik jones [EMAIL PROTECTED]
software developer
615-296-0838
emma(r)





Re: [PHP] Rewriting urls

2007-03-26 Thread Richard Lynch
On Mon, March 26, 2007 12:14 pm, [EMAIL PROTECTED] wrote:
 I am having some problems getting my mod_rewrite to work on my
 development
 server. On my
 production server (linux) this works fine. But on my development
 server it
 woun't work.

 I have a file basicpage.php that is located in the webroot. I then
 have
 a .htaccess file
 with the following content:


 #DirectoryIndex index.php index.html
 #Options +FollowSymLinks
 #RewriteBase /relative/web/path/

 IfModule mod_rewrite.c
   RewriteEngine On
   RewriteRule ^article/([0-9]+)/[-a-zA-Z]+$ /basicpage.php?id=$1
 /IfModule


 The rewrite works as expected on the production server, but on the
 development
 server it
 don't want to work. I also tried it on a windows machine but it don't
 want to
 work there
 either.

 Any suggestions/insights?

Two Suggestions:

Check AllowOverride in httpd.conf

Ask on an Apache list, since there is zero PHP here.

-- 
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?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Rewriting urls

2007-03-26 Thread Tijnema !

On 3/26/07, Richard Lynch [EMAIL PROTECTED] wrote:

On Mon, March 26, 2007 12:14 pm, [EMAIL PROTECTED] wrote:
 I am having some problems getting my mod_rewrite to work on my
 development
 server. On my
 production server (linux) this works fine. But on my development
 server it
 woun't work.

 I have a file basicpage.php that is located in the webroot. I then
 have
 a .htaccess file
 with the following content:


 #DirectoryIndex index.php index.html
 #Options +FollowSymLinks
 #RewriteBase /relative/web/path/

 IfModule mod_rewrite.c
   RewriteEngine On
   RewriteRule ^article/([0-9]+)/[-a-zA-Z]+$ /basicpage.php?id=$1
 /IfModule


 The rewrite works as expected on the production server, but on the
 development
 server it
 don't want to work. I also tried it on a windows machine but it don't
 want to
 work there
 either.

 Any suggestions/insights?

Two Suggestions:

Check AllowOverride in httpd.conf

Ask on an Apache list, since there is zero PHP here.


OMG, this problem is already solved, and you're telling him he has to
go to the apache list :P

Tijnema


--
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?

--
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



[PHP] strip urls

2006-09-11 Thread Merlin

Hi there,

I am trying to strip URL's out of a text. There is a function for this 
in php, but I can't find it anywhere. Can sombody help?


Regards,

Merlin

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] strip urls

2006-09-11 Thread Mariano Guadagnini
You may try using regular expressions for that. Something like 
preg_replace(http:\/\/.*\s,,$your_var). That's a simple example, but 
you can change to suit your needs, check the online help for more info 
about.


HTH,

Mariano.

Merlin wrote:

Hi there,

I am trying to strip URL's out of a text. There is a function for this 
in php, but I can't find it anywhere. Can sombody help?


Regards,

Merlin





--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.12.2/443 - Release Date: 11/09/2006

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] strip urls

2006-09-11 Thread RalfGesellensetter
Am Montag 11 September 2006 15:36 schrieb Merlin:
 I am trying to strip URL's out of a text. There is a function for
 this in php, but I can't find it anywhere. Can sombody help?

hi, it's strip_tags and only removes the tags (a href ...) but keeps 
the plain text that would be displayed in a text browser.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] strip urls

2006-09-11 Thread Merlin

RalfGesellensetter schrieb:

Am Montag 11 September 2006 15:36 schrieb Merlin:

I am trying to strip URL's out of a text. There is a function for
this in php, but I can't find it anywhere. Can sombody help?


hi, it's strip_tags and only removes the tags (a href ...) but keeps 
the plain text that would be displayed in a text browser.


Hi there,

thank you for the hint. This it the one I was searching for. However 
unfortunatelly the function also strips all other tags! I am looking for 
one that only does strip the a href tag.


I am not so familar with regex, but I fear I would need to :-(

My guess is that it must be something like this:

$str = 'foo  a href=test/a o';
$str = preg_replace('a (.*)', '', $str);
echo $str;

Can anybody help me on that? Thank you so much in advance.

Regards,

Merlin

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] strip urls

2006-09-11 Thread Christopher Weldon
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Merlin wrote:
 RalfGesellensetter schrieb:
 Am Montag 11 September 2006 15:36 schrieb Merlin:
 I am trying to strip URL's out of a text. There is a function for
 this in php, but I can't find it anywhere. Can sombody help?

 hi, it's strip_tags and only removes the tags (a href ...) but keeps
 the plain text that would be displayed in a text browser.
 
 Hi there,
 
 thank you for the hint. This it the one I was searching for. However
 unfortunatelly the function also strips all other tags! I am looking for
 one that only does strip the a href tag.
 
 I am not so familar with regex, but I fear I would need to :-(
 
 My guess is that it must be something like this:
 
 $str = 'foo  a href=test/a o';
 $str = preg_replace('a (.*)', '', $str);
 echo $str;
 
 Can anybody help me on that? Thank you so much in advance.
 
 Regards,
 
 Merlin
 

Two things:

First, you can actually specify which tags you don't want strip_tags to
take out. Say for example you want p and br / tags to remain in the
string:

$string = strip_tags($string, 'pbr /');

Second, don't forget the tags you'll need in the preg_replace function:

$str = preg_replace('/\a href=([^\]*)[^\]*\/', \1, $str);

You can use other characters, such as ! if you want instead of /, but
you have to use the same at the beginning and the end.

- --
Christopher Weldon, ZCE
President  CEO
Cerberus Interactive, Inc.
[EMAIL PROTECTED]
979.739.5874
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFBZ9yZxvk7JEXkbERAhuUAJ4o4rBiypj2OwpHjrUj2e0XZ8FVhQCeJZ6e
eCOa+PYkyrRacqnT5VtoL/A=
=/r2e
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] strip urls

2006-09-11 Thread Merlin

Thank you! That workes excellent!

Merlin


Christopher Weldon schrieb:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Merlin wrote:

RalfGesellensetter schrieb:

Am Montag 11 September 2006 15:36 schrieb Merlin:

I am trying to strip URL's out of a text. There is a function for
this in php, but I can't find it anywhere. Can sombody help?

hi, it's strip_tags and only removes the tags (a href ...) but keeps
the plain text that would be displayed in a text browser.

Hi there,

thank you for the hint. This it the one I was searching for. However
unfortunatelly the function also strips all other tags! I am looking for
one that only does strip the a href tag.

I am not so familar with regex, but I fear I would need to :-(

My guess is that it must be something like this:

$str = 'foo  a href=test/a o';
$str = preg_replace('a (.*)', '', $str);
echo $str;

Can anybody help me on that? Thank you so much in advance.

Regards,

Merlin



Two things:

First, you can actually specify which tags you don't want strip_tags to
take out. Say for example you want p and br / tags to remain in the
string:

$string = strip_tags($string, 'pbr /');

Second, don't forget the tags you'll need in the preg_replace function:

$str = preg_replace('/\a href=([^\]*)[^\]*\/', \1, $str);

You can use other characters, such as ! if you want instead of /, but
you have to use the same at the beginning and the end.

- --
Christopher Weldon, ZCE
President  CEO
Cerberus Interactive, Inc.
[EMAIL PROTECTED]
979.739.5874
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFBZ9yZxvk7JEXkbERAhuUAJ4o4rBiypj2OwpHjrUj2e0XZ8FVhQCeJZ6e
eCOa+PYkyrRacqnT5VtoL/A=
=/r2e
-END PGP SIGNATURE-


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] encrypted urls, mcrypt and mod_rewrite

2006-02-23 Thread Dan Rossi
Yes somehow in this case apache is treating the urlencoded string of a 
forward slash as a forward slash and so isnt matching the rule 
properly.


On 23/02/2006, at 9:58 PM, Jared Williams wrote:




Subject: Re: [PHP] encrypted urls, mcrypt and mod_rewrite

Somehow this part of the string is a problem, it has
underscores, but there is probably other things in this.

_%E5%D4%13%82%C9%DFN%5EFs%5E47%B2v%2F%D7%A4%0C%C6%9EnJ


I'd base64 encode that first then urlencode :)



On 23/02/2006, at 6:01 PM, Dan Rossi wrote:


Hi ive been trying to find answers with no luck. I am sending a
urlencoded encrypted string made with mcrypt. what is happening is
there is somehow special characters that mod_rewrite doesnt

like so it

wont find a regex match properly with this rule

RewriteRule ^feeds/(.*)$ refer.php?$1 [L,QSA]

Any ideas what it could be doing ? The strings are also

quite random,

so it will work sometimes for a particular url then other

times not ?



Jared

--
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



Re: [PHP] encrypted urls, mcrypt and mod_rewrite

2006-02-23 Thread Jochem Maas

Dan Rossi wrote:
Somehow this part of the string is a problem, it has underscores, but 
there is probably other things in this.


give code, give the whole string.



_%E5%D4%13%82%C9%DFN%5EFs%5E47%B2v%2F%D7%A4%0C%C6%9EnJ

On 23/02/2006, at 6:01 PM, Dan Rossi wrote:

Hi ive been trying to find answers with no luck. I am sending a 
urlencoded encrypted string made with mcrypt. what is happening is 
there is somehow special characters that mod_rewrite doesnt like so it 
wont find a regex match properly with this rule


RewriteRule ^feeds/(.*)$ refer.php?$1 [L,QSA]


why do you have the QSA flag here?



Any ideas what it could be doing ? The strings are also quite random, 
so it will work sometimes for a particular url then other times not ?





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] encrypted urls, mcrypt and mod_rewrite

2006-02-23 Thread Jared Williams
 
 Subject: Re: [PHP] encrypted urls, mcrypt and mod_rewrite
 
 Somehow this part of the string is a problem, it has 
 underscores, but there is probably other things in this.
 
 _%E5%D4%13%82%C9%DFN%5EFs%5E47%B2v%2F%D7%A4%0C%C6%9EnJ

I'd base64 encode that first then urlencode :)

 
 On 23/02/2006, at 6:01 PM, Dan Rossi wrote:
 
  Hi ive been trying to find answers with no luck. I am sending a 
  urlencoded encrypted string made with mcrypt. what is happening is 
  there is somehow special characters that mod_rewrite doesnt 
 like so it 
  wont find a regex match properly with this rule
 
  RewriteRule ^feeds/(.*)$ refer.php?$1 [L,QSA]
 
  Any ideas what it could be doing ? The strings are also 
 quite random, 
  so it will work sometimes for a particular url then other 
 times not ?
 

Jared

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] encrypted urls, mcrypt and mod_rewrite

2006-02-23 Thread Dan Rossi

Ahh thanks heaps, its working more nicely

However, trying to add more data into the encrypted string which is 
then base64_encoded I get a slash in the string which is breaking the 
rewriterule like the other cases.


UmFuZG9tSVYljfOW15UlfzVJV8zBtaEXPh0mPku64cowVrHo%2Fgno9LeTfwejwsmG

The requested URL 
/feeds/UmFuZG9tSVYljfOW15UlfzVJV8zBtaEXPh0mPku64cowVrHo/gno9LeTfwejwsmG 
was not found on this server.


The rewrite rule

RewriteEngine On
RewriteRule ^feeds/(.*)$ /refer.php?$1 [L,NE]

On 23/02/2006, at 9:58 PM, Jared Williams wrote:




Subject: Re: [PHP] encrypted urls, mcrypt and mod_rewrite

Somehow this part of the string is a problem, it has
underscores, but there is probably other things in this.

_%E5%D4%13%82%C9%DFN%5EFs%5E47%B2v%2F%D7%A4%0C%C6%9EnJ


I'd base64 encode that first then urlencode :)



On 23/02/2006, at 6:01 PM, Dan Rossi wrote:


Hi ive been trying to find answers with no luck. I am sending a
urlencoded encrypted string made with mcrypt. what is happening is
there is somehow special characters that mod_rewrite doesnt

like so it

wont find a regex match properly with this rule

RewriteRule ^feeds/(.*)$ refer.php?$1 [L,QSA]

Any ideas what it could be doing ? The strings are also

quite random,

so it will work sometimes for a particular url then other

times not ?



Jared

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] encrypted urls, mcrypt and mod_rewrite

2006-02-22 Thread Dan Rossi
Hi ive been trying to find answers with no luck. I am sending a 
urlencoded encrypted string made with mcrypt. what is happening is 
there is somehow special characters that mod_rewrite doesnt like so it 
wont find a regex match properly with this rule


RewriteRule ^feeds/(.*)$ refer.php?$1 [L,QSA]

Any ideas what it could be doing ? The strings are also quite random, 
so it will work sometimes for a particular url then other times not ?

Re: [PHP] encrypted urls, mcrypt and mod_rewrite

2006-02-22 Thread Dan Rossi
Somehow this part of the string is a problem, it has underscores, but 
there is probably other things in this.


_%E5%D4%13%82%C9%DFN%5EFs%5E47%B2v%2F%D7%A4%0C%C6%9EnJ

On 23/02/2006, at 6:01 PM, Dan Rossi wrote:

Hi ive been trying to find answers with no luck. I am sending a 
urlencoded encrypted string made with mcrypt. what is happening is 
there is somehow special characters that mod_rewrite doesnt like so it 
wont find a regex match properly with this rule


RewriteRule ^feeds/(.*)$ refer.php?$1 [L,QSA]

Any ideas what it could be doing ? The strings are also quite random, 
so it will work sometimes for a particular url then other times not ?


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Filtering URLs problem..

2005-12-22 Thread Jochem Maas

Anders Norrbring wrote:


I'm writing a filter/parsing function for texts entered by users, and 
I've run into a problem...
What I'm trying to do is to parse URLs of different sorts, ftp, http, 
mms, irc etc and format them as links, that part was real easy..


The hard part is when a user has already entered a complete link..
In short:

http://www.server.tld/page.html
should be converted to:
a 
href='http://www.server.tld/page.html'http://www.server.tld/page.html/a


That part works fine, but if the user enters:

a href='http://www.server.tld/page.html'click here/a

it all becomes a mess...  Can somebody please make a suggestion on this?


regular expressions - in particular a 'negative look behind' assertion.

here is a page that [trys to] explain it:
http://www.mircscripts.org/showdoc.php?type=tutorialid=2409

google given loads of hits for 'negative look behind', hopefully you
get somewhere - me I have too little time to right now to go into
examples. good luck

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Filtering URLs problem..

2005-12-20 Thread Anders Norrbring


I'm writing a filter/parsing function for texts entered by users, and 
I've run into a problem...
What I'm trying to do is to parse URLs of different sorts, ftp, http, 
mms, irc etc and format them as links, that part was real easy..


The hard part is when a user has already entered a complete link..
In short:

http://www.server.tld/page.html
should be converted to:
a 
href='http://www.server.tld/page.html'http://www.server.tld/page.html/a


That part works fine, but if the user enters:

a href='http://www.server.tld/page.html'click here/a

it all becomes a mess...  Can somebody please make a suggestion on this?
--

Anders Norrbring
Norrbring Consulting

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Filtering URLs problem..

2005-12-20 Thread Philip Hallstrom
I'm writing a filter/parsing function for texts entered by users, and I've 
run into a problem...
What I'm trying to do is to parse URLs of different sorts, ftp, http, mms, 
irc etc and format them as links, that part was real easy..


The hard part is when a user has already entered a complete link..
In short:

http://www.server.tld/page.html
should be converted to:
a href='http://www.server.tld/page.html'http://www.server.tld/page.html/a

That part works fine, but if the user enters:

a href='http://www.server.tld/page.html'click here/a

it all becomes a mess...  Can somebody please make a suggestion on this?


Skip anything inside  tags... then you're last line would come through 
completely unchanged...


-philip

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Filtering URLs problem..

2005-12-20 Thread Silvio Porcellana [tradeOver]
Anders Norrbring wrote:
 
 I'm writing a filter/parsing function for texts entered by users, and
 I've run into a problem...
 What I'm trying to do is to parse URLs of different sorts, ftp, http,
 mms, irc etc and format them as links, that part was real easy..
 

You might want to consider using vbCode, there is a nice class for PHP here:
http://www.phpclasses.org/browse/package/1379.html

HTH, cheers.
Silvio

-- 
tradeOver | http://www.tradeover.net
...ready to become the King of the World?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Filtering URLs problem..

2005-12-20 Thread Anders Norrbring

On 2005-12-20 16:16 Silvio Porcellana [tradeOver] wrote:

Anders Norrbring wrote:


I'm writing a filter/parsing function for texts entered by users, and
I've run into a problem...
What I'm trying to do is to parse URLs of different sorts, ftp, http,
mms, irc etc and format them as links, that part was real easy..




You might want to consider using vbCode, there is a nice class for PHP here:
http://www.phpclasses.org/browse/package/1379.html

HTH, cheers.
Silvio



Thanks, but I already use PEAR HTML_BBCodeParser for that part.. :)
I solved it by a lookbehind, if there isn't a whitespace before the URL, 
just jump over it.


Thanks for the suggestion!
--

Anders Norrbring
Norrbring Consulting

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Filtering URLs problem..

2005-12-20 Thread Jochem Maas

Anders Norrbring wrote:

On 2005-12-20 16:16 Silvio Porcellana [tradeOver] wrote:


Anders Norrbring wrote:


I'm writing a filter/parsing function for texts entered by users, and
I've run into a problem...
What I'm trying to do is to parse URLs of different sorts, ftp, http,
mms, irc etc and format them as links, that part was real easy..




You might want to consider using vbCode, there is a nice class for PHP 
here:

http://www.phpclasses.org/browse/package/1379.html

HTH, cheers.
Silvio



Thanks, but I already use PEAR HTML_BBCodeParser for that part.. :)
I solved it by a lookbehind, if there isn't a whitespace before the URL, 


I answered your question stating that a regexp with a
negative-lookahead assertion would probably be a good way to go...
but it seems my post never arrived ... anyway I think a negative lookahead or
lookbehind assertion will cut it. I would just like to add that you might 
consider
looking behind for something a little more specific that a white space
(or lack of it); consider what happens when you are given the following HTML 
snippet:

pclick this: bhttp://yourdomain.com/something/b

depending on the processing you do to the text prior to linkifying
(made that word up!) this may not be relevant.



just jump over it.

Thanks for the suggestion!


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] encrypting urls

2005-08-02 Thread Sebastian
i need to mask (hide) some vars in a url so they arent visible to the 
user. example, i want a url like this:


page?id=3something=12more=12

to turn into:

page?id=3;LyFU;MLFxvy

so from LyFU i can access $something and from MLFxvy $more
any ideas how i can do this?

doesn't have to be 100% secure, just a simple way hide it from the user.


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.9.7/60 - Release Date: 7/28/2005

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] encrypting urls

2005-08-02 Thread Rory Browne
serialize/unserialize accompanied by some compression/decompression
should do the trick. Your output probably won't be any smaller with
compresson overhead, but it would be non-obvious. It is also extremely
easy to circumvent.

On 8/2/05, Sebastian [EMAIL PROTECTED] wrote:
 i need to mask (hide) some vars in a url so they arent visible to the
 user. example, i want a url like this:
 
 page?id=3something=12more=12
 
 to turn into:
 
 page?id=3;LyFU;MLFxvy
 
 so from LyFU i can access $something and from MLFxvy $more
 any ideas how i can do this?
 
 doesn't have to be 100% secure, just a simple way hide it from the user.
 
 
 --
 No virus found in this outgoing message.
 Checked by AVG Anti-Virus.
 Version: 7.0.338 / Virus Database: 267.9.7/60 - Release Date: 7/28/2005
 
 --
 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



Re: [PHP] encrypting urls

2005-08-02 Thread Rory Browne
On 8/2/05, Torgny Bjers [EMAIL PROTECTED] wrote:
 Another idea would be to Base64 encode/decode the parameters.

I'm not sure why you sent this to me(and me only). It's not me, but
rather the OP who wants to encrypt the url.

 
 Rory Browne wrote:
 
 serialize/unserialize accompanied by some compression/decompression
 should do the trick. Your output probably won't be any smaller with
 compresson overhead, but it would be non-obvious. It is also extremely
 easy to circumvent.
 
 On 8/2/05, Sebastian [EMAIL PROTECTED] wrote:
 
 
 i need to mask (hide) some vars in a url so they arent visible to the
 user. example, i want a url like this:
 
 page?id=3something=12more=12
 
 to turn into:
 
 page?id=3;LyFU;MLFxvy
 
 so from LyFU i can access $something and from MLFxvy $more
 any ideas how i can do this?
 
 doesn't have to be 100% secure, just a simple way hide it from the user.
 
 
 
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Relative URLs

2005-02-21 Thread Pedro Fayolle
Hi,

I wanted to gather opinions on what method is best for dealing with
relative URLs (i.e. in HTML links) on complex, multi-level directory
structures.

Here's what I have so far...

Goals:

1. Simpliest possible management of relative URLs.
2. Be able to move the entire site from one directory to another
without breaking links.
3. Be friendly with clean URL methods, such as using special query
strings like server.com/index.php/products/item/10.

Methods:

Using static absolute URLs (/absolute/path/) should of course be
considered obsolete as it doesn't comply with goal #2.

One possible method I tend to use is to transform all relative paths
into absolute with PHP before sending the document. This is a very
efficient but rather annoying method to work with, as most URLs need
to be pre-processed.

Another, generally cleaner method is to use the HTML base tag, which
allows one to define a base path for every relative URL found in the
document. This is however a nuisance whenever you need to link back to
the current document, such as with a regular relative query string
(?search=XX) or with a fragment link (#section), as the browser
would make them relative to the base path, forcing one to use the long
absolute URL each time.

Please tell me which you generally think is better and why, and if you
know any other method I could've missed.

Thanks,

Pedro Fayolle

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Relative URLs

2005-02-21 Thread Justin French
Pedro,
Something has got to give somewhere.  You can't have all those 
requirements without some sort of trade off -- especially if you're 
dealing with some sort of CMS or with content entered by some 
non-technical writers.  The common solution is to use PHP to write the 
links for you in some way, using a globally available constant or 
variable that holds a path prefix, and specifying all paths as absolute 
URLs relative to that path.

?php
$prefix = '/foo';
echo a href='{$prefix}/to/somewhere.html'link/a
?
The above example outputs a href='/foo/to/somewhere.html'link/a
?php
$prefix = '';
echo a href='{$prefix}/to/somewhere.html'link/a
?
But this just outputs a href='/to/somewhere.html'link/a
In the context of HTML the link might look like this:
a href=?=$prefix?/to/somewhere.htmllink/a
And if all that seems too awkward, you could write a helper function 
which writes the links for you, eg:

?
function link($text,$uri) {
  global $prefix;
  return a href='{$prefix}/{$uri}'{$text}/a;
  }
$prefix = /path;
?
and then do this:
?= link(click here,/to/something.html) ?
Obviously the function could be extended to check for #fragments, but 
without a doubt, the only safe way to write good URLs is to specify a 
full path for everything except #fragments.  Then if you need the 
ability to move the site into directory, then specify a path prefix 
which gets used when needed.

Passing the entire HTMl page through a URL parser/modifier would be 
another option, but I'd be staying well clear of that.

I could go on for hours and provide plenty of reasons, and better 
examples, but you need to do some of it yourself :)  And if your answer 
is I only want to use plain HTML for the links, but still want to be 
able to move my site into directories, then I'm afraid no one can 
really help you, sorry.

Justin

On 22/02/2005, at 2:18 AM, Pedro Fayolle wrote:
Hi,
I wanted to gather opinions on what method is best for dealing with
relative URLs (i.e. in HTML links) on complex, multi-level directory
structures.
Here's what I have so far...
Goals:
1. Simpliest possible management of relative URLs.
2. Be able to move the entire site from one directory to another
without breaking links.
3. Be friendly with clean URL methods, such as using special query
strings like server.com/index.php/products/item/10.
Methods:
Using static absolute URLs (/absolute/path/) should of course be
considered obsolete as it doesn't comply with goal #2.
One possible method I tend to use is to transform all relative paths
into absolute with PHP before sending the document. This is a very
efficient but rather annoying method to work with, as most URLs need
to be pre-processed.
Another, generally cleaner method is to use the HTML base tag, which
allows one to define a base path for every relative URL found in the
document. This is however a nuisance whenever you need to link back to
the current document, such as with a regular relative query string
(?search=XX) or with a fragment link (#section), as the browser
would make them relative to the base path, forcing one to use the long
absolute URL each time.
Please tell me which you generally think is better and why, and if you
know any other method I could've missed.
Thanks,
Pedro Fayolle
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

---
Justin French, Indent.com.au
[EMAIL PROTECTED]
Web Application Development  Graphic Design
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] apache htaccess mod rewrite with php querystring urls

2004-08-12 Thread raisinlove
Hi, I realize this isnt specificaly related to php, but most php 
developers are familiar with this.

My website uses an index.php file to load all content with a template, 
using urls like so:

http://www.foo.com/index.php?page=splash.html
In the same directory, there is a file called splash.html, but what I 
would like to do is that if the source file is called, the php file 
would load instead. So typing in:

http://www.foo.com/splash.html
would bring up:
http://www.foo.com/index.php?page=splash.html
instead.
The solution I found was to use an .htaccess file, but it only brings up 
a 403 forbidden access error everytime. ModRewrite is enabled, so what 
could be the problem? Here is the code I used:

RewriteEngine on
RewriteBase /
RewriteRule ^[A-Za-z0-9]\.html$ /index.php?page=$1
thanks for your help :)
-steph
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: apache htaccess mod rewrite with php querystring urls

2004-08-12 Thread Fabrice Lezoray
Raisinlove a écrit :
Hi, I realize this isnt specificaly related to php, but most php 
hi
developers are familiar with this.
My website uses an index.php file to load all content with a template, 
using urls like so:

http://www.foo.com/index.php?page=splash.html
In the same directory, there is a file called splash.html, but what I 
would like to do is that if the source file is called, the php file 
would load instead. So typing in:

http://www.foo.com/splash.html
would bring up:
http://www.foo.com/index.php?page=splash.html
instead.
The solution I found was to use an .htaccess file, but it only brings up 
a 403 forbidden access error everytime. ModRewrite is enabled, so what 
could be the problem? Here is the code I used:

RewriteEngine on
RewriteBase /
RewriteRule ^[A-Za-z0-9]\.html$ /index.php?page=$1
[A-Za-z0-9] will only match one character.
Try this :
 RewriteEngine on
 RewriteRule [A-Za-z0-9]+\.html$ /index.php?page=$1
thanks for your help :)
-steph

--
Fabrice Lezoray
http://classes.scriptsphp.fr
-
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] apache htaccess mod rewrite with php querystring urls

2004-08-12 Thread Jay Blanchard
[snip]
My website uses an index.php file to load all content with a template, 
using urls like so:

http://www.foo.com/index.php?page=splash.html

In the same directory, there is a file called splash.html, but what I 
would like to do is that if the source file is called, the php file 
would load instead. So typing in:

http://www.foo.com/splash.html

would bring up:

http://www.foo.com/index.php?page=splash.html

instead.
[/snip]

A simple redirection using meta refresh in the html file would work

meta http-equiv=refresh
content=1;url=http://www.foo.com/index.php?page=splash.html; 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] apache htaccess mod rewrite with php querystring urls

2004-08-12 Thread raisinlove
A simple redirection using meta refresh in the html file would work
meta http-equiv=refresh
content=1;url=http://www.foo.com/index.php?page=splash.html; 
This isn't what I want since (I should probably have specified) the html 
files contain no headers. The header is generated by the php file.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: apache htaccess mod rewrite with php querystring urls

2004-08-12 Thread raisinlove
[A-Za-z0-9] will only match one character. 
Try this :
 RewriteEngine on
 RewriteRule [A-Za-z0-9]+\.html$ /index.php?page=$1
Ah, good point there. Thanks.
However, I'm still experiencing problems displaying any page contained 
within the folder which holds this htaccess file. I get a 403 Forbidden 
Access error everytime. Your example above is the only code contained in 
my file. What could be the cause of this, and how can I fix it?

thanks
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: apache htaccess mod rewrite with php querystring urls

2004-08-12 Thread Peter Brodersen
On Thu, 12 Aug 2004 14:19:07 +0200, in php.general you wrote:

 [A-Za-z0-9] will only match one character. 
 Try this :
  RewriteEngine on
  RewriteRule [A-Za-z0-9]+\.html$ /index.php?page=$1

$1 would be a backreference, but there are no capturing parenthesis.

RewriteRule ([A-Za-z0-9]+\.html)$ /index.php?page=$1

However, I'm still experiencing problems displaying any page contained 
within the folder which holds this htaccess file. I get a 403 Forbidden 
Access error everytime.

It's pretty simple, though: If you get an error, check your error log
for Apache (default written to logs/error.log). It would give you the
reason for you Apache has given a 403-error to the client.

Still, this is not much of a PHP issue. Since Rewrite-magic tend to be
pretty complicated (and there are a couple of misunderstandings
regarding this feature), I do think some Apache mailing lists would be
of more help for you.

-- 
- Peter Brodersen

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] nested URLs

2004-05-26 Thread Marco Bleeker
Hello, I've bumped upon a problem. I would like to send an URL as variable
in the URL to a php file. But what if the URL in the variable is itself a
PHP file with variables?

It does work when I post them from a form. This form has only hidden fields,
and looks a bit akward. Is there a way to directly put them in the URL of a
link?

The form looks like this:

FORM NAME=meeltje ACTION=/gen/mail1.php METHOD=POST TARGET=melen
INPUT TYPE=HIDDEN NAME=subject VALUE=?=$row1?
INPUT TYPE=HIDDEN NAME=link
VALUE=www.ecocam.com/mview.php?id=?=$id.(($ln=='NL')?'ln=NL':'')?
INPUT TYPE=HIDDEN NAME=ln VALUE=?=$ln?
/FORM

Please note the double definition of the ln variable (language, it sends
NL for Dutch language; the first one to mview.php and the second one to
mail1.php). How to put this directly in parameters to mail1.php?

Thanks, Marco (please also reply to my own email adress)

www.ecocam.com
Marco Bleeker, Amsterdam, NL.
Please regard my email address as confidential - as I do with your's.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] nested URLs

2004-05-26 Thread Jeroen Serpieters
On Wed, 26 May 2004, Marco Bleeker wrote:


 FORM NAME=meeltje ACTION=/gen/mail1.php METHOD=POST TARGET=melen
 INPUT TYPE=HIDDEN NAME=subject VALUE=?=$row1?
 INPUT TYPE=HIDDEN NAME=link
 INPUT TYPE=HIDDEN NAME=ln VALUE=?=$ln?
 /FORM

 Please note the double definition of the ln variable (language, it sends
 NL for Dutch language; the first one to mview.php and the second one to
 mail1.php). How to put this directly in parameters to mail1.php?

 Thanks, Marco (please also reply to my own email adress)

 www.ecocam.com
 Marco Bleeker, Amsterdam, NL.
 Please regard my email address as confidential - as I do with your's.



 VALUE=www.ecocam.com/mview.php?id=?=$id.(($ln=='NL')?'ln=NL':'')?

Pass the url to url_encode and that should do it to pass it succesfully to
your other page.

echo a href=\/gen/mail1.php?link=\ . 
urlencode(http://www.ecocam.com/mview.php?id={$id}; . ( $ln == 'NL' ? 'ln=NL' : ''  
) ) . \Link/a;


-- 
Jeroen

Like the creators of sitcoms or junk food or package tours, Java's designers were 
consciously designing
a product for people not as smart as them.
-- Paul Graham

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] intercepting URLs in a control-system

2003-10-17 Thread SLanger
Hello 

If you are using PHP as an Apachemodule you also have the option of using 
a url like
http://example.com/index.php/test/test.html
Apache will see that test.html is not available and will travel down the 
directory path til it gets to the index.php (which should exist BTW) and 
call that script. 
This seems to work on most default installation of apache using php as 
apachemodule. (Don't know if this is true for all apache installations and 
if this still works on apache2)

In index.php you can parse the requesturi and decode it appropriatly.
Be aware this only works on apache with php as a module and it might not 
be as fast as mod_rewrite ( and as clean) but it can be used on servers 
that don't have mod_rewrite installed or where you don't have access to 
the config or htaccess.

Regards
Stefan Langer


Re: [PHP] intercepting URLs in a control-system

2003-10-17 Thread Mike Migurski
If you are using PHP as an Apachemodule you also have the option of using
a url like
http://example.com/index.php/test/test.html
Apache will see that test.html is not available and will travel down the
directory path til it gets to the index.php (which should exist BTW) and
call that script.
This seems to work on most default installation of apache using php as
apachemodule. (Don't know if this is true for all apache installations and
if this still works on apache2)

This came up here a week or so ago - it will work with Apache 2.0 if the
AcceptPathInfo directive is set correctly:
http://httpd.apache.org/docs-2.0/mod/core.html#acceptpathinfo

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] intercepting URLs in a control-system

2003-10-16 Thread Alan Lord
Please forgive any obvious ignorances on my part, I am just learning PHP...

Having read quite a bit on-line, I am interested in trying to trap URLs
sent to my site so I can process the request and respond without
neccessarily having a real page to serve. If this makes any sense, how do
I do it? Because I expect that apache (in my case) would not like a URL that
contains extra directories/files and would reject it.

An example:

Web Site Root:

www.abc.com/index.php

On that page are a tags to further information but which physically don't
exist. It will be automatically generated from a database. For example:

www.abc.com/cars/volvo/X70.html

If I don't have that directory tree and a file called X70.html. Could I
trap the http/URL request (BEFORE apache throws it out) and process it in
my PHP control-engine which will find the right information and respond
accordingly?

Thanks in advance,

Alan

PS, if there are any examples of this (GPL) which you know of, please just
pass me the link.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] intercepting URLs in a control-system

2003-10-16 Thread Ray Hunter

 Having read quite a bit on-line, I am interested in trying to trap URLs
 sent to my site so I can process the request and respond without
 neccessarily having a real page to serve. If this makes any sense, how do
 I do it? Because I expect that apache (in my case) would not like a URL that
 contains extra directories/files and would reject it.

Try looking at apache mod_rewrite and see if that will work for you...i
have used it to do url rewrites for me and have a main php page handle
the requests.

--
BigDog

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] intercepting URLs in a control-system

2003-10-16 Thread Chris W. Parker
Alan Lord mailto:[EMAIL PROTECTED]
on Thursday, October 16, 2003 1:40 PM said:

 Having read quite a bit on-line, I am interested in trying to trap
 URLs sent to my site so I can process the request and respond without
 neccessarily having a real page to serve. If this makes any sense,
 how do I do it?

Yes. Like another poster suggested you'll want to use mod_rewrite. You
can turn urls such as www.abc.com/cars/volvo/X70.html into
www.abc.com/cars.php?make=volvomodel=X70

 Because I expect that apache (in my case) would not
 like a URL that contains extra directories/files and would reject it.

Yes, it's called a 404.


HTH,
Chris.


--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] intercepting URLs in a control-system

2003-10-16 Thread Marek Kilimajer
Another option besides mod_rewrite is ErrorDocument directive in .htaccess:

ErrorDocument 404 404.php

In 404.php you trap the request, url will be in $_SERVER['REQUEST_URI']

Alan Lord wrote:
Please forgive any obvious ignorances on my part, I am just learning PHP...

Having read quite a bit on-line, I am interested in trying to trap URLs
sent to my site so I can process the request and respond without
neccessarily having a real page to serve. If this makes any sense, how do
I do it? Because I expect that apache (in my case) would not like a URL that
contains extra directories/files and would reject it.
An example:

Web Site Root:

www.abc.com/index.php

On that page are a tags to further information but which physically don't
exist. It will be automatically generated from a database. For example:
www.abc.com/cars/volvo/X70.html

If I don't have that directory tree and a file called X70.html. Could I
trap the http/URL request (BEFORE apache throws it out) and process it in
my PHP control-engine which will find the right information and respond
accordingly?
Thanks in advance,

Alan

PS, if there are any examples of this (GPL) which you know of, please just
pass me the link.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Absolute URLs with Require Include

2003-08-29 Thread Seth Willits
Is there anyway to get an absolute URL to work with Require  Include?  
Why doesn't it work already? I did see the tip about using $_SERVER,  
but this slows down page-loading considerably.



Seth Willits
 
---
President and Head Developer of Freak Software - http://www.freaksw.com
QA Columnist for REALbasic Developer Magazine -  
http://www.rbdeveloper.com
Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames

Standing up for what you believe in is never a waste of time.
-- Seth Willits
 
---

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Absolute URLs with Require Include

2003-08-29 Thread John W. Holmes
Seth Willits wrote:

Is there anyway to get an absolute URL to work with Require  Include?  
Why doesn't it work already? I did see the tip about using $_SERVER,  
but this slows down page-loading considerably.


You can use URLs in your include() or require() calls.

include(http://www.google.com;);

But... if you try to include a .php page this way, you will get the 
RESULT of the PHP file being RUN by the server... not the PHP code. Now, 
if you have an include.inc page on another server that is actually PHP 
code, I guess you could include it using something like the above and 
it'll be run as PHP code within your script.

If you're talking about an absolute PATH, then, yes, that works too:

include('/var/www/site/mine/html/htdocs/sub/dir/include.php');

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals  www.phparch.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] ? in URLS.

2003-01-24 Thread Chris Shiflett
--- Martin Towell [EMAIL PROTECTED] wrote:
 if it's just the string after the ? then use
 $QUERY_STRING can't remember which $_* variable
 it's under...

$_GET is the superglobal array for URL variables.

Chris

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] ? in URLS.

2003-01-24 Thread 1LT John W. Holmes
  if it's just the string after the ? then use
  $QUERY_STRING can't remember which $_* variable
  it's under...
 
 $_GET is the superglobal array for URL variables.

And the Query_String is in $_SERVER, as $_SERVER['QUERY_STRING'].

---John Holmes...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] ? in URLS.

2003-01-23 Thread Marek Kilimajer
use urlencode()

Simon Angell wrote:


Hi All.
I am currently playing with sripts, and have come across a problem, that i
can't slove. (i am a novice - lol).
The script requires a URL to grab data from. The URL has a ? in it, and
testing the script it grabs the base data of the URL, but not the essential
data i need, which is only brought up with what comes after the ? in the
URL. now i figure it has something to do with the ? in the URL but i can't
seem to fix it myself.

Thanks

--

Cheers
-
Simon Angell
Canberra, ACT
www.canberra-wx.com
-
Proud member of the
Australian Severe Weather Association.
www.severeweather.asn.au
--



 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] ? in URLS.

2003-01-23 Thread Simon Angell
Ok, ill explain my self further. the URL in the script is
http://www.weatherzone.com.au/yourHomePage.jsp?ref=f2eeb571ed

The script uses the URL to see the page and store it locally, then another
script grabs selected data from that page. the stuff after the ? is
essential for the data i want to be displayed, with out that part, the
script only sees the base page without the data i need, so hence it doesn't
grab it. so how do i use the
$_GET['var1']
$_GET['var2']
$_GET['var3']

or urlencode() in the script
this is the script.
?php
//Writing of local file

 $rContents = implode( \r\n, file(
'http://www.weatherzone.com.au/yourHomePage.jsp?ref=f2eeb571ed' ) );

if( ($fp = fopen( 'wztest.txt', 'wb+' )) !== false )
{
fputs( $fp, $rContents );
fclose( $fp );
}
?


--

Cheers
-
Simon Angell
Canberra, ACT
www.canberra-wx.com
-
Proud member of the
Australian Severe Weather Association.
www.severeweather.asn.au
--
Marek Kilimajer [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 use urlencode()

 Simon Angell wrote:

 Hi All.
 I am currently playing with sripts, and have come across a problem, that
i
 can't slove. (i am a novice - lol).
 The script requires a URL to grab data from. The URL has a ? in it, and
 testing the script it grabs the base data of the URL, but not the
essential
 data i need, which is only brought up with what comes after the ? in the
 URL. now i figure it has something to do with the ? in the URL but i
can't
 seem to fix it myself.
 
 Thanks
 
 --
 
 Cheers
 -
 Simon Angell
 Canberra, ACT
 www.canberra-wx.com
 -
 Proud member of the
 Australian Severe Weather Association.
 www.severeweather.asn.au
 --
 
 
 
 
 




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] ? in URLS.

2003-01-23 Thread Martin Towell
if it's just the string after the ? then use $QUERY_STRING
can't remember which $_* variable it's under...
HTH

 -Original Message-
 From: Simon Angell [mailto:[EMAIL PROTECTED]]
 Sent: Friday, January 24, 2003 4:50 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] ? in URLS.
 
 
 Ok, ill explain my self further. the URL in the script is
 http://www.weatherzone.com.au/yourHomePage.jsp?ref=f2eeb571ed
 
 The script uses the URL to see the page and store it locally, 
 then another
 script grabs selected data from that page. the stuff after the ? is
 essential for the data i want to be displayed, with out that part, the
 script only sees the base page without the data i need, so 
 hence it doesn't
 grab it. so how do i use the
 $_GET['var1']
 $_GET['var2']
 $_GET['var3']
 
 or urlencode() in the script
 this is the script.
 ?php
 //Writing of local file
 
  $rContents = implode( \r\n, file(
 'http://www.weatherzone.com.au/yourHomePage.jsp?ref=f2eeb571ed' ) );
 
 if( ($fp = fopen( 'wztest.txt', 'wb+' )) !== false )
 {
 fputs( $fp, $rContents );
 fclose( $fp );
 }
 ?
 
 
 --
 
 Cheers
 -
 Simon Angell
 Canberra, ACT
 www.canberra-wx.com
 -
 Proud member of the
 Australian Severe Weather Association.
 www.severeweather.asn.au
 --
 Marek Kilimajer [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  use urlencode()
 
  Simon Angell wrote:
 
  Hi All.
  I am currently playing with sripts, and have come across a 
 problem, that
 i
  can't slove. (i am a novice - lol).
  The script requires a URL to grab data from. The URL has a 
 ? in it, and
  testing the script it grabs the base data of the URL, but not the
 essential
  data i need, which is only brought up with what comes 
 after the ? in the
  URL. now i figure it has something to do with the ? in the 
 URL but i
 can't
  seem to fix it myself.
  
  Thanks
  
  --
  
  Cheers
  -
  Simon Angell
  Canberra, ACT
  www.canberra-wx.com
  -
  Proud member of the
  Australian Severe Weather Association.
  www.severeweather.asn.au
  --
  
  
  
  
  
 
 
 
 
 -- 
 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




[PHP] ? in URLS.

2003-01-22 Thread Simon Angell
Hi All.
I am currently playing with sripts, and have come across a problem, that i
can't slove. (i am a novice - lol).
The script requires a URL to grab data from. The URL has a ? in it, and
testing the script it grabs the base data of the URL, but not the essential
data i need, which is only brought up with what comes after the ? in the
URL. now i figure it has something to do with the ? in the URL but i can't
seem to fix it myself.

Thanks

--

Cheers
-
Simon Angell
Canberra, ACT
www.canberra-wx.com
-
Proud member of the
Australian Severe Weather Association.
www.severeweather.asn.au
--



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] ? in URLS.

2003-01-22 Thread John Nichel
Everything after the question mark is a query string.  Say you have this...

http://www.mydomain.com/index.php?var1=value1var2=value2var3=something-else

to access these values in your script...

$_GET['var1']
$_GET['var2']
$_GET['var3']

In other words, if I want to print out the value of var2 on the page

echo ( This is var2 :  . $_GET['var2'] );

Will print this out to the browser

This is var2 : value2

HTH

Simon Angell wrote:

Hi All.
I am currently playing with sripts, and have come across a problem, that i
can't slove. (i am a novice - lol).
The script requires a URL to grab data from. The URL has a ? in it, and
testing the script it grabs the base data of the URL, but not the essential
data i need, which is only brought up with what comes after the ? in the
URL. now i figure it has something to do with the ? in the URL but i can't
seem to fix it myself.

Thanks

--

Cheers
-
Simon Angell
Canberra, ACT
www.canberra-wx.com
-
Proud member of the
Australian Severe Weather Association.
www.severeweather.asn.au
--






--
By-Tor.com
It's all about the Rush
http://www.by-tor.com


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] rewrite urls with preg_replace

2002-11-28 Thread Dieter Koch
Hi to all the PHP-Fans out there,

i have a syntax-problem with the folowing preg_replace command:

$returnString = preg_replace(/(href=\)(.+?)(\)/is,
preg_quote(\\1.ebLinkEncode(.\\2.).\\3), $returnString);

i'm trying to call my own function within a preg_replace function and it
won't work.
any ideas ? it seems to me, that the quoting is incorrect, but i'm not
shure, why it is incorrect,
especially because i use preg_quote() ...

thanks in advance for some hints !

best regards
[EMAIL PROTECTED]






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] rewrite urls with preg_replace

2002-11-28 Thread John W. Holmes
 Hi to all the PHP-Fans out there,
 
 i have a syntax-problem with the folowing preg_replace command:
 
 $returnString = preg_replace(/(href=\)(.+?)(\)/is,
 preg_quote(\\1.ebLinkEncode(.\\2.).\\3), $returnString);
 
 i'm trying to call my own function within a preg_replace function and
it
 won't work.
 any ideas ? it seems to me, that the quoting is incorrect, but i'm not
 shure, why it is incorrect,
 especially because i use preg_quote() ...

Take a look at preg_replace_callback().

http://www.php.net/manual/en/function.preg-replace-callback.php

---John Holmes...



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Parse URLs

2002-11-24 Thread Stephen
Thanks! Just one more question. I also want to replace emoticons, such as
:-), :), or ;-), that are stored in a table. The structure is this: id,
emote, replace. How could I check to see if the text the user typed in
contains any of the emotes in the table then replace them with the correct
replacement? Also, how could I then limit how many are in the post?


 - Original Message -
 From: Tom Culpepper [EMAIL PROTECTED]
 To: Stephen [EMAIL PROTECTED]
 Cc: PHP List [EMAIL PROTECTED]
 Sent: Saturday, November 23, 2002 9:46 PM
 Subject: Re: [PHP] Parse URLs


  from the archives of the list
  http://www.phpbuilder.com/mail/php-windows/2001042/0222.php
 
  -tom culpepper
 
 
  Stephen wrote:
   They are entering in a whole paragraph or two of text and I want to
 search
   the paragraph for URLs then make it a clickable URL and then store it
in
 a
   MySQL database.
  
  
   - Original Message -
   From: Tom Culpepper [EMAIL PROTECTED]
   To: Stephen [EMAIL PROTECTED]; [EMAIL PROTECTED]
   Sent: Saturday, November 23, 2002 9:05 PM
   Subject: Re: [PHP] Parse URLs
  
  
  
  not entirely sure what is going on there, but if the user is entering
  the url in a html form.  Then just grab the variable on the next page
  and run this
  
  $url=user $HTTP_GET_VARS[url]; (or $HTTP_POST_VARS depending on your
  form method)
  $url=a href=.$url..$url./a;
  echo $url;
  
  the only way to change it dynamically on the same page would be
  
   javascript.
  
  -tom culpepper
  
  Stephen wrote:
  
  I have a simple post script and I want to make it so if a user types
in
  a URL of some sort, to change it to make it clickable. How could I do
  
   that?
  
  Thanks,
  Stephen Craton
  http://www.melchior.us
  
  Life is a gift from God. Wasting it is like destroying a gift you
got
  from the person you love most. -- http://www.melchior.us
  
  
  
  
  --
  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
 
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Parse URLs

2002-11-24 Thread Justin French
Before asking, you should have done a search at google.com... I searched for
'emoticons replace php', and it returned HEAPS of results, including this
one, which seems close to what you're asking...

http://www.devarticles.com/art/1/161/2

Search the archives and google before posting please!


Justin


on 25/11/02 5:00 AM, Stephen ([EMAIL PROTECTED]) wrote:

 Thanks! Just one more question. I also want to replace emoticons, such as
 :-), :), or ;-), that are stored in a table. The structure is this: id,
 emote, replace. How could I check to see if the text the user typed in
 contains any of the emotes in the table then replace them with the correct
 replacement? Also, how could I then limit how many are in the post?


Justin French

http://Indent.com.au
Web Development  
Graphic Design



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Parse URLs

2002-11-24 Thread Stephen
Yes, I found that after posting my last message. Sorry and I'll use google
more...


- Original Message -
From: Justin French [EMAIL PROTECTED]
To: Stephen [EMAIL PROTECTED]; PHP List
[EMAIL PROTECTED]
Sent: Sunday, November 24, 2002 6:42 PM
Subject: Re: [PHP] Parse URLs


 Before asking, you should have done a search at google.com... I searched
for
 'emoticons replace php', and it returned HEAPS of results, including this
 one, which seems close to what you're asking...

 http://www.devarticles.com/art/1/161/2

 Search the archives and google before posting please!


 Justin


 on 25/11/02 5:00 AM, Stephen ([EMAIL PROTECTED]) wrote:

  Thanks! Just one more question. I also want to replace emoticons, such
as
  :-), :), or ;-), that are stored in a table. The structure is this: id,
  emote, replace. How could I check to see if the text the user typed in
  contains any of the emotes in the table then replace them with the
correct
  replacement? Also, how could I then limit how many are in the post?


 Justin French
 
 http://Indent.com.au
 Web Development 
 Graphic Design
 




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Parse URLs

2002-11-23 Thread Stephen



I have a simple post script and I want to make it so if a user 
types in a URL of some sort, to change it to make it clickable. How could I do 
that?
Thanks,Stephen Cratonhttp://www.melchior.us

"Life is a gift from God. Wasting it is like destroying a gift you got from 
the person you love most." -- http://www.melchior.us
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Parse URLs

2002-11-23 Thread Tom Culpepper
not entirely sure what is going on there, but if the user is entering 
the url in a html form.  Then just grab the variable on the next page 
and run this

$url=user $HTTP_GET_VARS[url]; (or $HTTP_POST_VARS depending on your 
form method)
$url=a href=.$url..$url./a;
echo $url;

the only way to change it dynamically on the same page would be javascript.

-tom culpepper

Stephen wrote:
I have a simple post script and I want to make it so if a user types in 
a URL of some sort, to change it to make it clickable. How could I do that?

Thanks,
Stephen Craton
http://www.melchior.us
 
Life is a gift from God. Wasting it is like destroying a gift you got 
from the person you love most. -- http://www.melchior.us




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Parse URLs

2002-11-23 Thread Stephen
They are entering in a whole paragraph or two of text and I want to search
the paragraph for URLs then make it a clickable URL and then store it in a
MySQL database.


- Original Message -
From: Tom Culpepper [EMAIL PROTECTED]
To: Stephen [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Saturday, November 23, 2002 9:05 PM
Subject: Re: [PHP] Parse URLs


 not entirely sure what is going on there, but if the user is entering
 the url in a html form.  Then just grab the variable on the next page
 and run this

 $url=user $HTTP_GET_VARS[url]; (or $HTTP_POST_VARS depending on your
 form method)
 $url=a href=.$url..$url./a;
 echo $url;

 the only way to change it dynamically on the same page would be
javascript.

 -tom culpepper

 Stephen wrote:
  I have a simple post script and I want to make it so if a user types in
  a URL of some sort, to change it to make it clickable. How could I do
that?
 
  Thanks,
  Stephen Craton
  http://www.melchior.us
 
  Life is a gift from God. Wasting it is like destroying a gift you got
  from the person you love most. -- http://www.melchior.us
 



 --
 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




Re: [PHP] Parse URLs

2002-11-23 Thread Tom Culpepper
from the archives of the list
http://www.phpbuilder.com/mail/php-windows/2001042/0222.php

-tom culpepper


Stephen wrote:

They are entering in a whole paragraph or two of text and I want to search
the paragraph for URLs then make it a clickable URL and then store it in a
MySQL database.


- Original Message -
From: Tom Culpepper [EMAIL PROTECTED]
To: Stephen [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Saturday, November 23, 2002 9:05 PM
Subject: Re: [PHP] Parse URLs




not entirely sure what is going on there, but if the user is entering
the url in a html form.  Then just grab the variable on the next page
and run this

$url=user $HTTP_GET_VARS[url]; (or $HTTP_POST_VARS depending on your
form method)
$url=a href=.$url..$url./a;
echo $url;

the only way to change it dynamically on the same page would be


javascript.


-tom culpepper

Stephen wrote:


I have a simple post script and I want to make it so if a user types in
a URL of some sort, to change it to make it clickable. How could I do



that?


Thanks,
Stephen Craton
http://www.melchior.us

Life is a gift from God. Wasting it is like destroying a gift you got
from the person you love most. -- http://www.melchior.us





--
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




[PHP] weird urls

2002-08-10 Thread XoXGrimreaper

How come some URLs have all these questions marks and stuff like that? Below:

source.php?url=/index.php

__
Pre-order the NEW Netscape 7.0 browser. Reserve your FREE CD and pay only $2.99 
shipping and handling. http://cd.netscape.com/promo_one/ 

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] weird urls

2002-08-10 Thread Chris Knipe

Erm, because that's the way it works?

Regards,
Chris Knipe
Cell: (072) 434-7582
MegaLAN Corporate Networking Services


/---
| This email is confidential and may contain legally privileged information.
| If you are not the intended recipient, you must not disclose or use
| the information contained in it. If you have received this email in error,
| please notify us immediately by return email and delete the document.
\---

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, August 10, 2002 7:56 PM
Subject: [PHP] weird urls


 How come some URLs have all these questions marks and stuff like that?
Below:

 source.php?url=/index.php

 __
 Pre-order the NEW Netscape 7.0 browser. Reserve your FREE CD and pay only
$2.99 shipping and handling. http://cd.netscape.com/promo_one/

 Get your own FREE, personal Netscape Mail account today at
http://webmail.netscape.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




RE: [PHP] weird urls

2002-08-10 Thread César Aracena

That's because PHP detects whatever it's after that question marks as
variables so it's able to process them in requests you make in your
scripts. The one you quote means that there is a variable being passed
from one page to another named $url which has the value /index.php.

So, if you call (in the incoming page) a script which need to know what
is the value of $url that was passed, the script will know that is
/index.php.

C.

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, August 10, 2002 2:56 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] weird urls
 
 How come some URLs have all these questions marks and stuff like that?
 Below:
 
 source.php?url=/index.php
 
 __
 Pre-order the NEW Netscape 7.0 browser. Reserve your FREE CD and pay
only
 $2.99 shipping and handling. http://cd.netscape.com/promo_one/
 
 Get your own FREE, personal Netscape Mail account today at
 http://webmail.netscape.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




[PHP] Smart URLs

2002-06-02 Thread Scott 'INtense!' Reismanis

Hey all,

I was recently trying my luck at dabbling in some mod_rewrite
stuff, and I have run into numerious errors. Basically my aim is to
re-write my sites URLs so instead of being say,
mysite.com/thumbnails?type=funnygallery=4 the URL is neat, similar to
many sites who would have something like mysite.com/thumbnails/funny/4

What ways are there of achieving this (excluding, redirecting the URL
and creating the page say index.htm automatically)? I have tried
mod_rewrite for two days solid to no avail. I am not sure if it is my
poor coding or the fact that I am running apache2 on a Windows platform
which are said not to support such a module well. If any alternatives
could be proposed or even better someone could suggest a mod_rewrite
routine which would transparently transform any url like
mysite.com/whatever/4/6 to mysite.com/whatever.php it would be greatly
appreciated. So far the rewrite you see below will work with
mysite.com/whatever/ however the minute you add something onto the end
i.e. mysite.com/whatever/4/ it will raise the error Premature end of
script headers: php.exe, instead of loading whatever.php as intended.

RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteRule ^/(.+)/(.+) $1.php [L]

Thanks for your time and hopefully someone understands what I am trying
to say :), and as always any suggestions at all would be awesome!

Regards,
 
 
   Scott 'INtense!' Reismanis
   Mod Database System Administrator
   [EMAIL PROTECTED]
   http://www.moddb.com/ - Every Game, Every Mod, One
Site... Go Figure!




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Smart URLs

2002-06-02 Thread Andrew Brampton

You can do this with just PHP, but I think php must be installed as a
module.
Basically place a file called thumbnails.php in your site route, then
whenever a URL like
mysite.com/thumbnails/funny/4
i called the thumbnails.php is excuted, in which you chop up the URL, and
find all your varibles...

Here is a example of some URL chopping (some code I stole from my source)
/*
Sample URLs:
/s/1/2/SchoolName/StudentName/ -Shows Student Page (with ID 2)
/s/1/0/SchoolName/-Shows Students At School (with school ID 1)
/s/1/2/   -would work as well (name in URL for search engines)
/s/1/0/   -would work as well
/s/-Shows Schools
*/

$url_array=explode(/,$REQUEST_URI);  //BREAK UP THE URL PATH
   //USING '/' as delimiter
if ($url_array[1] == 's')
 {
 if (isSet($url_array[2]))
  $url_sID=$url_array[2];  //School ID
 if (isSet($url_array[3]))
  $url_stID=$url_array[3];//Student ID
 if (isSet($url_array[4]))
  $url_sName=$url_array[4];  //School Name (not used)
 if (isSet($url_array[5]))
  $url_stName=$url_array[5];//Student Name (not used)
 }
/*

There was a article on phpbuilder.com that explains the benefits and
pitfalls of this idea... Here is the URL:
http://www.phpbuilder.com/columns/tim19990117.php3 and I think there was a
follow up article as well

Enjoy
Andrew

- Original Message -
From: Scott 'INtense!' Reismanis [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, June 03, 2002 5:28 AM
Subject: [PHP] Smart URLs


 Hey all,

 I was recently trying my luck at dabbling in some mod_rewrite
 stuff, and I have run into numerious errors. Basically my aim is to
 re-write my sites URLs so instead of being say,
 mysite.com/thumbnails?type=funnygallery=4 the URL is neat, similar to
 many sites who would have something like mysite.com/thumbnails/funny/4

 What ways are there of achieving this (excluding, redirecting the URL
 and creating the page say index.htm automatically)? I have tried
 mod_rewrite for two days solid to no avail. I am not sure if it is my
 poor coding or the fact that I am running apache2 on a Windows platform
 which are said not to support such a module well. If any alternatives
 could be proposed or even better someone could suggest a mod_rewrite
 routine which would transparently transform any url like
 mysite.com/whatever/4/6 to mysite.com/whatever.php it would be greatly
 appreciated. So far the rewrite you see below will work with
 mysite.com/whatever/ however the minute you add something onto the end
 i.e. mysite.com/whatever/4/ it will raise the error Premature end of
 script headers: php.exe, instead of loading whatever.php as intended.

 RewriteEngine On
 Options +FollowSymlinks
 RewriteBase /
 RewriteRule ^/(.+)/(.+) $1.php [L]

 Thanks for your time and hopefully someone understands what I am trying
 to say :), and as always any suggestions at all would be awesome!

 Regards,


Scott 'INtense!' Reismanis
Mod Database System Administrator
[EMAIL PROTECTED]
http://www.moddb.com/ - Every Game, Every Mod, One
 Site... Go Figure!




 --
 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




Re: [PHP] Smart URLs

2002-06-02 Thread Adrian Murphy

 whenever a URL like
 mysite.com/thumbnails/funny/4
 i called the thumbnails.php is excuted, in which you

I think if you call it thumbnails.php it won't work.
however if the script is simply called thumbnails then it'll
work.of course you then must make sure that 'thumbnails'
is parsed as php.do this with a .htaccess file :

Files thumbnails
ForceType application/x-httpd-php
/Files

- Original Message -
From: Andrew Brampton [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Sunday, June 02, 2002 1:20 PM
Subject: Re: [PHP] Smart URLs


 You can do this with just PHP, but I think php must be installed as a
 module.
 Basically place a file called thumbnails.php in your site route, then
 whenever a URL like
 mysite.com/thumbnails/funny/4
 i called the thumbnails.php is excuted, in which you chop up the URL, and
 find all your varibles...

 Here is a example of some URL chopping (some code I stole from my source)
 /*
 Sample URLs:
 /s/1/2/SchoolName/StudentName/ -Shows Student Page (with ID 2)
 /s/1/0/SchoolName/-Shows Students At School (with school ID 1)
 /s/1/2/   -would work as well (name in URL for search engines)
 /s/1/0/   -would work as well
 /s/-Shows Schools
 */

 $url_array=explode(/,$REQUEST_URI);  //BREAK UP THE URL PATH
//USING '/' as delimiter
 if ($url_array[1] == 's')
  {
  if (isSet($url_array[2]))
   $url_sID=$url_array[2];  //School ID
  if (isSet($url_array[3]))
   $url_stID=$url_array[3];//Student ID
  if (isSet($url_array[4]))
   $url_sName=$url_array[4];  //School Name (not used)
  if (isSet($url_array[5]))
   $url_stName=$url_array[5];//Student Name (not used)
  }
 /*

 There was a article on phpbuilder.com that explains the benefits and
 pitfalls of this idea... Here is the URL:
 http://www.phpbuilder.com/columns/tim19990117.php3 and I think there was a
 follow up article as well

 Enjoy
 Andrew

 - Original Message -
 From: Scott 'INtense!' Reismanis [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, June 03, 2002 5:28 AM
 Subject: [PHP] Smart URLs


  Hey all,
 
  I was recently trying my luck at dabbling in some mod_rewrite
  stuff, and I have run into numerious errors. Basically my aim is to
  re-write my sites URLs so instead of being say,
  mysite.com/thumbnails?type=funnygallery=4 the URL is neat, similar to
  many sites who would have something like mysite.com/thumbnails/funny/4
 
  What ways are there of achieving this (excluding, redirecting the URL
  and creating the page say index.htm automatically)? I have tried
  mod_rewrite for two days solid to no avail. I am not sure if it is my
  poor coding or the fact that I am running apache2 on a Windows platform
  which are said not to support such a module well. If any alternatives
  could be proposed or even better someone could suggest a mod_rewrite
  routine which would transparently transform any url like
  mysite.com/whatever/4/6 to mysite.com/whatever.php it would be greatly
  appreciated. So far the rewrite you see below will work with
  mysite.com/whatever/ however the minute you add something onto the end
  i.e. mysite.com/whatever/4/ it will raise the error Premature end of
  script headers: php.exe, instead of loading whatever.php as intended.
 
  RewriteEngine On
  Options +FollowSymlinks
  RewriteBase /
  RewriteRule ^/(.+)/(.+) $1.php [L]
 
  Thanks for your time and hopefully someone understands what I am trying
  to say :), and as always any suggestions at all would be awesome!
 
  Regards,
 
 
 Scott 'INtense!' Reismanis
 Mod Database System Administrator
 [EMAIL PROTECTED]
 http://www.moddb.com/ - Every Game, Every Mod, One
  Site... Go Figure!
 
 
 
 
  --
  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



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Smart URLs

2002-06-02 Thread Andrew Brampton

Hey try it, it works when are running the PHP Module in apache.
I have a server with proxy.php yet I access it via
myserver.com/proxy/whatever and it works with no special changes to the
config files.

Andrew
- Original Message -
From: Adrian Murphy [EMAIL PROTECTED]
To: Andrew Brampton [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Sunday, June 02, 2002 3:24 PM
Subject: Re: [PHP] Smart URLs


  whenever a URL like
  mysite.com/thumbnails/funny/4
  i called the thumbnails.php is excuted, in which you

 I think if you call it thumbnails.php it won't work.
 however if the script is simply called thumbnails then it'll
 work.of course you then must make sure that 'thumbnails'
 is parsed as php.do this with a .htaccess file :

 Files thumbnails
 ForceType application/x-httpd-php
 /Files

 - Original Message -
 From: Andrew Brampton [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Sunday, June 02, 2002 1:20 PM
 Subject: Re: [PHP] Smart URLs


  You can do this with just PHP, but I think php must be installed as a
  module.
  Basically place a file called thumbnails.php in your site route, then
  whenever a URL like
  mysite.com/thumbnails/funny/4
  i called the thumbnails.php is excuted, in which you chop up the URL,
and
  find all your varibles...
 
  Here is a example of some URL chopping (some code I stole from my
source)
  /*
  Sample URLs:
  /s/1/2/SchoolName/StudentName/ -Shows Student Page (with ID 2)
  /s/1/0/SchoolName/-Shows Students At School (with school ID 1)
  /s/1/2/   -would work as well (name in URL for search engines)
  /s/1/0/   -would work as well
  /s/-Shows Schools
  */
 
  $url_array=explode(/,$REQUEST_URI);  //BREAK UP THE URL PATH
 //USING '/' as delimiter
  if ($url_array[1] == 's')
   {
   if (isSet($url_array[2]))
$url_sID=$url_array[2];  //School ID
   if (isSet($url_array[3]))
$url_stID=$url_array[3];//Student ID
   if (isSet($url_array[4]))
$url_sName=$url_array[4];  //School Name (not used)
   if (isSet($url_array[5]))
$url_stName=$url_array[5];//Student Name (not used)
   }
  /*
 
  There was a article on phpbuilder.com that explains the benefits and
  pitfalls of this idea... Here is the URL:
  http://www.phpbuilder.com/columns/tim19990117.php3 and I think there was
a
  follow up article as well
 
  Enjoy
  Andrew
 
  - Original Message -
  From: Scott 'INtense!' Reismanis [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Monday, June 03, 2002 5:28 AM
  Subject: [PHP] Smart URLs
 
 
   Hey all,
  
   I was recently trying my luck at dabbling in some mod_rewrite
   stuff, and I have run into numerious errors. Basically my aim is to
   re-write my sites URLs so instead of being say,
   mysite.com/thumbnails?type=funnygallery=4 the URL is neat, similar to
   many sites who would have something like mysite.com/thumbnails/funny/4
  
   What ways are there of achieving this (excluding, redirecting the URL
   and creating the page say index.htm automatically)? I have tried
   mod_rewrite for two days solid to no avail. I am not sure if it is my
   poor coding or the fact that I am running apache2 on a Windows
platform
   which are said not to support such a module well. If any alternatives
   could be proposed or even better someone could suggest a mod_rewrite
   routine which would transparently transform any url like
   mysite.com/whatever/4/6 to mysite.com/whatever.php it would be greatly
   appreciated. So far the rewrite you see below will work with
   mysite.com/whatever/ however the minute you add something onto the end
   i.e. mysite.com/whatever/4/ it will raise the error Premature end of
   script headers: php.exe, instead of loading whatever.php as intended.
  
   RewriteEngine On
   Options +FollowSymlinks
   RewriteBase /
   RewriteRule ^/(.+)/(.+) $1.php [L]
  
   Thanks for your time and hopefully someone understands what I am
trying
   to say :), and as always any suggestions at all would be awesome!
  
   Regards,
  
  
  Scott 'INtense!' Reismanis
  Mod Database System Administrator
  [EMAIL PROTECTED]
  http://www.moddb.com/ - Every Game, Every Mod, One
   Site... Go Figure!
  
  
  
  
   --
   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
 


 --
 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




Re: [PHP] Smart URLs

2002-06-02 Thread Philip Olson

For tips on doing these things, read this faqt:

  http://www.faqts.com/knowledge_base/view.phtml/aid/124

Regards,
Philip Olson


On Sun, 2 Jun 2002, Andrew Brampton wrote:

 Hey try it, it works when are running the PHP Module in apache.
 I have a server with proxy.php yet I access it via
 myserver.com/proxy/whatever and it works with no special changes to the
 config files.
 
 Andrew
 - Original Message -
 From: Adrian Murphy [EMAIL PROTECTED]
 To: Andrew Brampton [EMAIL PROTECTED]; [EMAIL PROTECTED];
 [EMAIL PROTECTED]
 Sent: Sunday, June 02, 2002 3:24 PM
 Subject: Re: [PHP] Smart URLs
 
 
   whenever a URL like
   mysite.com/thumbnails/funny/4
   i called the thumbnails.php is excuted, in which you
 
  I think if you call it thumbnails.php it won't work.
  however if the script is simply called thumbnails then it'll
  work.of course you then must make sure that 'thumbnails'
  is parsed as php.do this with a .htaccess file :
 
  Files thumbnails
  ForceType application/x-httpd-php
  /Files
 
  - Original Message -
  From: Andrew Brampton [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Sent: Sunday, June 02, 2002 1:20 PM
  Subject: Re: [PHP] Smart URLs
 
 
   You can do this with just PHP, but I think php must be installed as a
   module.
   Basically place a file called thumbnails.php in your site route, then
   whenever a URL like
   mysite.com/thumbnails/funny/4
   i called the thumbnails.php is excuted, in which you chop up the URL,
 and
   find all your varibles...
  
   Here is a example of some URL chopping (some code I stole from my
 source)
   /*
   Sample URLs:
   /s/1/2/SchoolName/StudentName/ -Shows Student Page (with ID 2)
   /s/1/0/SchoolName/-Shows Students At School (with school ID 1)
   /s/1/2/   -would work as well (name in URL for search engines)
   /s/1/0/   -would work as well
   /s/-Shows Schools
   */
  
   $url_array=explode(/,$REQUEST_URI);  //BREAK UP THE URL PATH
  //USING '/' as delimiter
   if ($url_array[1] == 's')
{
if (isSet($url_array[2]))
 $url_sID=$url_array[2];  //School ID
if (isSet($url_array[3]))
 $url_stID=$url_array[3];//Student ID
if (isSet($url_array[4]))
 $url_sName=$url_array[4];  //School Name (not used)
if (isSet($url_array[5]))
 $url_stName=$url_array[5];//Student Name (not used)
}
   /*
  
   There was a article on phpbuilder.com that explains the benefits and
   pitfalls of this idea... Here is the URL:
   http://www.phpbuilder.com/columns/tim19990117.php3 and I think there was
 a
   follow up article as well
  
   Enjoy
   Andrew
  
   - Original Message -
   From: Scott 'INtense!' Reismanis [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Sent: Monday, June 03, 2002 5:28 AM
   Subject: [PHP] Smart URLs
  
  
Hey all,
   
I was recently trying my luck at dabbling in some mod_rewrite
stuff, and I have run into numerious errors. Basically my aim is to
re-write my sites URLs so instead of being say,
mysite.com/thumbnails?type=funnygallery=4 the URL is neat, similar to
many sites who would have something like mysite.com/thumbnails/funny/4
   
What ways are there of achieving this (excluding, redirecting the URL
and creating the page say index.htm automatically)? I have tried
mod_rewrite for two days solid to no avail. I am not sure if it is my
poor coding or the fact that I am running apache2 on a Windows
 platform
which are said not to support such a module well. If any alternatives
could be proposed or even better someone could suggest a mod_rewrite
routine which would transparently transform any url like
mysite.com/whatever/4/6 to mysite.com/whatever.php it would be greatly
appreciated. So far the rewrite you see below will work with
mysite.com/whatever/ however the minute you add something onto the end
i.e. mysite.com/whatever/4/ it will raise the error Premature end of
script headers: php.exe, instead of loading whatever.php as intended.
   
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteRule ^/(.+)/(.+) $1.php [L]
   
Thanks for your time and hopefully someone understands what I am
 trying
to say :), and as always any suggestions at all would be awesome!
   
Regards,
   
   
   Scott 'INtense!' Reismanis
   Mod Database System Administrator
   [EMAIL PROTECTED]
   http://www.moddb.com/ - Every Game, Every Mod, One
Site... Go Figure!
   
   
   
   
--
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
  
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] PHP URLs not opening from email in Outlook XP

2002-05-31 Thread Leotta, Natalie (NCI/IMS)

I just tried to open the PHP link about the Navy.  I'm running IE6 (freshly
installed today, so no tweaks have been made) with Win2000.  When I clicked
on the link in the email, a locate link window came up (similar to an open
file window).  This does not happen on my coworker's machine.  The only
obvious difference between my computer and my coworker's computer is that
I'm running Office XP and he's got Office 2000, so we've got different
versions of Outlook.

We are currently redoing our website so that the URL has all of the unique
identifiers for each graph, so the whole point is to have people graph
something, copy it into an email, and send it to someone so they get the
same graph.

Does this happen to anyone else?  Is there something we can do to prevent it
from happening?

Thanks!

-Natalie

PS Here's the link that was sent, if you want to try it:

http://www.zend.com/zend/cs/csnavalready.php

Natalie S. Leotta
Information Management Services, Inc.
(301) 680-9770
[EMAIL PROTECTED] 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] PHP URLs not opening from email in Outlook XP

2002-05-31 Thread Jaime Bozza

Natalie,
   I'm using Outlook XP here and the link opens just fine.  The only
time I get that locate link browser window is if I hold the shift-key
down when clicking on the link.  (I typically link to open links in new
windows, so I hold the shift-key when clicking links - It will open the
link in a new browser window.)

   If you weren't hitting the shift-key, it could be possible that one
of your shift-keys are stuck, which is emulating the shift-click.  Not
much more I can tell you other than that, since the link (and all
others) work just fine for me in Outlook XP.


Jaime Bozza


-Original Message-
From: Leotta, Natalie (NCI/IMS) [mailto:[EMAIL PROTECTED]] 
Sent: Friday, May 31, 2002 12:16 PM
To: [EMAIL PROTECTED]
Cc: Jeans, Matt (NCI/IMS); Cucinelli, James (NCI/IMS)
Subject: [PHP] PHP URLs not opening from email in Outlook XP


I just tried to open the PHP link about the Navy.  I'm running IE6
(freshly
installed today, so no tweaks have been made) with Win2000.  When I
clicked
on the link in the email, a locate link window came up (similar to an
open
file window).  This does not happen on my coworker's machine.  The only
obvious difference between my computer and my coworker's computer is
that
I'm running Office XP and he's got Office 2000, so we've got different
versions of Outlook.

We are currently redoing our website so that the URL has all of the
unique
identifiers for each graph, so the whole point is to have people graph
something, copy it into an email, and send it to someone so they get the
same graph.

Does this happen to anyone else?  Is there something we can do to
prevent it
from happening?

Thanks!

-Natalie

PS Here's the link that was sent, if you want to try it:

http://www.zend.com/zend/cs/csnavalready.php

Natalie S. Leotta
Information Management Services, Inc.
(301) 680-9770
[EMAIL PROTECTED] 

-- 
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




RE: [PHP] PHP URLs not opening from email in Outlook XP

2002-05-31 Thread Leotta, Natalie (NCI/IMS)

My shift key isn't stuck.  I don't know what's wrong.  I found out that one
other person had a problem with it at my company and apparently one of the
techies put it on MS's technet group.  Hopefully something will come of it.


Thanks for your help!

-Natalie

-Original Message-
From: Jaime Bozza [mailto:[EMAIL PROTECTED]] 
Sent: Friday, May 31, 2002 1:49 PM
To: Leotta, Natalie (NCI/IMS)
Cc: Jeans, Matt (NCI/IMS); Cucinelli, James (NCI/IMS);
[EMAIL PROTECTED]
Subject: RE: [PHP] PHP URLs not opening from email in Outlook XP


Natalie,
   I'm using Outlook XP here and the link opens just fine.  The only time I
get that locate link browser window is if I hold the shift-key down when
clicking on the link.  (I typically link to open links in new windows, so I
hold the shift-key when clicking links - It will open the link in a new
browser window.)

   If you weren't hitting the shift-key, it could be possible that one of
your shift-keys are stuck, which is emulating the shift-click.  Not much
more I can tell you other than that, since the link (and all
others) work just fine for me in Outlook XP.


Jaime Bozza


-Original Message-
From: Leotta, Natalie (NCI/IMS) [mailto:[EMAIL PROTECTED]] 
Sent: Friday, May 31, 2002 12:16 PM
To: [EMAIL PROTECTED]
Cc: Jeans, Matt (NCI/IMS); Cucinelli, James (NCI/IMS)
Subject: [PHP] PHP URLs not opening from email in Outlook XP


I just tried to open the PHP link about the Navy.  I'm running IE6 (freshly
installed today, so no tweaks have been made) with Win2000.  When I clicked
on the link in the email, a locate link window came up (similar to an open
file window).  This does not happen on my coworker's machine.  The only
obvious difference between my computer and my coworker's computer is that
I'm running Office XP and he's got Office 2000, so we've got different
versions of Outlook.

We are currently redoing our website so that the URL has all of the unique
identifiers for each graph, so the whole point is to have people graph
something, copy it into an email, and send it to someone so they get the
same graph.

Does this happen to anyone else?  Is there something we can do to prevent it
from happening?

Thanks!

-Natalie

PS Here's the link that was sent, if you want to try it:

http://www.zend.com/zend/cs/csnavalready.php

Natalie S. Leotta
Information Management Services, Inc.
(301) 680-9770
[EMAIL PROTECTED] 

-- 
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




[PHP] RE: SOLVED: [PHP] PHP URLs not opening from email in Outlook XP

2002-05-31 Thread Leotta, Natalie (NCI/IMS)

For anyone who was having this problem, here's the solution.  It's a
windows-level bug.  Even HTML files weren't opening.

In Windows Explorer, go to either View/Tools (depending on version) and get
to Folder Options.  Go into File Types, and change the URL:HTTP (spelled
out) to have open and point it to your browser of choice.  Not something
you want to put on your website for John Q. Public, but ok for advanced
users.

thanks for the help!

-Natalie

-Original Message-
From: Leotta, Natalie (NCI/IMS) 
Sent: Friday, May 31, 2002 1:52 PM
To: 'Jaime Bozza'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] PHP URLs not opening from email in Outlook XP


My shift key isn't stuck.  I don't know what's wrong.  I found out that one
other person had a problem with it at my company and apparently one of the
techies put it on MS's technet group.  Hopefully something will come of it.


Thanks for your help!

-Natalie

-Original Message-
From: Jaime Bozza [mailto:[EMAIL PROTECTED]] 
Sent: Friday, May 31, 2002 1:49 PM
To: Leotta, Natalie (NCI/IMS)
Cc: Jeans, Matt (NCI/IMS); Cucinelli, James (NCI/IMS);
[EMAIL PROTECTED]
Subject: RE: [PHP] PHP URLs not opening from email in Outlook XP


Natalie,
   I'm using Outlook XP here and the link opens just fine.  The only time I
get that locate link browser window is if I hold the shift-key down when
clicking on the link.  (I typically link to open links in new windows, so I
hold the shift-key when clicking links - It will open the link in a new
browser window.)

   If you weren't hitting the shift-key, it could be possible that one of
your shift-keys are stuck, which is emulating the shift-click.  Not much
more I can tell you other than that, since the link (and all
others) work just fine for me in Outlook XP.


Jaime Bozza


-Original Message-
From: Leotta, Natalie (NCI/IMS) [mailto:[EMAIL PROTECTED]] 
Sent: Friday, May 31, 2002 12:16 PM
To: [EMAIL PROTECTED]
Cc: Jeans, Matt (NCI/IMS); Cucinelli, James (NCI/IMS)
Subject: [PHP] PHP URLs not opening from email in Outlook XP


I just tried to open the PHP link about the Navy.  I'm running IE6 (freshly
installed today, so no tweaks have been made) with Win2000.  When I clicked
on the link in the email, a locate link window came up (similar to an open
file window).  This does not happen on my coworker's machine.  The only
obvious difference between my computer and my coworker's computer is that
I'm running Office XP and he's got Office 2000, so we've got different
versions of Outlook.

We are currently redoing our website so that the URL has all of the unique
identifiers for each graph, so the whole point is to have people graph
something, copy it into an email, and send it to someone so they get the
same graph.

Does this happen to anyone else?  Is there something we can do to prevent it
from happening?

Thanks!

-Natalie

PS Here's the link that was sent, if you want to try it:

http://www.zend.com/zend/cs/csnavalready.php

Natalie S. Leotta
Information Management Services, Inc.
(301) 680-9770
[EMAIL PROTECTED] 

-- 
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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] posted urls

2001-09-14 Thread Lawrence . Sheed

ereg_replace or str_replace perhaps?

eg

$something= this is a sentence;

$something =  ereg_replace ( ,+, $something);

print $something;

-Original Message-
From: Egon Schmid [mailto:[EMAIL PROTECTED]]
Sent: September 14, 2001 2:20 PM
To: Alexander Skwar
Cc: murat; [EMAIL PROTECTED]
Subject: Re: [PHP] posted urls


Alexander Skwar wrote:
 
 So sprach »murat« am 2001-09-13 um 14:34:31 +0300 :
  how can i change variables that has two or more words to variables that
   has + instead of blanks in that variables.
  Like this: word1 word2 word3  = word1+word2+word3
 
 $word1 . $word2 . $word3
 
 Read the manual!

Alexander, please don't try to educate people with a RTFM. Your solution
to the above problem is obviously wrong.

-Egon

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] posted urls

2001-09-14 Thread Sterling Hughes

On Fri, 14 Sep 2001 [EMAIL PROTECTED] wrote:

 ereg_replace or str_replace perhaps?

 eg

 $something= this is a sentence;

 $something =  ereg_replace ( ,+, $something);

 print $something;


That'll work, although str_replace is faster and better...

fyi, if you want to encode a string for a URL, use the urlencode()
function.

-Sterling

 -Original Message-
 From: Egon Schmid [mailto:[EMAIL PROTECTED]]
 Sent: September 14, 2001 2:20 PM
 To: Alexander Skwar
 Cc: murat; [EMAIL PROTECTED]
 Subject: Re: [PHP] posted urls


 Alexander Skwar wrote:
 
  So sprach »murat« am 2001-09-13 um 14:34:31 +0300 :
   how can i change variables that has two or more words to variables that
has + instead of blanks in that variables.
   Like this: word1 word2 word3  = word1+word2+word3
 
  $word1 . $word2 . $word3
 
  Read the manual!

 Alexander, please don't try to educate people with a RTFM. Your solution
 to the above problem is obviously wrong.

 -Egon




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] posted urls

2001-09-14 Thread Alexander Skwar

So sprach »Egon Schmid« am 2001-09-14 um 08:20:11 +0200 :
 Alexander, please don't try to educate people with a RTFM. Your solution
 to the above problem is obviously wrong.

Yes, that's right.  I misunderstood the question, sorry about that.

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 1 day 4 hours 46 minutes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] posted urls

2001-09-13 Thread murat

hi,
how can i change variables that has two or more words to variables that 
  has + instead of blanks in that variables.
Like this: word1 word2 word3  = word1+word2+word3

thanks


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] posted urls

2001-09-13 Thread Jason Brooke

 hi,
 how can i change variables that has two or more words to variables that 
   has + instead of blanks in that variables.
 Like this: word1 word2 word3  = word1+word2+word3
 
 thanks

http://www.php.net/manual/en/ref.url.php 

jason 




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] posted urls

2001-09-13 Thread nayco

$var=urlencode($var);

may solve your problem.


(°-Nayco,
//\[EMAIL PROTECTED]
v_/_ http://nayco.free.fr


- Original Message -
From: murat [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, September 13, 2001 1:34 PM
Subject: [PHP] posted urls


 hi,
 how can i change variables that has two or more words to variables that
   has + instead of blanks in that variables.
 Like this: word1 word2 word3  = word1+word2+word3

 thanks


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] posted urls

2001-09-13 Thread Alexander Skwar

So sprach »murat« am 2001-09-13 um 14:34:31 +0300 :
 how can i change variables that has two or more words to variables that 
  has + instead of blanks in that variables.
 Like this: word1 word2 word3  = word1+word2+word3

$word1 . $word2 . $word3

Read the manual!

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 1 day 0 hours 0 minutes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] posted urls

2001-09-13 Thread David Robley

On Fri, 14 Sep 2001 15:07, Alexander Skwar wrote:
 So sprach »murat« am 2001-09-13 um 14:34:31 +0300 :
  how can i change variables that has two or more words to variables
  that has + instead of blanks in that variables.
  Like this: word1 word2 word3  = word1+word2+word3

 $word1 . $word2 . $word3

 Read the manual!

 Alexander Skwar

Tsk Alexander, read the question :-) Urlencode is most likely what is 
needed.

-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   My bid for this contract aims to please, said Tom tenderly.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] posted urls

2001-09-13 Thread Egon Schmid

Alexander Skwar wrote:
 
 So sprach »murat« am 2001-09-13 um 14:34:31 +0300 :
  how can i change variables that has two or more words to variables that
   has + instead of blanks in that variables.
  Like this: word1 word2 word3  = word1+word2+word3
 
 $word1 . $word2 . $word3
 
 Read the manual!

Alexander, please don't try to educate people with a RTFM. Your solution
to the above problem is obviously wrong.

-Egon

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Changing urls

2001-03-07 Thread Todd Heim

Trying to make a script that gets another and resends it.

Begin proxy.php
?php

$scriptpath = "http://".getenv(SERVER_NAME).getenv(SCRIPT_NAME);


   // Log the request
$fp = fopen("/www/htdocs/heim/test/heim/test/log.txt", "a");
if ($fp){
fputs($fp, "$REMOTE_ADDR - GET $url\n");
fclose($fp);
}

if ((substr($url, 0, 7) == "http://")  (substr_count($url, "http://") ==
1)){


$pagedata = implode("", file($url));


//try to make absolute links go through the proxy script

$pagedata = str_replace("href=\"http://", "href=" $scriptpath "?url="$url,
$pagedata);


echo $pagedata;


}
else{
echo "something went wrong";
}

?


The script works great, as long as the line beginning $pagedata is commented
out. But, I would like to use that line to convert all absolute links in the
page to also go through the proxy.php

Also, any ideas of how to process relative links and make them into absolute
links?

Ex.  (lets say $scriptpath is http://www.host.com/proxy.php)

a href="about.html"  which is actually www.abc123.com/about.html

Becomes:

a 
href="http://www.host.com/proxy.php?url=http://www.abc123.com/about.html

Any help on converting these links would be very much appreciated


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Multiple URLs and cookies

2001-02-20 Thread Jeremy Gillies

How will that work with three URLs and frequent language switching?

Thanks,
jer

 You can't do setcookie and Location: in the same page.
 Once they picked a language, set the cookie and return the 
 HTML content for
 that home page, don't redirect.
 
 --
 Visit the Zend Store at http://www.zend.com/store/
 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: Jeremy Gillies [EMAIL PROTECTED]
 Newsgroups: php.general
 Sent: Monday, February 19, 2001 9:43 AM
 Subject: [PHP] Multiple URLs and cookies
 
 
  Hello all!
 
  Okay, still going at it with PHP vs. JavaScript -- although 
 one can remove
  the power if they disable cookies -- in fact, with the way 
 it is set up
  here, it is doubtful they will get to the right page if they switch
  languages, but i can work that out later with a simple 
 if-then statement
  that will create the link -- a test to see if cookies are 
 enabled then
 print
  the correct URL.
 
  1) Joe: I used the index (splash.php) and choice pages 
 (choice.php) as per
  your suggestion. It works without a hitch. The cookie is 
 set and it goes
  accordingly from the splash.php page once you have mad a selection.
 
  2) Angela: I have added a third page to this mix, a 
 lang_swap.php which is
  called from the document that people are looking at. So now 
 it goes from a
  language button on a doc, passes a document id to the 
 lang_swap.php page
  where a similar process tot he choice.php page takes place, sets the
 cookie
  value to the other language, and kicks it back to the 
 french version of
 the
  english document (and vice-versa). It's all pretty quick, so i'm not
 worried
  about the page requests and lag.
 
 
  The trouble is... the lang_swap.php will not set the cookie for the
 language
  change. If i swap to french and then i go back and load the 
 splash page,
 it
  send me to the english-front again, but it should send me to the
  french-front... i was having this problem before when i was 
 trying to get
  this all to work... once the variable was set, i could not get it to
 change.
 
  Thanks for your help and in advance of some more!
  Jer
  Canadian Union of Postal Workers
 
 
  --
  The splash.php is as follows:
  --
  ?php
if ((IsSet($lang)) || ($lang = "1") || ($lang = "2"))
  switch($lang)
{
  case 1:
header("Location: 
 http://www.english.com/english-front-page.php");
exit;
break;
  case 2:
header("Location: http://www.franch.com/french-front-page.php");
exit;
break;
}
  ?
  HTML
  .
  passes a value to choice.php... depending upon langauge select...
  .
  /HTML
 
  --
 
 
  --
  The choice.php is as follows:
  --
 
  ?PHP
 
  if(strlen($lang))
  {
switch($lang)
{
  case 1:
setcookie ("lang", "1", "http://www.english.com/", "", 0);
header("Location: http://www.english.com/english-front-page.php");
exit;
break;
  case 2:
setcookie ("lang", "2", "http://www.french.com/", "", 0);
header("Location: 
http://www.franch.com/french-front-page.php");
   exit;
   break;
   }
 }
 ?

 html
 head
 titleChoice/title
 /head
 body/body
 /html


 --


 --
 The lang_swap.php is as follows:
 -

 ?PHP
 if ((IsSet($lang)) || ($lang = "1") || ($lang = "2"))
 switch($lang)
   {
 /* here is the swap */
 case 1:
 setcookie ("lang", "2", "http://www.french.com/", "", 0);
   header("Location:
 http://www.french.com/document-fra.php?Doc_ID=$Ident");
   exit;
   break;
 case 2:
   setcookie ("lang", "1", "http://www.english.com/", "", 0);
   header("Location:
 http://www.english.com/document-eng.php?Doc_ID=$Ident");
   exit;
   break;
   }
 ?

 html
 head
 titleLang Swap/title
 /head
 body/body
 /html


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Multiple URLs and cookies

2001-02-20 Thread Richard Lynch

I don't know how it will work, or even if you can do whatever it is you are
trying to do.

I only know what won't work.  header("Location:")+setcookie() in one script
will not work on many browsers.

At a guess, I'd say you'll have to include() the file the user was
attempting to reach while switching languages rather than doing the
redirect.

Or, perhaps the content negotiationn will be sufficient. http://apache.org

Or, maybe you'll need to have a language-switching page after all.

--
Visit the Zend Store at http://www.zend.com/store/
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: Jeremy Gillies [EMAIL PROTECTED]
To: 'Richard Lynch' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, February 20, 2001 8:31 AM
Subject: RE: [PHP] Multiple URLs and cookies


 How will that work with three URLs and frequent language switching?

 Thanks,
 jer

  You can't do setcookie and Location: in the same page.
  Once they picked a language, set the cookie and return the
  HTML content for
  that home page, don't redirect.
 
  --
  Visit the Zend Store at http://www.zend.com/store/
  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: Jeremy Gillies [EMAIL PROTECTED]
  Newsgroups: php.general
  Sent: Monday, February 19, 2001 9:43 AM
  Subject: [PHP] Multiple URLs and cookies
 
 
   Hello all!
  
   Okay, still going at it with PHP vs. JavaScript -- although
  one can remove
   the power if they disable cookies -- in fact, with the way
  it is set up
   here, it is doubtful they will get to the right page if they switch
   languages, but i can work that out later with a simple
  if-then statement
   that will create the link -- a test to see if cookies are
  enabled then
  print
   the correct URL.
  
   1) Joe: I used the index (splash.php) and choice pages
  (choice.php) as per
   your suggestion. It works without a hitch. The cookie is
  set and it goes
   accordingly from the splash.php page once you have mad a selection.
  
   2) Angela: I have added a third page to this mix, a
  lang_swap.php which is
   called from the document that people are looking at. So now
  it goes from a
   language button on a doc, passes a document id to the
  lang_swap.php page
   where a similar process tot he choice.php page takes place, sets the
  cookie
   value to the other language, and kicks it back to the
  french version of
  the
   english document (and vice-versa). It's all pretty quick, so i'm not
  worried
   about the page requests and lag.
  
  
   The trouble is... the lang_swap.php will not set the cookie for the
  language
   change. If i swap to french and then i go back and load the
  splash page,
  it
   send me to the english-front again, but it should send me to the
   french-front... i was having this problem before when i was
  trying to get
   this all to work... once the variable was set, i could not get it to
  change.
  
   Thanks for your help and in advance of some more!
   Jer
   Canadian Union of Postal Workers
  
  
   --
   The splash.php is as follows:
   --
   ?php
 if ((IsSet($lang)) || ($lang = "1") || ($lang = "2"))
   switch($lang)
 {
   case 1:
 header("Location:
  http://www.english.com/english-front-page.php");
 exit;
 break;
   case 2:
 header("Location: http://www.franch.com/french-front-page.php");
 exit;
 break;
 }
   ?
   HTML
   .
   passes a value to choice.php... depending upon langauge select...
   .
   /HTML
  
   --
  
  
   --
   The choice.php is as follows:
   --
  
   ?PHP
  
   if(strlen($lang))
   {
 switch($lang)
 {
   case 1:
 setcookie ("lang", "1", "http://www.english.com/", "", 0);
 header("Location: http://www.english.com/english-front-page.php");
 exit;
 break;
   case 2:
 setcookie ("lang", "2", "http://www.french.com/", "", 0);
 header("Location:
 http://www.franch.com/french-front-page.php");
exit;
break;
}
  }
  ?
 
  html
  head
  titleChoice/title
  /head
  body/body
  /html
 
 
  --
 
 
  --
  The lang_swap.php is as follows:
  -
 
  ?PHP
  if ((IsSet($lang)) || ($lang = "1") || ($lang = "2"))
  switch($lang)
{
  /* here is the swap */
  case 1:
  setcookie ("lang", "2", "http://www.french.com/", "", 0);
head

[PHP] Multiple URLs and cookies

2001-02-19 Thread Jeremy Gillies

Hello all!

Okay, still going at it with PHP vs. JavaScript -- although one can remove
the power if they disable cookies -- in fact, with the way it is set up
here, it is doubtful they will get to the right page if they switch
languages, but i can work that out later with a simple if-then statement
that will create the link -- a test to see if cookies are enabled then print
the correct URL.

1) Joe: I used the index (splash.php) and choice pages (choice.php) as per
your suggestion. It works without a hitch. The cookie is set and it goes
accordingly from the splash.php page once you have mad a selection.

2) Angela: I have added a third page to this mix, a lang_swap.php which is
called from the document that people are looking at. So now it goes from a
language button on a doc, passes a document id to the lang_swap.php page
where a similar process tot he choice.php page takes place, sets the cookie
value to the other language, and kicks it back to the french version of the
english document (and vice-versa). It's all pretty quick, so i'm not worried
about the page requests and lag.


The trouble is... the lang_swap.php will not set the cookie for the language
change. If i swap to french and then i go back and load the splash page, it
send me to the english-front again, but it should send me to the
french-front... i was having this problem before when i was trying to get
this all to work... once the variable was set, i could not get it to change.

Thanks for your help and in advance of some more!
Jer
Canadian Union of Postal Workers


--
The splash.php is as follows:
--
?php
  if ((IsSet($lang)) || ($lang = "1") || ($lang = "2"))
switch($lang)
  {
case 1:
  header("Location: http://www.english.com/english-front-page.php");
  exit;
  break;
case 2:
  header("Location: http://www.franch.com/french-front-page.php");
  exit;
  break;
  }
?
HTML
.
passes a value to choice.php... depending upon langauge select...
.
/HTML

--


--
The choice.php is as follows:
--

?PHP

if(strlen($lang))
{
  switch($lang)
  {
case 1:
  setcookie ("lang", "1", "http://www.english.com/", "", 0);
  header("Location: http://www.english.com/english-front-page.php");
  exit;
  break;
case 2:
  setcookie ("lang", "2", "http://www.french.com/", "", 0);
  header("Location: http://www.franch.com/french-front-page.php");
  exit;
  break;
  }
}
?

html
head
titleChoice/title
/head
body/body
/html


--


--
The lang_swap.php is as follows:
-

?PHP
if ((IsSet($lang)) || ($lang = "1") || ($lang = "2"))
switch($lang)
  {
/* here is the swap */
case 1:
setcookie ("lang", "2", "http://www.french.com/", "", 0);
  header("Location:
http://www.french.com/document-fra.php?Doc_ID=$Ident");
  exit;
  break;
case 2:
  setcookie ("lang", "1", "http://www.english.com/", "", 0);
  header("Location:
http://www.english.com/document-eng.php?Doc_ID=$Ident");
  exit;
  break;
  }
?

html
head
titleLang Swap/title
/head
body/body
/html


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Multiple URLs and cookies

2001-02-19 Thread Richard Lynch

You can't do setcookie and Location: in the same page.
Once they picked a language, set the cookie and return the HTML content for
that home page, don't redirect.

--
Visit the Zend Store at http://www.zend.com/store/
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: Jeremy Gillies [EMAIL PROTECTED]
Newsgroups: php.general
Sent: Monday, February 19, 2001 9:43 AM
Subject: [PHP] Multiple URLs and cookies


 Hello all!

 Okay, still going at it with PHP vs. JavaScript -- although one can remove
 the power if they disable cookies -- in fact, with the way it is set up
 here, it is doubtful they will get to the right page if they switch
 languages, but i can work that out later with a simple if-then statement
 that will create the link -- a test to see if cookies are enabled then
print
 the correct URL.

 1) Joe: I used the index (splash.php) and choice pages (choice.php) as per
 your suggestion. It works without a hitch. The cookie is set and it goes
 accordingly from the splash.php page once you have mad a selection.

 2) Angela: I have added a third page to this mix, a lang_swap.php which is
 called from the document that people are looking at. So now it goes from a
 language button on a doc, passes a document id to the lang_swap.php page
 where a similar process tot he choice.php page takes place, sets the
cookie
 value to the other language, and kicks it back to the french version of
the
 english document (and vice-versa). It's all pretty quick, so i'm not
worried
 about the page requests and lag.


 The trouble is... the lang_swap.php will not set the cookie for the
language
 change. If i swap to french and then i go back and load the splash page,
it
 send me to the english-front again, but it should send me to the
 french-front... i was having this problem before when i was trying to get
 this all to work... once the variable was set, i could not get it to
change.

 Thanks for your help and in advance of some more!
 Jer
 Canadian Union of Postal Workers


 --
 The splash.php is as follows:
 --
 ?php
   if ((IsSet($lang)) || ($lang = "1") || ($lang = "2"))
 switch($lang)
   {
 case 1:
   header("Location: http://www.english.com/english-front-page.php");
   exit;
   break;
 case 2:
   header("Location: http://www.franch.com/french-front-page.php");
   exit;
   break;
   }
 ?
 HTML
 .
 passes a value to choice.php... depending upon langauge select...
 .
 /HTML

 --


 --
 The choice.php is as follows:
 --

 ?PHP

 if(strlen($lang))
 {
   switch($lang)
   {
 case 1:
   setcookie ("lang", "1", "http://www.english.com/", "", 0);
   header("Location: http://www.english.com/english-front-page.php");
   exit;
   break;
 case 2:
   setcookie ("lang", "2", "http://www.french.com/", "", 0);
   header("Location: http://www.franch.com/french-front-page.php");
   exit;
   break;
   }
 }
 ?

 html
 head
 titleChoice/title
 /head
 body/body
 /html


 --


 --
 The lang_swap.php is as follows:
 -

 ?PHP
 if ((IsSet($lang)) || ($lang = "1") || ($lang = "2"))
 switch($lang)
   {
 /* here is the swap */
 case 1:
 setcookie ("lang", "2", "http://www.french.com/", "", 0);
   header("Location:
 http://www.french.com/document-fra.php?Doc_ID=$Ident");
   exit;
   break;
 case 2:
   setcookie ("lang", "1", "http://www.english.com/", "", 0);
   header("Location:
 http://www.english.com/document-eng.php?Doc_ID=$Ident");
   exit;
   break;
   }
 ?

 html
 head
 titleLang Swap/title
 /head
 body/body
 /html


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]