Re: [PHP] URL Rewriting

2013-06-02 Thread Daniel Brown
Studying archaeology now, Tam?  ;-P


On Sat, Jun 1, 2013 at 8:22 PM, Tamara Temple tamouse.li...@gmail.com wrote:
 Silvio Siefke li...@silvio-siefke.de wrote:
 On Wed, 22 Jun 2011 17:50:49 -0400 Daniel P. Brown wrote:
   Has someone a Link with Tutorials or other Information?
 
  Not entirely sure what you're asking here, or how you (or the
  nginx folks) expect it to relate to PHP.  Do you mean that you want to
  use PHP to have theme2.php act as if it was called as theme.php?id=2 ?

 I have me write a blog, but my blog has link like blogdetail.html?id=1 or =2
 through 16 at moment. And for google and other Search  Engines not good the
 links, better where i can rewrite to a fix link, and when someone use the
 link, php write to correct url.

 Common SEO mythology is that you need pretty human-understandable
 links. (In point of fact, the search engines care not in the least.)
 However, human-understandable URLs are a benefit to users when they want
 to understand what they're linking to or clicking on.

 A human-understandable link is more like:

 http://www.example.com/blog/2013-05-a-day-in-the-life-of-my-dog

 not:

 http://www.example.com/blog/2

 as that really does not provide any more information than:

 http://www.example.com/blog.php?id=2

 Otherwise, Daniel's solution below should do the trick.

 Sorry my english not perfect on earth.


  If so, it's not redirect or rewrite, and it's extremely hacky, but
  this is the only real way PHP could achieve the desired result:
 
  ?php
  // dynamictheme.php
 
  if (preg_match('/.*([0-9]+)\.php/Ui',$_SERVER['PHP_SELF'],$match)) {
$_GET['id'] = $match[1];
include dirname(__FILE__).'/theme.php';
  }
 
  ?
 
  Then just symlink dynamictheme.php to your various themes like so:
 
  ln -s dynamictheme.php theme2.php
  ln -s dynamictheme.php theme301.php
  ln -s dynamictheme.php theme18447.php
 







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




--
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

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



Re: [PHP] URL Rewriting

2013-06-02 Thread Tamara Temple
Daniel Brown danbr...@php.net wrote:
 Studying archaeology now, Tam?  ;-P

Always been a huge fan. :)



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



Re: [PHP] URL Rewriting

2013-06-01 Thread Tamara Temple
Silvio Siefke li...@silvio-siefke.de wrote:
 On Wed, 22 Jun 2011 17:50:49 -0400 Daniel P. Brown wrote:
   Has someone a Link with Tutorials or other Information?
  
  Not entirely sure what you're asking here, or how you (or the
  nginx folks) expect it to relate to PHP.  Do you mean that you want to
  use PHP to have theme2.php act as if it was called as theme.php?id=2 ?
 
 I have me write a blog, but my blog has link like blogdetail.html?id=1 or =2
 through 16 at moment. And for google and other Search  Engines not good the
 links, better where i can rewrite to a fix link, and when someone use the
 link, php write to correct url. 

Common SEO mythology is that you need pretty human-understandable
links. (In point of fact, the search engines care not in the least.)
However, human-understandable URLs are a benefit to users when they want
to understand what they're linking to or clicking on.

A human-understandable link is more like:

http://www.example.com/blog/2013-05-a-day-in-the-life-of-my-dog

not:

http://www.example.com/blog/2

as that really does not provide any more information than:

http://www.example.com/blog.php?id=2

Otherwise, Daniel's solution below should do the trick.

 Sorry my english not perfect on earth. 
 
  
  If so, it's not redirect or rewrite, and it's extremely hacky, but
  this is the only real way PHP could achieve the desired result:
  
  ?php
  // dynamictheme.php
  
  if (preg_match('/.*([0-9]+)\.php/Ui',$_SERVER['PHP_SELF'],$match)) {
$_GET['id'] = $match[1];
include dirname(__FILE__).'/theme.php';
  }
  
  ?
  
  Then just symlink dynamictheme.php to your various themes like so:
  
  ln -s dynamictheme.php theme2.php
  ln -s dynamictheme.php theme301.php
  ln -s dynamictheme.php theme18447.php
  







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



Re: [PHP] url string being split

2012-04-27 Thread Chris Stinemetz
On Thu, Apr 26, 2012 at 12:58 PM, Stuart Dallas stu...@3ft9.com wrote:
 On 26 Apr 2012, at 18:37, Jim Giner wrote:

 Im no expert, but why would you expose a query to the world thru the use of
 a GET?  Why not just collect the params and build the string in your code?
 That is how people hack into your database - via a re-formed query.  You're
 giving someone an open invitation.

 A query string has nothing to do with databases.

 -Stuart


I still haven't been able to find a solution. Is there anyone out
there that knows how to keep the query string intact?

Thank you,

Chris

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



Re: [PHP] url string being split

2012-04-27 Thread Shawn McKenzie
On 04/27/2012 10:56 AM, Chris Stinemetz wrote:
 I still haven't been able to find a solution. Is there anyone out
 there that knows how to keep the query string intact?
 
 Thank you,
 
 Chris

urlencode($storerow['store_subject'])

-- 
Thanks!
-Shawn
http://www.spidean.com

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



Re: [PHP] url string being split

2012-04-27 Thread Tim Streater
On 27 Apr 2012 at 16:56, Chris Stinemetz chrisstinem...@gmail.com wrote: 

 On Thu, Apr 26, 2012 at 12:58 PM, Stuart Dallas stu...@3ft9.com wrote:
 On 26 Apr 2012, at 18:37, Jim Giner wrote:

 Im no expert, but why would you expose a query to the world thru the use of
 a GET?  Why not just collect the params and build the string in your code?
 That is how people hack into your database - via a re-formed query.  You're
 giving someone an open invitation.

 A query string has nothing to do with databases.

 I still haven't been able to find a solution. Is there anyone out
 there that knows how to keep the query string intact?

As was posted previously, you need to encode the query string. If you have:

   http://westeng/forum/store.php?id=Wiser Communication, LLC - - Sprague Ave

that is going to be split in two unless you encode the Wiser Communication, 
LLC - - Sprague Ave portion. I would do that with JavaScript on the html page.

This is not a PHP question.

--
Cheers  --  Tim

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

Re: [PHP] url string being split

2012-04-27 Thread Chris Stinemetz
On Fri, Apr 27, 2012 at 11:09 AM, Shawn McKenzie nos...@mckenzies.net wrote:
 On 04/27/2012 10:56 AM, Chris Stinemetz wrote:
 I still haven't been able to find a solution. Is there anyone out
 there that knows how to keep the query string intact?

 Thank you,

 Chris

 urlencode($storerow['store_subject'])

 --
 Thanks!
 -Shawn
 http://www.spidean.com

Thank you. That is what I was looking for.

-Chris

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



[PHP] url string being split

2012-04-26 Thread Chris Stinemetz
Hello list,

I'm trying to pass a query string through $_GET but for some reason
the array is being split on ''. How may I avoid this so it stays
intacted?

user selection portion:

while($storerow = mysql_fetch_assoc($storesresult))
echo 'h4a href=store.php?id=' . $storerow['store_subject'] . ''
. $storerow['store_subject'] . '/a/h4 at ' . date('m-d-Y h:i:s A',
strtotime($storerow['real_time_date']));

produces url string:

http://westeng/forum/store.php?id=Wiser Communication, LLC - - Sprague Ave


print(pre.print_r($_GET,true)./pre); ## results below

Array
(
[id] = Wiser Communication, LLC -
[-_Sprague_Ave] =
)

How do I make it so the string isn't split into two elements in the
array? I want it to stay instact.

Thank you,

Chris

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



Re: [PHP] url string being split

2012-04-26 Thread Vikash Kumar
On 26 April 2012 22:27, Chris Stinemetz chrisstinem...@gmail.com wrote:

 Hello list,

 I'm trying to pass a query string through $_GET but for some reason
 the array is being split on ''. How may I avoid this so it stays
 intacted?

 user selection portion:

 while($storerow = mysql_fetch_assoc($storesresult))
 echo 'h4a href=store.php?id=' . $storerow['store_subject'] . ''
 . $storerow['store_subject'] . '/a/h4 at ' . date('m-d-Y h:i:s A',
 strtotime($storerow['real_time_date']));

 produces url string:

 http://westeng/forum/store.php?id=Wiser Communication, LLC - - Sprague
 Ave


 print(pre.print_r($_GET,true)./pre); ## results below

 Array
 (
[id] = Wiser Communication, LLC -
[-_Sprague_Ave] =
 )

 How do I make it so the string isn't split into two elements in the
 array? I want it to stay instact.


You should urlencode the query parameter.



 Thank you,

 Chris

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




Re: [PHP] url string being split

2012-04-26 Thread Jim Giner
Im no expert, but why would you expose a query to the world thru the use of 
a GET?  Why not just collect the params and build the string in your code? 
That is how people hack into your database - via a re-formed query.  You're 
giving someone an open invitation. 



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



Re: [PHP] url string being split

2012-04-26 Thread Stuart Dallas
On 26 Apr 2012, at 18:37, Jim Giner wrote:

 Im no expert, but why would you expose a query to the world thru the use of 
 a GET?  Why not just collect the params and build the string in your code? 
 That is how people hack into your database - via a re-formed query.  You're 
 giving someone an open invitation. 

A query string has nothing to do with databases.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/

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



Re: [PHP] URL Rewriting

2011-06-23 Thread Ashley Sheridan


Silvio Siefke li...@silvio-siefke.de wrote:

On Wed, 22 Jun 2011 17:50:49 -0400 Daniel P. Brown wrote:
  Has someone a Link with Tutorials or other Information?

 Not entirely sure what you're asking here, or how you (or the
 nginx folks) expect it to relate to PHP.  Do you mean that you want
to
 use PHP to have theme2.php act as if it was called as theme.php?id=2
?

I have me write a blog, but my blog has link like blogdetail.html?id=1
or =2
through 16 at moment. And for google and other Search  Engines not good
the
links, better where i can rewrite to a fix link, and when someone use
the
link, php write to correct url.

Sorry my english not perfect on earth.

I've not yet seen any evidence yet that pretty URLs actually benefit SEO. I 
regularly search for answers to problems online, and mostly I get forums as the 
results, all of which have URLs like showthread.php?t=1234567

I see that url rewriting is always suggested on SEO checklists, but with no 
evidence. The best evidence I could find was out of date by about a decade, so 
not that useful here and today.

Thanks,
Ash
http://www.ashleysheridan.co.uk
--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

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



[PHP] URL Rewriting

2011-06-22 Thread Silvio Siefke
Hello, 

is there a chance with php to use rewriting?

Like Example:

mysite.com/theme.php?id=1 to theme.php theme2.php etc. 

I have ask on the nginx list, but there they say i should use the power
language php. 

When i search in google for Examples or Tutorials i only found mod_rewriting. 


Has someone a Link with Tutorials or other Information?

Thank you.

Nice Day.

Silvio

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



Re: [PHP] URL Rewriting

2011-06-22 Thread Fatih P.
try

RewriteEngine on
RewriteRule ^theme([0-9]+).php$  /index.php?theme=$1 [L]






On Wed, Jun 22, 2011 at 11:22 PM, Silvio Siefke li...@silvio-siefke.dewrote:

 Hello,

 is there a chance with php to use rewriting?

 Like Example:

 mysite.com/theme.php?id=1 to theme.php theme2.php etc.

 I have ask on the nginx list, but there they say i should use the power
 language php.

 When i search in google for Examples or Tutorials i only found
 mod_rewriting.


 Has someone a Link with Tutorials or other Information?

 Thank you.

 Nice Day.

 Silvio

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




Re: [PHP] URL Rewriting

2011-06-22 Thread Daniel Brown
On Wed, Jun 22, 2011 at 17:32, Fatih P. fatihpirist...@gmail.com wrote:
 try

 RewriteEngine on
 RewriteRule ^theme([0-9]+).php$  /index.php?theme=$1 [L]

That's neither nginx nor PHP, so it's not really relevant to the
OP's questions.

-- 
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

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



Re: [PHP] URL Rewriting

2011-06-22 Thread Daniel P. Brown
On Wed, Jun 22, 2011 at 17:22, Silvio Siefke li...@silvio-siefke.de wrote:
 Hello,

 is there a chance with php to use rewriting?

 Like Example:

 mysite.com/theme.php?id=1 to theme.php theme2.php etc.

 I have ask on the nginx list, but there they say i should use the power
 language php.

 When i search in google for Examples or Tutorials i only found mod_rewriting.


 Has someone a Link with Tutorials or other Information?

Not entirely sure what you're asking here, or how you (or the
nginx folks) expect it to relate to PHP.  Do you mean that you want to
use PHP to have theme2.php act as if it was called as theme.php?id=2 ?

If so, it's not redirect or rewrite, and it's extremely hacky, but
this is the only real way PHP could achieve the desired result:

?php
// dynamictheme.php

if (preg_match('/.*([0-9]+)\.php/Ui',$_SERVER['PHP_SELF'],$match)) {
  $_GET['id'] = $match[1];
  include dirname(__FILE__).'/theme.php';
}

?

Then just symlink dynamictheme.php to your various themes like so:

ln -s dynamictheme.php theme2.php
ln -s dynamictheme.php theme301.php
ln -s dynamictheme.php theme18447.php

-- 
/Daniel P. Brown
Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/

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



Re: [PHP] URL Rewriting

2011-06-22 Thread Silvio Siefke
On Wed, 22 Jun 2011 17:50:49 -0400 Daniel P. Brown wrote:
  Has someone a Link with Tutorials or other Information?
 
 Not entirely sure what you're asking here, or how you (or the
 nginx folks) expect it to relate to PHP.  Do you mean that you want to
 use PHP to have theme2.php act as if it was called as theme.php?id=2 ?

I have me write a blog, but my blog has link like blogdetail.html?id=1 or =2
through 16 at moment. And for google and other Search  Engines not good the
links, better where i can rewrite to a fix link, and when someone use the
link, php write to correct url. 

Sorry my english not perfect on earth. 

 
 If so, it's not redirect or rewrite, and it's extremely hacky, but
 this is the only real way PHP could achieve the desired result:
 
 ?php
 // dynamictheme.php
 
 if (preg_match('/.*([0-9]+)\.php/Ui',$_SERVER['PHP_SELF'],$match)) {
   $_GET['id'] = $match[1];
   include dirname(__FILE__).'/theme.php';
 }
 
 ?
 
 Then just symlink dynamictheme.php to your various themes like so:
 
 ln -s dynamictheme.php theme2.php
 ln -s dynamictheme.php theme301.php
 ln -s dynamictheme.php theme18447.php
 


Regards 
Silvio

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



Re: [PHP] URL Rewriting

2011-06-22 Thread Silvio Siefke
On Wed, 22 Jun 2011 23:32:10 +0200 Fatih P. wrote:
 try
 
 RewriteEngine on
 RewriteRule ^theme([0-9]+).php$  /index.php?theme=$1 [L]

That is rule for Apache i think. I have nginx, and there i have try much
rules but nothing want work. And on the list from nginx the maintainer write,
i should use the power language php. 


Regards
Silvio

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



Re: [PHP] URL injection

2009-06-10 Thread Simon
 https://www.xxx.co.uk/register.php;| grep 123

I wonder what kind of browser could make this, probably a hacker-made one!

This URL will have to be translated into its equivalent URI, if using
GET the HTTP message's start line would look like:

GET /register.php| grep 123 HTTP/1.1

First of all, the HTTP protocol states that the start line should contain:
METHOD one or more spaces URI one or more spaces HTTP/1.1
So, this is clearly violated as there are two spaces surrounding grep,
i believe if the server has trouble with this request, it's not yet at
the PHP level... it's an HTTP issue, clearly server related.  You wont
detect this with PHP, and if you do detect anything, it means your
server has modified it so you could...  for example, in this case it
might convert the whole | grep 123 into a single get argument's
name, it could be simply removed/ignored, the server could try to see
if there is a file named `/register.php| grep 123` and returns a
404... but the only acceptable behavior in this case is for the server
to return 400  (read
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1).

Good luck!

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



[PHP] URL injection

2009-06-04 Thread Morris
Hi

Can anyone help me handel this URL injection ?

https://www.xxx.co.uk/register.php;| grep 123

I want to detect it and header back to my index page.

It's quite urgent

Thanks for help

M.


Re: [PHP] URL injection

2009-06-04 Thread Stuart
2009/6/4 Morris morris...@gmail.com:
 Hi

 Can anyone help me handel this URL injection ?

 https://www.xxx.co.uk/register.php;| grep 123

 I want to detect it and header back to my index page.

 It's quite urgent

What the smeg is register.php doing that makes it execute that?? Show
us the code.

-Stuart

-- 
http://stut.net/

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



Re: [PHP] URL injection

2009-06-04 Thread Morris
Hi

The register.php has only a form

?php
form name=registerUser action=register.php method=post
input type=text name=username size=10 /
input type=submit value=send /
/form
?

Does this help ?

Thanks for reply


2009/6/4 Stuart stut...@gmail.com

 2009/6/4 Morris morris...@gmail.com:
  Hi
 
  Can anyone help me handel this URL injection ?
 
  https://www.xxx.co.uk/register.php;| grep 123
 
  I want to detect it and header back to my index page.
 
  It's quite urgent

 What the smeg is register.php doing that makes it execute that?? Show
 us the code.

 -Stuart

 --
 http://stut.net/



Re: [PHP] URL injection

2009-06-04 Thread Stuart
2009/6/4 Morris morris...@gmail.com:
 Hi

 The register.php has only a form

 ?php
 form name=registerUser action=register.php method=post
 input type=text name=username size=10 /
 input type=submit value=send /
 /form
 ?

 Does this help ?

1) That is not valid PHP code.

2) Even if it were there's nothing in there that would be exploitable
through the URL you sent in your first email.

-Stuart

-- 
http://stut.net/

 2009/6/4 Stuart stut...@gmail.com

 2009/6/4 Morris morris...@gmail.com:
  Hi
 
  Can anyone help me handel this URL injection ?
 
  https://www.xxx.co.uk/register.php;| grep 123
 
  I want to detect it and header back to my index page.
 
  It's quite urgent

 What the smeg is register.php doing that makes it execute that?? Show
 us the code.

 -Stuart

 --
 http://stut.net/



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



Re: [PHP] URL injection

2009-06-04 Thread Matty Sarro
Is there more to the register.php file that we're not seeing? It has to have
some sort of action...

On Thu, Jun 4, 2009 at 3:28 PM, Stuart stut...@gmail.com wrote:

 2009/6/4 Morris morris...@gmail.com:
  Hi
 
  The register.php has only a form
 
  ?php
  form name=registerUser action=register.php method=post
  input type=text name=username size=10 /
  input type=submit value=send /
  /form
  ?
 
  Does this help ?

 1) That is not valid PHP code.

 2) Even if it were there's nothing in there that would be exploitable
 through the URL you sent in your first email.

 -Stuart

 --
 http://stut.net/

  2009/6/4 Stuart stut...@gmail.com
 
  2009/6/4 Morris morris...@gmail.com:
   Hi
  
   Can anyone help me handel this URL injection ?
  
   https://www.xxx.co.uk/register.php;| grep 123
  
   I want to detect it and header back to my index page.
  
   It's quite urgent
 
  What the smeg is register.php doing that makes it execute that?? Show
  us the code.
 
  -Stuart
 
  --
  http://stut.net/
 
 

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




[PHP] URL data decoding problem

2009-04-21 Thread Anders Norrbring
I'm working on a PayPal IPN module, and PayPal returns a lot of data in a
GET call.
The problem is that international characters entered by a user on the PayPal
site gets encoded really weird, and I don't see an obvious way to decode
them, can someone please assist?
My website is running utf-8 all over.

The URL contains this variable: memo=Pr%EF%BF%BDvar
It should translate into memo=Prövar

I've run out of ideas on this really.. PayPal say the reply is encoded in
windows-1252.

Thanks,
Anders.


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



Re: [PHP] URL data decoding problem

2009-04-21 Thread Ashley Sheridan
On Tue, 2009-04-21 at 08:39 +0200, Anders Norrbring wrote:
 I'm working on a PayPal IPN module, and PayPal returns a lot of data in a
 GET call.
 The problem is that international characters entered by a user on the PayPal
 site gets encoded really weird, and I don't see an obvious way to decode
 them, can someone please assist?
 My website is running utf-8 all over.
 
 The URL contains this variable: memo=Pr%EF%BF%BDvar
 It should translate into memo=Prövar
 
 I've run out of ideas on this really.. PayPal say the reply is encoded in
 windows-1252.
 
 Thanks,
 Anders.
 
 
You can use urldecode() to decode the %xx characters to their actual
character.


Ash
www.ashleysheridan.co.uk


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



SV: [PHP] URL data decoding problem

2009-04-21 Thread Anders Norrbring
 On Tue, 2009-04-21 at 08:39 +0200, Anders Norrbring wrote:
  I'm working on a PayPal IPN module, and PayPal returns a lot of data
 in a
  GET call.
  The problem is that international characters entered by a user on the
 PayPal
  site gets encoded really weird, and I don't see an obvious way to
 decode
  them, can someone please assist?
  My website is running utf-8 all over.
 
  The URL contains this variable: memo=Pr%EF%BF%BDvar
  It should translate into memo=Prövar
 
  I've run out of ideas on this really.. PayPal say the reply is
 encoded in
  windows-1252.
 
  Thanks,
  Anders.
 
 
 You can use urldecode() to decode the %xx characters to their actual
 character.
 
 
 Ash
 www.ashleysheridan.co.uk


Well, that doesn't work here.. Also, according to docs, all $_GET variables are 
already urldecoded when they're accessed in the script.
Nevertheless, urldecode doesn't give the result I was looking for. I've also 
tried mb_convert_encoding, html_entity_decode and combinations all over...

And I can't see why there are THREE characters in the URL, the original is only 
one 'ö'. If I simply do a echo urlencode('ö') it shows %C3%B6.

Anders.



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



[PHP] URL Rewrite not working for me

2008-07-25 Thread Don Don
Hi all,

I've set up a url rewrite code below.  

Options +FollowSymLinks
RewriteEngine on

RewriteRule profile/username/(.*) profile.php?username=$1

It only works when I type in this url 
http://www.example.com/profiles/profile/username/baller/

If i do not then the normal url 
http://www.example.com/profiles/profile.php?username=baller is displayed.



I just want the new url to show when ever I trype in the old url.

Cheers




  

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



Re: [PHP] URL Rewrite not working for me

2008-07-25 Thread Per Jessen
Don Don wrote:

 Hi all,
 
 I've set up a url rewrite code below.
 
 Options +FollowSymLinks
 RewriteEngine on
 
 RewriteRule profile/username/(.*) profile.php?username=$1
 
 It only works when I type in this url
 http://www.example.com/profiles/profile/username/baller/
 
 If i do not then the normal url
 http://www.example.com/profiles/profile.php?username=baller is
 displayed.
 
 I just want the new url to show when ever I trype in the old url.

Ah, you want an external redirect then.  It's really a case of RTFM, but
just add '[r]' to the end of your RewriteRule. 



/Per Jessen, Zürich


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



Re: [PHP] URL Rewrite not working for me

2008-07-25 Thread Don Don
Hi Per,
changed the rewrite to this

Options +FollowSymLinks
RewriteEngine on

RewriteRule profile/username/(.*) profile.php?username=$1 [r]

but sill does not work the way i want.  Entering this url 
http://example.com/profiles/profile.php?username=baller  does not cnage to  
http://localhost/profiles/profile/username/baller


--- On Fri, 7/25/08, Per Jessen [EMAIL PROTECTED] wrote:

 From: Per Jessen [EMAIL PROTECTED]
 Subject: Re: [PHP] URL Rewrite not working for me
 To: php-general@lists.php.net
 Date: Friday, July 25, 2008, 3:15 AM
 Don Don wrote:
 
  Hi all,
  
  I've set up a url rewrite code below.
  
  Options +FollowSymLinks
  RewriteEngine on
  
  RewriteRule profile/username/(.*)
 profile.php?username=$1
  
  It only works when I type in this url
 
 http://www.example.com/profiles/profile/username/baller/
  
  If i do not then the normal url
 
 http://www.example.com/profiles/profile.php?username=baller
 is
  displayed.
  
  I just want the new url to show when ever I trype in
 the old url.
 
 Ah, you want an external redirect then.  It's really a
 case of RTFM, but
 just add '[r]' to the end of your RewriteRule. 
 
 
 
 /Per Jessen, Zürich
 
 
 --
 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] URL Rewrite not working for me

2008-07-25 Thread Raman .
Hi!!
For Internal redirection:
RewriteRule profile/username/([^/]+) profile.php?username=$1 [PT]


On Fri, Jul 25, 2008 at 3:00 AM, Don Don [EMAIL PROTECTED] wrote:

 Hi all,

 I've set up a url rewrite code below.

 Options +FollowSymLinks
 RewriteEngine on

 RewriteRule profile/username/(.*) profile.php?username=$1

 It only works when I type in this url
 http://www.example.com/profiles/profile/username/baller/

 If i do not then the normal url
 http://www.example.com/profiles/profile.php?username=baller is displayed.



 I just want the new url to show when ever I trype in the old url.

 Cheers






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




-- 
http://www.kingzones.org/


Re: [PHP] URL Rewrite not working for me

2008-07-25 Thread Per Jessen
Don Don wrote:

 Hi Per,
 changed the rewrite to this
 
 Options +FollowSymLinks
 RewriteEngine on
 
 RewriteRule profile/username/(.*) profile.php?username=$1 [r]
 
 but sill does not work the way i want.  Entering this url
 http://example.com/profiles/profile.php?username=baller  does not
 cnage to http://localhost/profiles/profile/username/baller
 

Ah, you want it the other way round then.  The rewriterule is:

rewriterule  frompattern to 


/Per Jessen, Zürich


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



Re: [PHP] URL Rewrite not working for me

2008-07-25 Thread Daniel Brown
On Fri, Jul 25, 2008 at 6:00 AM, Don Don [EMAIL PROTECTED] wrote:
 Hi all,

 I've set up a url rewrite code below.

 Options +FollowSymLinks
 RewriteEngine on

 RewriteRule profile/username/(.*) profile.php?username=$1

 It only works when I type in this url 
 http://www.example.com/profiles/profile/username/baller/

 If i do not then the normal url 
 http://www.example.com/profiles/profile.php?username=baller is displayed.

Per's answer is probably exactly what you're looking for, Don.
Keep in mind, though, that this isn't a PHP question.  Future
questions of this nature would be better suited for the Apache list.
You may find sometimes that asking a question on the wrong list will
be ignored.  Not because people don't want to help, just because they
may read it and skip over it.

-- 
/Daniel P. Brown
Better prices on dedicated servers:
Intel 2.4GHz/60GB/512MB/2TB $49.99/mo.
Intel 3.06GHz/80GB/1GB/2TB $59.99/mo.
Dedicated servers, VPS, and hosting from $2.50/mo.

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



Re: [PHP] URL Rewrite not working for me

2008-07-25 Thread Per Jessen
Daniel Brown wrote:

 Per's answer is probably exactly what you're looking for, Don.
 Keep in mind, though, that this isn't a PHP question.  Future
 questions of this nature would be better suited for the Apache list.

Couldn't agree more. 

 You may find sometimes that asking a question on the wrong list will
 be ignored.  Not because people don't want to help, just because they
 may read it and skip over it.

Couldn't agree more. 

However, Don's question was of the kind that is easily overlooked on the
apache list, where topics tend to be a little less basic.  I tend to
think that basic apache/php questions are sometimes better asked here,
even if they are really off-topic.  It doesn't hurt anyone, and the
poster is actually likely to get a decent/useful answer fairly
quickly - due to the amount of plain user/developer experience that is
available here. 
I could easily have waved Don away with a plain RTFM, but I saw no
real reason.  


/Per Jessen, Zürich


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



Re: [PHP] URL Rewrite not working for me

2008-07-25 Thread Daniel Brown
On Fri, Jul 25, 2008 at 3:59 PM, Per Jessen [EMAIL PROTECTED] wrote:

 However, Don's question was of the kind that is easily overlooked on the
 apache list, where topics tend to be a little less basic.  I tend to
 think that basic apache/php questions are sometimes better asked here,
 even if they are really off-topic.  It doesn't hurt anyone, and the
 poster is actually likely to get a decent/useful answer fairly
 quickly - due to the amount of plain user/developer experience that is
 available here.

And I agree with you on these points, but at the same time, by not
recommending that the question be asked on the appropriate list first,
we're not only encouraging misplaced posts, but also cheating the
poster themselves.  They may not even be aware that there are separate
lists; a couple of times from the top of my head, responses have been,
I wasn't aware there was a list for [insert project name here].

 I could easily have waved Don away with a plain RTFM, but I saw no real 
 reason.

Yes, but that's you it's because you're a nice guy.  And what
do you expect from someone who lives in a city frequently rated as
best quality of life in the world?

-- 
/Daniel P. Brown
Better prices on dedicated servers:
Intel 2.4GHz/60GB/512MB/2TB $49.99/mo.
Intel 3.06GHz/80GB/1GB/2TB $59.99/mo.
Dedicated servers, VPS, and hosting from $2.50/mo.

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



Re: [PHP] URL Rewrite

2008-07-06 Thread Fabrice VIGNALS

Look at http://framework.zend.com/manual/en/zend.controller.router.html
Apache configuration et framework methods to rout your files are there.


Subhranil [EMAIL PROTECTED] a écrit dans le message de 
news:[EMAIL PROTECTED]


Hi All,

I want to show one URL at browser and content of different URL.

Like user can see the URL at address bar like http://localhost/test/home/
or http://localhost/test/tech/php/but content of page will be
http://localhost/test/index.php
The URL of the address bar will never change to
http://localhost/test/index.php

Still a  newbie!

Thanks,
Subhranild.

--
View this message in context: 
http://www.nabble.com/URL-Rewrite-tp18233803p18233803.html

Sent from the PHP - General mailing list archive at Nabble.com.




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



[PHP] URL Rewrite

2008-07-02 Thread Subhranil

Hi All,

I want to show one URL at browser and content of different URL.

Like user can see the URL at address bar like http://localhost/test/home/ 
or http://localhost/test/tech/php/but content of page will be
http://localhost/test/index.php
The URL of the address bar will never change to
http://localhost/test/index.php

Still a  newbie! 

Thanks,
Subhranild.

-- 
View this message in context: 
http://www.nabble.com/URL-Rewrite-tp18233803p18233803.html
Sent from the PHP - General mailing list archive at Nabble.com.


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



Re: [PHP] URL Rewrite

2008-07-02 Thread Per Jessen
Subhranil wrote:

 
 Hi All,
 
 I want to show one URL at browser and content of different URL.
 


Take a look at apache url rewriting. 


/Per Jessen, Zürich


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



Re: [PHP] URL Rewrite

2008-07-02 Thread Bastien Koert
On Wed, Jul 2, 2008 at 6:33 AM, Per Jessen [EMAIL PROTECTED] wrote:

 Subhranil wrote:

 
  Hi All,
 
  I want to show one URL at browser and content of different URL.
 


 Take a look at apache url rewriting.


 /Per Jessen, Zürich


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


You could look at using an iframe or frames in general, or ajax call into a
div

-- 

Bastien

Cat, the other other white meat


Re: [PHP] URL Rewrite

2008-07-02 Thread Børge Holen
On Wednesday 02 July 2008 13:34:32 Bastien Koert wrote:
 On Wed, Jul 2, 2008 at 6:33 AM, Per Jessen [EMAIL PROTECTED] wrote:
  Subhranil wrote:
   Hi All,
  
   I want to show one URL at browser and content of different URL.
 
  Take a look at apache url rewriting.
 
 
  /Per Jessen, Zürich
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php

 You could look at using an iframe or frames in general, or ajax call into a
 div

that suggestion is wrong on so many levels. using a hack to manage something 
ment to be handled before page is sent.

I lean toward the apache rewritemod



-- 
---
Børge Holen
http://www.arivene.net

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



Re: [PHP] URL modification

2008-03-06 Thread tedd

At 4:46 PM + 2/25/08, Nathan Rixham wrote:
It may be a good time to throw in this .htaccess which just palms 
eveything [not found] off to php


[.htaccess]
RewriteEngine On
RewriteBase /

DirectoryIndex handle.urls.php

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /handle.urls.php [L]
[/.htaccess]

I use this for everything nowadays, in terms of security it also 
allows me to keep every script out of the web root; and joy of joys 
don't need to change any rules for static files, as they will always 
be found and thus the rules won't apply:


follow?


No, I don't.

Please explain. Sounds cool.

Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] URL modification

2008-03-06 Thread Aschwin Wesselius

tedd wrote:

At 4:46 PM + 2/25/08, Nathan Rixham wrote:
It may be a good time to throw in this .htaccess which just palms 
eveything [not found] off to php


[.htaccess]
RewriteEngine On
RewriteBase /

DirectoryIndex handle.urls.php

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /handle.urls.php [L]
[/.htaccess]

I use this for everything nowadays, in terms of security it also 
allows me to keep every script out of the web root; and joy of joys 
don't need to change any rules for static files, as they will always 
be found and thus the rules won't apply:


follow?


No, I don't.

Please explain. Sounds cool. 


Hi,

As far as I can follow, this looks much like a 404 redirect trick which 
captures all not found files/paths. Based on the extension, you can 
still do fun or cool stuff and get more control about virtual paths etc.


As always: TIMTOWTDI, so I'm gonna play with this .htaccess rule and see 
if this is better than a 404 handler.


Aschwin Wesselius

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



Re: [PHP] URL modification

2008-02-25 Thread Daniel Brown
On Sat, Feb 23, 2008 at 6:27 AM, Richard Heyes [EMAIL PROTECTED] wrote:
  You could also forego the Files bit if you're willing to accept URLs
  like this:

  /rental.php/property/23425

I was waiting to see if anyone made mention of that while reading
through the thread.  I think this is a highly underused built-in
feature.  PHP is already, out-of-the-box, ready for
search-engine-friendly URLs.

-- 
/Dan

Daniel P. Brown
Senior Unix Geek
? while(1) { $me = $mind--; sleep(86400); } ?

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



Re: [PHP] URL modification

2008-02-25 Thread Nathan Rixham

Daniel Brown wrote:

On Sat, Feb 23, 2008 at 6:27 AM, Richard Heyes [EMAIL PROTECTED] wrote:

 You could also forego the Files bit if you're willing to accept URLs
 like this:

 /rental.php/property/23425


I was waiting to see if anyone made mention of that while reading
through the thread.  I think this is a highly underused built-in
feature.  PHP is already, out-of-the-box, ready for
search-engine-friendly URLs.



It may be a good time to throw in this .htaccess which just palms 
eveything [not found] off to php


[.htaccess]
RewriteEngine On
RewriteBase /

DirectoryIndex handle.urls.php

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /handle.urls.php [L]
[/.htaccess]

I use this for everything nowadays, in terms of security it also allows 
me to keep every script out of the web root; and joy of joys don't need 
to change any rules for static files, as they will always be found and 
thus the rules won't apply:


follow?

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



RE: [PHP] URL modification

2008-02-25 Thread Andrés Robinet
 -Original Message-
 From: Daniel Brown [mailto:[EMAIL PROTECTED]
 Sent: Monday, February 25, 2008 11:37 AM
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]; php-general@lists.php.net
 Subject: Re: [PHP] URL modification
 
 On Sat, Feb 23, 2008 at 6:27 AM, Richard Heyes [EMAIL PROTECTED]
 wrote:
   You could also forego the Files bit if you're willing to accept URLs
   like this:
 
   /rental.php/property/23425
 
 I was waiting to see if anyone made mention of that while reading
 through the thread.  I think this is a highly underused built-in
 feature.  PHP is already, out-of-the-box, ready for
 search-engine-friendly URLs.
 
 --
 /Dan
 
 Daniel P. Brown
 Senior Unix Geek
 ? while(1) { $me = $mind--; sleep(86400); } ?

Yeap, PHP rocks! I mentioned it in the first reply, only that it was not
rental.php, but index.php. Many if not all MVC frameworks support this kind of
routing which doesn't require mod_rewrite.

However, I prefer mod_rewrite if it's available, for crawlers it is not the same
/index.php/my-keywrod than /my-keyword alone. But I must admit that there are a
hundred other factors that can have much more weight for generating SEO problems
than having index.php everywhere.

Regards,

Rob

Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 
5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 |
TEL 954-607-4207 | FAX 954-337-2695 | 
Email: [EMAIL PROTECTED]  | MSN Chat: [EMAIL PROTECTED]  |  SKYPE: bestplace |
 Web: bestplace.biz  | Web: seo-diy.com

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



Re: [PHP] URL modification

2008-02-25 Thread Richard Heyes

I think this is a highly underused built-in
feature.


Agreed. I started to use it on my blog instead of a query string and 
pages reported by Google went up.


--
Richard Heyes
http://www.phpguru.org
Free PHP and Javascript code

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



RE: [PHP] URL modification

2008-02-24 Thread Xavier de Lapeyre
thnks

Xavier 
Please consider the environment before printing this mail note. 



-Original Message-
From: Nathan Rixham [mailto:[EMAIL PROTECTED] 
Sent: vendredi 22 février 2008 18:58
To: php-general@lists.php.net
Subject: Re: [PHP] URL modification

Richard Heyes wrote:
 H... made a quick look into it.
 Seems to be apache compatible.
 I'm designing a site to be hosted on an IIS Server.

 Does it still works there?
 
 On IIS I belive the default document is default.htm Though you should be 
 able to modify this to whatever you please. On Apache it is index.html 
 or index.php (for example). Regardless you want this to be parsed by 
 PHP, and then you can stick the following in it:
 
 ?php
 header('http://www.example.com/login.php');
 ?
 
 Place this file in your login directory and then you'll be able to 
 publish URLs such as http://www.example.com/login The trailing slash is 
 not necessary if login is a directory. For example:
 
 http://www.websupportsolutions.co.uk/demo
 

To use url's like http://domain.com/login/ as opposed to 
http://domain.com/login.php you can take multiple approaches.

The first and simplest is to simply save your login.php as /login/index.php
to use this approach you need to ensure that index.php is listed as a 
default page.

In IIS you can set the default page(s) to be whatever you like:
- Open IIS Manager
- Server - Websites - Right Click [properties]
- select Documents tab
- ensure Enable default content page is ticked
- ensure index.php is listed
- if not then click [add] and enter index.php
- continue to add any other default pages [index.html, index.shtml etc]

The second common solution [and I'd advise to get used to it asap] is to 
use URL rewriting.

In short url rewriting involves defining rules which the web server 
uses to direct http requests to resources on the server.
eg: direct domain.com/all_our_news to /index.php?newsitem=all

a quick intro guide can be found here:
http://www.sitepoint.com/article/guide-url-rewriting

For URL rewriting in IIS use ISAPI Rewrite - http://www.isapirewrite.com/

in apache use mod_rewrite
[apache1.3] httpd.apache.org/docs/1.3/mod/mod_rewrite.html
[apache2.0] httpd.apache.org/docs/2.0/mod/mod_rewrite.html

Both are pretty much identical when it comes to the end rewrite rules.

Hope that helps a little

Nathan

-- 
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] URL modification

2008-02-23 Thread Richard Heyes
Let's say we've got 2.5 million users :: weight up 2.5 million files vs 
1 rewrite rule


map:
/rental/property/23425
to:
/index.php?mod=propertysection=rentalspropertyid=23425


You never mentioned this many users. Hence you're moving the boundaries 
somewhat.



finally, do you honestly not use mod_rewrite in anything you've made?


No.

--
Richard Heyes
http://www.phpguru.org
Free PHP and Javascript code

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



Re: [PHP] URL modification

2008-02-23 Thread Richard Heyes

/rental/property/23425
to: 
/index.php?mod=propertysection=rentalspropertyid=23425


Thinking about this a little, you still don't need mod_rewrite.

rental could be a PHP script, forced through PHP with:

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

In either a .htaccess file or, if performance is an absolute necessity, 
your httpd.conf file (ie .htaccess files are turned off). In your rental 
PHP script you simply look at the REQUEST_URI $_SERVER variable to 
determine the correct data to show.


You could also forego the Files bit if you're willing to accept URLs 
like this:


/rental.php/property/23425

--
Richard Heyes
http://www.phpguru.org
Free PHP and Javascript code

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



RE: [PHP] URL modification

2008-02-22 Thread Xavier de Lapeyre
Thnks,
H... made a quick look into it.
Seems to be apache compatible.
I'm designing a site to be hosted on an IIS Server.

Does it still works there?

Regards,
Xavier de Lapeyre
Web Developer
Enterprise Data Services
24, Dr Roux Street, 
Rose Hill
Office: (230) 465 17 00
Fax: (230) 465 29 00
Site: www.eds.mu
Email: [EMAIL PROTECTED]


Please consider the environment before printing this mail note. 



-Original Message-
From: Andrés Robinet [mailto:[EMAIL PROTECTED] 
Sent: vendredi 22 février 2008 11:48
To: php-general@lists.php.net
Subject: RE: [PHP] URL modification

 -Original Message-
 From: Xavier de Lapeyre [mailto:[EMAIL PROTECTED]
 Sent: Friday, February 22, 2008 2:09 AM
 To: php-general@lists.php.net
 Subject: [PHP] URL modification
 Importance: High
 
 Hi all,
 
 I saw on some websites that modifies the links to access the webpages.
 
 Something like:
 http://www.example.com/login/
 instead of
 http://www.example.com/login.php
 
 Does anyone knows how this works or how its call / which PHP library
 performs this action?
 
 
 Xavier de Lapeyre

That's called URI/URL Routing and it's usually performed as part of every MVC
Framework I know of (CodeIgniter, CakePHP, Symfony, Zend Framework... just to
name a few). It's usually implemented through Apache's mod_rewrite module, but
you can get close without that module, if you allow for something like:

http://www.example.com/index.php/myaccount/profile (that is, you don't need
mod_rewrite unless you want to remove the index.php part of the URI path)

However, if you have an existing website, migrating it to use one of the MVC
frameworks (or just using a stand-alone URI Routing class) may not be the path
you want to follow.
 
Regards,

Rob

Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 
5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 |
TEL 954-607-4207 | FAX 954-337-2695 | 
Email: [EMAIL PROTECTED]  | MSN Chat: [EMAIL PROTECTED]  |  SKYPE: bestplace |
Web: bestplace.biz  | Web: seo-diy.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] URL modification

2008-02-22 Thread Thijs Lensselink

Quoting Xavier de Lapeyre [EMAIL PROTECTED]:


Thnks,
H... made a quick look into it.
Seems to be apache compatible.
I'm designing a site to be hosted on an IIS Server.

Does it still works there?

Regards,
Xavier de Lapeyre
Web Developer
Enterprise Data Services
24, Dr Roux Street,
Rose Hill
Office: (230) 465 17 00
Fax: (230) 465 29 00
Site: www.eds.mu
Email: [EMAIL PROTECTED]


Please consider the environment before printing this mail note.



-Original Message-
From: Andrés Robinet [mailto:[EMAIL PROTECTED]
Sent: vendredi 22 février 2008 11:48
To: php-general@lists.php.net
Subject: RE: [PHP] URL modification


-Original Message-
From: Xavier de Lapeyre [mailto:[EMAIL PROTECTED]
Sent: Friday, February 22, 2008 2:09 AM
To: php-general@lists.php.net
Subject: [PHP] URL modification
Importance: High

Hi all,

I saw on some websites that modifies the links to access the webpages.

Something like:
http://www.example.com/login/
instead of
http://www.example.com/login.php

Does anyone knows how this works or how its call / which PHP library
performs this action?


Xavier de Lapeyre


That's called URI/URL Routing and it's usually performed as part   
of every MVC

Framework I know of (CodeIgniter, CakePHP, Symfony, Zend Framework... just to
name a few). It's usually implemented through Apache's mod_rewrite   
module, but

you can get close without that module, if you allow for something like:

http://www.example.com/index.php/myaccount/profile (that is, you don't need
mod_rewrite unless you want to remove the index.php part of the URI path)

However, if you have an existing website, migrating it to use one of the MVC
frameworks (or just using a stand-alone URI Routing class) may not   
be the path

you want to follow.

Regards,

Rob

Andrés Robinet | Lead Developer | BESTPLACE CORPORATION
5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale,   
FL 33308 |

TEL 954-607-4207 | FAX 954-337-2695 |
Email: [EMAIL PROTECTED]  | MSN Chat: [EMAIL PROTECTED]  |  SKYPE:  
 bestplace |

Web: bestplace.biz  | Web: seo-diy.com



There are rewrite modules for IIS also.
Just google for IIS rewrite.

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



Re: [PHP] URL modification

2008-02-22 Thread Richard Heyes

H... made a quick look into it.
Seems to be apache compatible.
I'm designing a site to be hosted on an IIS Server.

Does it still works there?


On IIS I belive the default document is default.htm Though you should be 
able to modify this to whatever you please. On Apache it is index.html 
or index.php (for example). Regardless you want this to be parsed by 
PHP, and then you can stick the following in it:


?php
header('http://www.example.com/login.php');
?

Place this file in your login directory and then you'll be able to 
publish URLs such as http://www.example.com/login The trailing slash is 
not necessary if login is a directory. For example:


http://www.websupportsolutions.co.uk/demo

--
Richard Heyes
http://www.phpguru.org
Free PHP and Javascript code

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



Re: [PHP] URL modification

2008-02-22 Thread Per Jessen
Xavier de Lapeyre wrote:

 Hi all,
 
 I saw on some websites that modifies the links to access the webpages.
 
 Something like:
 http://www.example.com/login/
 instead of
 http://www.example.com/login.php
 
 Does anyone knows how this works or how its call / which PHP library
 performs this action?


It could be apache content negotiation that does it. 


/Per Jessen, Zürich

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



Re: [PHP] URL modification

2008-02-22 Thread Jason Pruim


On Feb 22, 2008, at 2:09 AM, Xavier de Lapeyre wrote:


Hi all,

I saw on some websites that modifies the links to access the webpages.

Something like:
http://www.example.com/login/
instead of
http://www.example.com/login.php

Does anyone knows how this works or how its call / which PHP library
performs this action?




I do a version of this simply by creating a directory and then put a  
default file in... I have Apache set to recognize index.php,  
index.shtml, index.html etc. etc. etc. as default files, so when  
someone goes to www.raoset.com/contact/ the page that loads is: www.raoset.com/contact/index.shtml 
  For my purposes it works great :)



--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424
www.raoset.com
[EMAIL PROTECTED]

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



Re: [PHP] URL modification

2008-02-22 Thread Nathan Rixham

Richard Heyes wrote:

H... made a quick look into it.
Seems to be apache compatible.
I'm designing a site to be hosted on an IIS Server.

Does it still works there?


On IIS I belive the default document is default.htm Though you should be 
able to modify this to whatever you please. On Apache it is index.html 
or index.php (for example). Regardless you want this to be parsed by 
PHP, and then you can stick the following in it:


?php
header('http://www.example.com/login.php');
?

Place this file in your login directory and then you'll be able to 
publish URLs such as http://www.example.com/login The trailing slash is 
not necessary if login is a directory. For example:


http://www.websupportsolutions.co.uk/demo



To use url's like http://domain.com/login/ as opposed to 
http://domain.com/login.php you can take multiple approaches.


The first and simplest is to simply save your login.php as /login/index.php
to use this approach you need to ensure that index.php is listed as a 
default page.


In IIS you can set the default page(s) to be whatever you like:
- Open IIS Manager
- Server - Websites - Right Click [properties]
- select Documents tab
- ensure Enable default content page is ticked
- ensure index.php is listed
- if not then click [add] and enter index.php
- continue to add any other default pages [index.html, index.shtml etc]

The second common solution [and I'd advise to get used to it asap] is to 
use URL rewriting.


In short url rewriting involves defining rules which the web server 
uses to direct http requests to resources on the server.

eg: direct domain.com/all_our_news to /index.php?newsitem=all

a quick intro guide can be found here:
http://www.sitepoint.com/article/guide-url-rewriting

For URL rewriting in IIS use ISAPI Rewrite - http://www.isapirewrite.com/

in apache use mod_rewrite
[apache1.3] httpd.apache.org/docs/1.3/mod/mod_rewrite.html
[apache2.0] httpd.apache.org/docs/2.0/mod/mod_rewrite.html

Both are pretty much identical when it comes to the end rewrite rules.

Hope that helps a little

Nathan

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



Re: [PHP] URL modification

2008-02-22 Thread Per Jessen
Nathan Rixham wrote:

 To use url's like http://domain.com/login/ as opposed to
 http://domain.com/login.php you can take multiple approaches.
 
[big snip]
 

Seriously, this is all overkill.  Apache content negotiation does it all
automagically and with minimal effort. 



/Per Jessen, Zürich

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



Re: [PHP] URL modification

2008-02-22 Thread Daniel Brown
On Fri, Feb 22, 2008 at 10:53 AM, Per Jessen [EMAIL PROTECTED] wrote:
 Nathan Rixham wrote:

   To use url's like http://domain.com/login/ as opposed to
   http://domain.com/login.php you can take multiple approaches.
  
  [big snip]
  

  Seriously, this is all overkill.  Apache content negotiation does it all
  automagically and with minimal effort.

Yes it does but the OP is using IIS.  ;-P

-- 
/Dan

Daniel P. Brown
Senior Unix Geek
? while(1) { $me = $mind--; sleep(86400); } ?

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



Re: [PHP] URL modification

2008-02-22 Thread Per Jessen
Daniel Brown wrote:

 On Fri, Feb 22, 2008 at 10:53 AM, Per Jessen [EMAIL PROTECTED] wrote:
 Nathan Rixham wrote:

   To use url's like http://domain.com/login/ as opposed to
   http://domain.com/login.php you can take multiple approaches.
  
  [big snip]
  

  Seriously, this is all overkill.  Apache content negotiation does it
  all automagically and with minimal effort.
 
 Yes it does but the OP is using IIS.  ;-P

Oops, I missed that completely.  Sorry.



/Per Jessen, Zürich

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



Re: [PHP] URL modification

2008-02-22 Thread Nathan Rixham

Per Jessen wrote:

Daniel Brown wrote:


On Fri, Feb 22, 2008 at 10:53 AM, Per Jessen [EMAIL PROTECTED] wrote:

Nathan Rixham wrote:

  To use url's like http://domain.com/login/ as opposed to
  http://domain.com/login.php you can take multiple approaches.
 
 [big snip]
 

 Seriously, this is all overkill.  Apache content negotiation does it
 all automagically and with minimal effort.

Yes it does but the OP is using IIS.  ;-P


Oops, I missed that completely.  Sorry.



/Per Jessen, Zürich


+ rewrite is overkill for this, but long term it's worth implementing 
and getting used to - think of the post as a pre-emptive strike on the 
inevitable question in a couple of weeks: how can i make /profile/adam 
instead of profile.php?user=adam


:) happy friday all

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



Re: [PHP] URL modification

2008-02-22 Thread Richard Heyes
+ rewrite is overkill for this, but long term it's worth implementing 
and getting used to - think of the post as a pre-emptive strike on the 
inevitable question in a couple of weeks: how can i make /profile/adam 
instead of profile.php?user=adam


Have a directory in your htdocs called /profile/adam and in that place a 
default document redirecting. Still no need for mod_rewrite. Unless of 
course you want the url to remain in the addressbar, but personally I 
don't think that is as important as what the user has to type in initially.


--
Richard Heyes
http://www.phpguru.org
Free PHP and Javascript code

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



Re: [PHP] URL modification

2008-02-22 Thread Nathan Rixham

Richard Heyes wrote:
+ rewrite is overkill for this, but long term it's worth implementing 
and getting used to - think of the post as a pre-emptive strike on the 
inevitable question in a couple of weeks: how can i make 
/profile/adam instead of profile.php?user=adam


Have a directory in your htdocs called /profile/adam and in that place a 
default document redirecting. Still no need for mod_rewrite. Unless of 
course you want the url to remain in the addressbar, but personally I 
don't think that is as important as what the user has to type in initially.




Never thought I'd have to find a way to explain the benefits of url 
re-writing.


[snip]
/profile/adam and in that place a default document redirecting. Still no 
need for mod_rewrite

[/snip]
Let's say we've got 2.5 million users :: weight up 2.5 million files vs 
1 rewrite rule


map:
/rental/property/23425
to:
/index.php?mod=propertysection=rentalspropertyid=23425

SEO :: not even going in to this one

finally, do you honestly not use mod_rewrite in anything you've made?

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



Re: [PHP] URL modification

2008-02-22 Thread Per Jessen
Nathan Rixham wrote:

 + rewrite is overkill for this, but long term it's worth implementing
 and getting used to 

Completely agree.  You've got to get to know url rewriting.  I don't
know how you can manage without it, even if it's far from always the
right answer. 


/Per Jessen, Zürich

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



[PHP] URL modification

2008-02-21 Thread Xavier de Lapeyre
Hi all,

I saw on some websites that modifies the links to access the webpages.

Something like:
http://www.example.com/login/
instead of 
http://www.example.com/login.php

Does anyone knows how this works or how its call / which PHP library
performs this action?


Xavier de Lapeyre

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



RE: [PHP] URL modification

2008-02-21 Thread Andrés Robinet
 -Original Message-
 From: Xavier de Lapeyre [mailto:[EMAIL PROTECTED]
 Sent: Friday, February 22, 2008 2:09 AM
 To: php-general@lists.php.net
 Subject: [PHP] URL modification
 Importance: High
 
 Hi all,
 
 I saw on some websites that modifies the links to access the webpages.
 
 Something like:
 http://www.example.com/login/
 instead of
 http://www.example.com/login.php
 
 Does anyone knows how this works or how its call / which PHP library
 performs this action?
 
 
 Xavier de Lapeyre

That's called URI/URL Routing and it's usually performed as part of every MVC
Framework I know of (CodeIgniter, CakePHP, Symfony, Zend Framework... just to
name a few). It's usually implemented through Apache's mod_rewrite module, but
you can get close without that module, if you allow for something like:

http://www.example.com/index.php/myaccount/profile (that is, you don't need
mod_rewrite unless you want to remove the index.php part of the URI path)

However, if you have an existing website, migrating it to use one of the MVC
frameworks (or just using a stand-alone URI Routing class) may not be the path
you want to follow.
 
Regards,

Rob

Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 
5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 |
TEL 954-607-4207 | FAX 954-337-2695 | 
Email: [EMAIL PROTECTED]  | MSN Chat: [EMAIL PROTECTED]  |  SKYPE: bestplace |
Web: bestplace.biz  | Web: seo-diy.com

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



Re: [PHP] URL Parsing...

2007-11-26 Thread Richard Heyes

Chris wrote:

Richard Heyes wrote:
well if you take a string (filename) and wish to change the end of it 
somone
then I don't think str_replace() is the correct function. what's to 
say a script

doesn't exist called 'my.cfm.php'?


How does this:

/\.cfm$/

take into account that?


$ in regex's means 'end of string' - so it will only match .cfm at the 
very end of the string.


Indeed, so how does the regex take into account .cfm.php? It doesn't. 
If it doesn't have a .cfm extension, it won't match.


--
Richard Heyes
+44 (0)800 0213 172
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



Re: [PHP] URL Parsing...

2007-11-26 Thread Jochem Maas
Richard Heyes wrote:
 Chris wrote:
 Richard Heyes wrote:
 well if you take a string (filename) and wish to change the end of
 it somone
 then I don't think str_replace() is the correct function. what's to
 say a script
 doesn't exist called 'my.cfm.php'?

 How does this:

 /\.cfm$/

 take into account that?

 $ in regex's means 'end of string' - so it will only match .cfm at the
 very end of the string.
 
 Indeed, so how does the regex take into account .cfm.php? It doesn't.
 If it doesn't have a .cfm extension, it won't match.

because the question was I want to replace the extension '.cfm' with 
'-meta.cfm',
which I assumed meant the OP didn't want 'my.cfm.php' to become 
'my-meta.cfm.php'
and a str_replace('.cfm', '-meta.cfm', $foo) would not be correct in that 
situation.

hopefully now the use of preg_replace() in my example makes sense.

oh and I forget to add delimeters to the regexps in my examples, which was a 
stupid
oversight.

 

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



Re: [PHP] URL Parsing...

2007-11-25 Thread Richard Heyes

one of these should give you something to go on:

echo preg_replace('\.cfm$', '-meta.cfm', parse_url($_SERVER['REQUEST_URI'], 
PHP_URL_PATH)), \n;
echo preg_replace('\.cfm$', '-meta.cfm', $_SERVER['PATH_TRANSLATED']), \n;
echo preg_replace('\.cfm$', '-meta.cfm', $_SERVER['SCRIPT_FILENAME']), \n;


Anything would be helpful.  :)


You don't need the overhead of PCRE, though it is the fastest to write, 
since it's already above for you...


Or parse_url(). basename(__FILE__) will get you the filename.

--
Richard Heyes
+44 (0)800 0213 172
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



Re: [PHP] URL Parsing...

2007-11-25 Thread Jochem Maas
Richard Heyes wrote:
 one of these should give you something to go on:

 echo preg_replace('\.cfm$', '-meta.cfm',
 parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)), \n;
 echo preg_replace('\.cfm$', '-meta.cfm', $_SERVER['PATH_TRANSLATED']),
 \n;
 echo preg_replace('\.cfm$', '-meta.cfm', $_SERVER['SCRIPT_FILENAME']),
 \n;

 Anything would be helpful.  :)
 
 You don't need the overhead of PCRE, though it is the fastest to write,
 since it's already above for you...

well if you take a string (filename) and wish to change the end of it somone
then I don't think str_replace() is the correct function. what's to say a script
doesn't exist called 'my.cfm.php'?

 
 Or parse_url(). basename(__FILE__) will get you the filename.

ah yes basename() - I forgot to put use that in the examples, good catch.

 

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



Re: [PHP] URL Parsing...

2007-11-25 Thread Richard Heyes

well if you take a string (filename) and wish to change the end of it somone
then I don't think str_replace() is the correct function. what's to say a script
doesn't exist called 'my.cfm.php'?


How does this:

/\.cfm$/

take into account that?

--
Richard Heyes
+44 (0)800 0213 172
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



Re: [PHP] URL Parsing...

2007-11-25 Thread Jochem Maas
Richard Heyes wrote:
 well if you take a string (filename) and wish to change the end of it
 somone
 then I don't think str_replace() is the correct function. what's to
 say a script
 doesn't exist called 'my.cfm.php'?
 
 How does this:
 
 /\.cfm$/
 
 take into account that?

WTF

 

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



Re: [PHP] URL Parsing...

2007-11-25 Thread Chris

Richard Heyes wrote:
well if you take a string (filename) and wish to change the end of it 
somone
then I don't think str_replace() is the correct function. what's to 
say a script

doesn't exist called 'my.cfm.php'?


How does this:

/\.cfm$/

take into account that?


$ in regex's means 'end of string' - so it will only match .cfm at the 
very end of the string.


--
Postgresql  php tutorials
http://www.designmagick.com/

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



[PHP] URL Parsing...

2007-11-24 Thread Amanda Loucks
Hi,

I'm working on redesigning the backend of the website for work.  It was
originally done in ColdFusion, but I'm switching it over to PHP - probably
going to transfer the website from where it's currently hosted to something
a lot cheaper, too, hence the switching to PHP.  Anyway.

Because we are a manufacturing company, we have a few different lines of
products.  Currently, each different product line has it's own page (and own
meta tags).  The current set up has ColdFusion grabbing the current page
from the URL stripping off the '.cfm' extension and adding '-meta.cfm'
before including it in the header.

I'm sure there is a way to do this in PHP, but I'm out of shape enough with
using PHP that I can't remember, and I can't seem to find anything that will
work for me.  I just want to be able to pull whatever address is in the URL,
get the file name, and go from there.

Any ideas?

Anything would be helpful.  :)

Thanks,
Amanda


Re: [PHP] URL Parsing...

2007-11-24 Thread tedd

At 12:18 PM -0600 11/24/07, Amanda Loucks wrote:

Hi,

I'm working on redesigning the backend of the website for work.  It was
originally done in ColdFusion, but I'm switching it over to PHP - probably
going to transfer the website from where it's currently hosted to something
a lot cheaper, too, hence the switching to PHP.  Anyway.

Because we are a manufacturing company, we have a few different lines of
products.  Currently, each different product line has it's own page (and own
meta tags).  The current set up has ColdFusion grabbing the current page
from the URL stripping off the '.cfm' extension and adding '-meta.cfm'
before including it in the header.

I'm sure there is a way to do this in PHP, but I'm out of shape enough with
using PHP that I can't remember, and I can't seem to find anything that will
work for me.  I just want to be able to pull whatever address is in the URL,
get the file name, and go from there.

Any ideas?

Anything would be helpful.  :)

Thanks,
Amanda


From what I've read recently about meta tags, why?

Most SE's have dropped their dependance on meta tags because of their abuse.

Cheers,

tedd


--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] URL Parsing...

2007-11-24 Thread Jochem Maas
Amanda Loucks wrote:
 Hi,
 
 I'm working on redesigning the backend of the website for work.  It was
 originally done in ColdFusion, but I'm switching it over to PHP - probably
 going to transfer the website from where it's currently hosted to something
 a lot cheaper, too, hence the switching to PHP.  Anyway.
 
 Because we are a manufacturing company, we have a few different lines of
 products.  Currently, each different product line has it's own page (and own
 meta tags).  The current set up has ColdFusion grabbing the current page
 from the URL stripping off the '.cfm' extension and adding '-meta.cfm'
 before including it in the header.
 
 I'm sure there is a way to do this in PHP, but I'm out of shape enough with
 using PHP that I can't remember, and I can't seem to find anything that will
 work for me.  I just want to be able to pull whatever address is in the URL,
 get the file name, and go from there.
 
 Any ideas?

one of these should give you something to go on:

echo preg_replace('\.cfm$', '-meta.cfm', parse_url($_SERVER['REQUEST_URI'], 
PHP_URL_PATH)), \n;
echo preg_replace('\.cfm$', '-meta.cfm', $_SERVER['PATH_TRANSLATED']), \n;
echo preg_replace('\.cfm$', '-meta.cfm', $_SERVER['SCRIPT_FILENAME']), \n;

 
 Anything would be helpful.  :)
 
 Thanks,
 Amanda
 

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



[PHP] [URL file-access is disabled]

2007-06-09 Thread Dave Howard Schiff
Hello everyone,

I have a problem, that I hope you can help me to solve:
   
  I'm writing a very simple PHP script to list a directory contents based on a 
'user' variable given by a login/password script. The problem is, the 
webhosting i'm using don't allow the so called URL file-access ( i'm using 
PANDELA.COM ). It's a great hosting but this feature is breaking my legs:
   
  When the user put his name/passwrod, the script will check of course his 
information and then will allow the user to access his directory information, 
and then the url variable will look like this.
   
  $username= $_GET['logininfo'];
  include /bd/userdirs/$username/listdir.php;
   
  Ok, I know that the hosting don't allow that kind of include. But, is there a 
workaround for that? I mean, every user has their own folder, and every folder 
has a default script called listdir.php - all that this script does is to list 
all files avaiable to him. But then, I get this error message below.
  
Warning: include() [function.include]: URL file-access is disabled in the 
server configuration in 
/home/users/b9/myhost/www/myhost.pandela.org/bd/loginuser.php on line 41
   
  Any help would be very appreciated.
   
  Best Regards,
Dave Howard Schiff.
  


   
-
Novo Yahoo! Cadê? - Experimente uma nova busca. 

Re: [PHP] [URL file-access is disabled]

2007-06-09 Thread Tijnema

On 6/9/07, Dave Howard Schiff [EMAIL PROTECTED] wrote:

Hello everyone,

I have a problem, that I hope you can help me to solve:

 I'm writing a very simple PHP script to list a directory contents based on a 'user' 
variable given by a login/password script. The problem is, the webhosting i'm using don't 
allow the so called URL file-access ( i'm using PANDELA.COM ). It's a great 
hosting but this feature is breaking my legs:

 When the user put his name/passwrod, the script will check of course his information and 
then will allow the user to access his directory information, and then the url 
variable will look like this.

 $username= $_GET['logininfo'];
 include /bd/userdirs/$username/listdir.php;

 Ok, I know that the hosting don't allow that kind of include. But, is there a 
workaround for that? I mean, every user has their own folder, and every folder 
has a default script called listdir.php - all that this script does is to list 
all files avaiable to him. But then, I get this error message below.

Warning: include() [function.include]: URL file-access is disabled in the 
server configuration in 
/home/users/b9/myhost/www/myhost.pandela.org/bd/loginuser.php on line 41

 Any help would be very appreciated.

 Best Regards,
Dave Howard Schiff.


URL include is when you include files from
http://www.domain.com/file.php, that shouldn't be this...
But keep in mind that the directory you log into with FTP isn't /
Try this include:
What if you do this:
include 
/home/users/b9/myhost/www/myhost.pandela.org/bd/userdirs/$username/listdir.php;

Tijnema

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



Re: [PHP] [URL file-access is disabled]

2007-06-09 Thread Richard Lynch
On Sat, June 9, 2007 12:14 pm, Dave Howard Schiff wrote:
 I have a problem, that I hope you can help me to solve:

   I'm writing a very simple PHP script to list a directory contents
 based on a 'user' variable given by a login/password script. The
 problem is, the webhosting i'm using don't allow the so called URL
 file-access ( i'm using PANDELA.COM ). It's a great hosting but
 this feature is breaking my legs:

   When the user put his name/passwrod, the script will check of course
 his information and then will allow the user to access his directory
 information, and then the url variable will look like this.

   $username= $_GET['logininfo'];
   include /bd/userdirs/$username/listdir.php;

This is not a URL file access.

If it's not working, you may be falling under an open_basedir
restricition, but not allow_url_fopen as you seem to think.

Have you tried it yet?

 Warning: include() [function.include]: URL file-access is disabled in
 the server configuration in
 /home/users/b9/myhost/www/myhost.pandela.org/bd/loginuser.php on line
 41

Ah.

The problem is that you are confusing DocumentRoot with Server root.

You will need to add all the
/home/users/b9/myhost/www/myhost.pandela.org/ in front of your current
/bd to work.

As it stands now, you are trying to include something from a directory
that is parallel to (a sibling of) /home:

In other words, what you typed would work if you had this:
/
  .
  ..
  /home/users/b9/myhost/www/myhost.pandela.org/
  /bd/userdirs/whatever/listdir.php

But you don't have that.  You have this:
/
  .
  ..
  /home/users/b9/myhost/www/myhost.pandela.org/bd/userdirs/whatever/listdir.php

[that last one is supposed to be all one line...]

I dunno why it's complaining about URL-file-access though... Seems
pretty weird to me...

-- 
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] PHP URL issues

2007-03-14 Thread Richard Lynch
Plus, after you urlencode() the values to go into the URL, you should
use htmlentites on the URL to go to the browser, if you want it to be
valid HTML.

Use Firefox with HTMLValidator and make your HTML valid will solve
about  20% of beginner PHP problems.

On Tue, March 13, 2007 7:47 am, Satyam wrote:
 You should use urlencode() on variables that will go into URL
 arguments.
 You might have a whitespace in any of those variables and the URL
 stops at
 the first whitespace.  If those spaces are at the ends and are not
 significant, you might want to use trim().




 - Original Message -
 From: Don Don [EMAIL PROTECTED]
 To: PHP List php-general@lists.php.net
 Sent: Tuesday, March 13, 2007 11:37 AM
 Subject: Re: [PHP] PHP URL issues



 I've just noticed that if am passing only one value it works fine,
 but
 when am passing in more than one none works.

  Why is that or what could be wrong ?

  e.g.  this works
  echo ba href='test.php?term=$letter_value'$letter_value
 nbsp;/a/b; on test.php i can display the value of term but
 with this

  echo ba
 href='test.php?term=$letter_valuetype=$type_value'$letter_value
 nbsp;/a/b; on test.php the values are empty.

 Nikola Stjelja [EMAIL PROTECTED] wrote:
  If you are going to insert variables like $var_name in a string you
 need
 to enclose that string with double qoutations marks, not single. PHP
 will
 replace var names with values only inside double qoutations.

 Hope that helps

  On 3/12/07, Don Don [EMAIL PROTECTED] wrote:  I've got the
 following
 url rewriting problem.

  on page 1 i've got this

  p a href='page1.php?messageId=$tmpForumuserId=$user_id' See
 /a/p

  and on page 2 i've got this

  $messageID = $_REQUEST[messageId];
 $userID = $_REQUEST[userId];


 when i check to see the values of these variables its says its
 empty, but
 when i place my cursor on the link in
 page 1 i can see both variables being show with their values in the
 browser.  But on page 2 i cant get the values
 Something seems wrong perharps ?

  Cheers


 -
 Now that's room service! Choose from over 150,000 hotels
 in 45,000 destinations on Yahoo! Travel to find your fit.



 --
 Please visit this site and play my RPG!

 http://www.1km1kt.net/rpg/Marinci.php




 -
 Don't get soaked.  Take a quick peek at the forecast
 with theYahoo! Search weather shortcut.


 


 No virus found in this incoming message.
 Checked by AVG Free Edition.
 Version: 7.5.446 / Virus Database: 268.18.10/720 - Release Date:
 12/03/2007
 19:19

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




-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] PHP URL issues

2007-03-14 Thread Richard Lynch
On Tue, March 13, 2007 9:31 am, Steve wrote:
 This may or may not help, but here's a few things to note:

 1) I would avoid placing variable output in double quoted strings.
 While not
 important for smaller scripts, doing a large number of outputs like
 this
 causes a decent performance hit. In fact, I wouldn't use double quotes
 ever
 in php. Instead, strive for something like:

 echo 'ba href=test.php?term='.$letter_value.''.$letter_value.'
 nbsp;/a/b';

Have you benchmarked this, or can you provide a link to others'
benchmarks demonstrating this perofmrnace hit?...

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] PHP URL issues

2007-03-14 Thread Satyam

There are lies, damned lies and statistics.  Had he known about benchmarks!

I have already tried different ways of producing output and I completely 
disagree that concatenating the pieces and then echoing them is the best. 
In a first try, I found that echoing the separate parts as arguments to echo 
with commas in between was the fastest and variable interpolation within 
double quotes strings (or heredoc) was fastest than concatenation. 
Nevertheless, in a later trial, the numbers which were so clearly in favor 
of echo with multiple arguments, turned only slightly better, not enough to 
justify the loss of flexibility of building up a string first and having the 
option of manipulating it.


This last sentence was confusing, lets see. When writing functions, you 
might either have them do the echo themselves or returning a string.  The 
first is fastest, the second offers flexibility. If the first is really much 
faster, I'm willing to do away with the flexibility, which is no more than a 
potencial benefit, since 90% of the time I might have nothing at all to do 
with the return value of the funcion and, if really needed, I might use 
output buffering.  Neverhteless, if the straight echoes are not that much 
faster, I'd rather keep an ace in my sleeve and go with returning strings. 
In my first trial, the result was conclusive, it was about 4 to 1, in the 
second, it was about 20% faster.  The first was done on my own personal 
machine, a Windows machine doing nothing else, the second on my ISP shared 
hosting with an unknown load.


I might say that my test on my own idle machine was the most representative, 
since it didn't have to deal with external issues such as competing for 
external resources, but then, that competition is really part of life. 
Though avoiding the memory shuffling of doing many string concatenations, 
doing echoes with multiple arguments might require the interpreter to 
negotiate access to IO buffers more often than building the whole page in 
memory and then getting it echoed just once.   And I am sure that the way 
Windows and Linux handles IO with Apache is quite different, so, which 
benchmark is really representative?


I am sure that some benchmarks are quite representative, independent of 
platforms.   For example, it would make sense that doing an exact equality 
(triple =) should be faster than a plain equality.  The first fails straight 
away if types are different and in no case is any conversion made.  In the 
second, if the types don't match conversions need to be made first (after 
figuring out which one to make) so logic indicates it should take longer. 
Nevertheless, I don't feel like testing it out since the results, as my 
previous experience indicate, seem to be so uncertain.


I'm not even arguing whether it makes sense or not in trying to shave off a 
few ticks of the clock.  I am sure that a machine handling who knows how 
many users requests simultaneously will appreciate any little help, 
actually, I'm not sure I am actually looking for answers because, as far as 
I know, the answer is:   it depends


Satyam



- Original Message - 
From: Richard Lynch [EMAIL PROTECTED]

To: Steve [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Sent: Wednesday, March 14, 2007 10:07 AM
Subject: Re: [PHP] PHP URL issues



On Tue, March 13, 2007 9:31 am, Steve wrote:

This may or may not help, but here's a few things to note:

1) I would avoid placing variable output in double quoted strings.
While not
important for smaller scripts, doing a large number of outputs like
this
causes a decent performance hit. In fact, I wouldn't use double quotes
ever
in php. Instead, strive for something like:

echo 'ba href=test.php?term='.$letter_value.''.$letter_value.'
nbsp;/a/b';


Have you benchmarked this, or can you provide a link to others'
benchmarks demonstrating this perofmrnace hit?...

--
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.11/721 - Release Date: 
13/03/2007 16:51





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



Re: [PHP] PHP URL issues

2007-03-14 Thread Steve
I personally have not unfortunately. A good friend of mine is also a 
developer who initially told me about it when I first began coding. Because 
I don't want to stick with the he-said, she-said approach, I did a quick 
google search and came up with this link:

http://spindrop.us/2007/03/03/php-double-versus-single-quotes/

There's several other pages saying similar things if you do look around.

Even the performance different isn't significant, it will add up. If 
something like this is known to help ever so slightly with execution time 
and it's something you can teach yourself to do subconsciously, then I feel 
it's definitely worthwhile to pursue.

Richard Lynch [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 On Tue, March 13, 2007 9:31 am, Steve wrote:
 This may or may not help, but here's a few things to note:

 1) I would avoid placing variable output in double quoted strings.
 While not
 important for smaller scripts, doing a large number of outputs like
 this
 causes a decent performance hit. In fact, I wouldn't use double quotes
 ever
 in php. Instead, strive for something like:

 echo 'ba href=test.php?term='.$letter_value.''.$letter_value.'
 nbsp;/a/b';

 Have you benchmarked this, or can you provide a link to others'
 benchmarks demonstrating this perofmrnace hit?...

 -- 
 Some people have a gift link here.
 Know what I want?
 I want you to buy a CD from some starving artist.
 http://cdbaby.com/browse/from/lynch
 Yeah, I get a buck. So? 

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



Fw: [PHP] PHP URL issues

2007-03-14 Thread Satyam
One more example of a questionable benchmark, not wrong but I wonder (as I 
was doing in my previous) whether it is really representative.


There are two main ways to handle strings, one is to malloc exactly the 
required memory for each string and keep moving characters around from one 
chunk of memory to another.   If you append a single character to a string, 
you would measure both, add their lengths plus whatever overhead your data 
representation requires, malloc that much memory, move the characters from 
each source and then free the memory occupied by the first.


The other way to do it is to malloc memory in more or less fixed sizes and 
include in the header of your variable a length field. With plenty of memory 
available nowadays, few still choose the first option. Appending a few 
characters does not require any new memory allocation nor freeing it up. 
The later method depends on how good where your statistics (more damned lies 
once again) about the average string length, but if you get it right, 
appending to a string ( .= operator) becomes as fast as appending to a 
StreamBuffer, as found in other languages with separate Strings and Streams 
classes.  Some languages do not even require string space to be contiguous 
so that when one block is used up you don't have to get a bigger one and 
move everything to the new place, the blocks comprising the string are 
linked in a list.  That's one reason why lots of languages now prefer 
'immutable strings', it is no longer possible to treat the string as an 
array of characters since they cannot be accessed via a simple offset.


This benchmark is probably exercising more the symbol table lookups and 
memory allocation functions than the actual concatenation, since it is 
allocating and freeing up lots of space for really tiny strings that don't 
take much of that space at all.  Whatever difference there is in the actual 
string operation might be clouded under other factors.


Regardless, I do prefer to use single quotes and, as I mentioned elsewhere, 
I just echo the bits and pieces as soon as I am able, reasoning that the 
output buffer is truly a stream buffer and since the echo is a language 
construct (no function call overhead), it should be faster than managing 
memory to hold strings.   As I said, though, the performance of one option 
against others varies so much in different trials under different conditions 
that I feel foolish just to show them.


Then, not even logic works fine if you mean to define what is faster and 
what is not.   Sometimes the developers, using profilers and such tools, 
find a very slow spot and they get to optimize it to such an extent that it 
works faster than its un-optimized relative, which under equal circumstances 
would have actually been faster.


Using single quotes for PHP strings frees me the double quotes for HTML 
attribute values without any need to escape them.  I have defined CRLF and 
TAB as constants which I can redefine at any time to an empty string if I no 
longer care my HTML output to be readable.  Since I prefer to keep all 
values in their native PHP format up to the last moment, and those values 
have to be passed either through htmlentities(), number_format(), 
money_format() or strftotime() on output, variable interpolation is out of 
the question anyway.


Satyam



- Original Message - 
From: Steve [EMAIL PROTECTED]

To: php-general@lists.php.net
Sent: Wednesday, March 14, 2007 3:25 PM
Subject: Re: [PHP] PHP URL issues


I personally have not unfortunately. A good friend of mine is also a 
developer who initially told me about it when I first began coding. Because 
I don't want to stick with the he-said, she-said approach, I did a quick 
google search and came up with this link:


http://spindrop.us/2007/03/03/php-double-versus-single-quotes/

There's several other pages saying similar things if you do look around.

Even the performance different isn't significant, it will add up. If 
something like this is known to help ever so slightly with execution time 
and it's something you can teach yourself to do subconsciously, then I 
feel it's definitely worthwhile to pursue.


Richard Lynch [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]

On Tue, March 13, 2007 9:31 am, Steve wrote:

This may or may not help, but here's a few things to note:

1) I would avoid placing variable output in double quoted strings.
While not
important for smaller scripts, doing a large number of outputs like
this
causes a decent performance hit. In fact, I wouldn't use double quotes
ever
in php. Instead, strive for something like:

echo 'ba href=test.php?term='.$letter_value.''.$letter_value.'
nbsp;/a/b';


Have you benchmarked this, or can you provide a link to others'
benchmarks demonstrating this perofmrnace hit?...

--
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So

Re: Fw: [PHP] PHP URL issues

2007-03-14 Thread Robert Cummings
On Wed, 2007-03-14 at 16:31 +0100, Satyam wrote:
 One more example of a questionable benchmark, not wrong but I wonder (as I 
 was doing in my previous) whether it is really representative.
 
 There are two main ways to handle strings, one is to malloc exactly the 
 required memory for each string and keep moving characters around from one 
 chunk of memory to another.   If you append a single character to a string, 
 you would measure both, add their lengths plus whatever overhead your data 
 representation requires, malloc that much memory, move the characters from 
 each source and then free the memory occupied by the first.
 
 The other way to do it is to malloc memory in more or less fixed sizes and 
 include in the header of your variable a length field.

You forgot realloc().

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: Fw: [PHP] PHP URL issues

2007-03-14 Thread Satyam


- Original Message - 
From: Robert Cummings [EMAIL PROTECTED]

To: Satyam [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Sent: Wednesday, March 14, 2007 4:49 PM
Subject: Re: Fw: [PHP] PHP URL issues



On Wed, 2007-03-14 at 16:31 +0100, Satyam wrote:
One more example of a questionable benchmark, not wrong but I wonder (as 
I

was doing in my previous) whether it is really representative.

There are two main ways to handle strings, one is to malloc exactly the
required memory for each string and keep moving characters around from 
one
chunk of memory to another.   If you append a single character to a 
string,
you would measure both, add their lengths plus whatever overhead your 
data
representation requires, malloc that much memory, move the characters 
from

each source and then free the memory occupied by the first.

The other way to do it is to malloc memory in more or less fixed sizes 
and

include in the header of your variable a length field.


You forgot realloc().



Yes I did, but it doesn't matter that much.  When asigning by blocks the 
best strategy is to keep all blocks the same size, or of a few assorted 
sizes, and link them in lists because blocks of different sizes end up 
fragmenting the memory too much and giving the garbage collector lots of 
trouble, if all blocks are of the same size, they are immediately reusable. 
Basically, if you are dealing with the memory yourself, assigning it, 
freeing it, collecting garbage afterwards and defragmenting, you won't 
resort that much to individual calls to the memory library functions, you 
just grab a big chunk and manage it on your own.


Satyam

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



Re: Fw: [PHP] PHP URL issues

2007-03-14 Thread Robert Cummings
On Wed, 2007-03-14 at 17:15 +0100, Satyam wrote:
 - Original Message - 
 From: Robert Cummings [EMAIL PROTECTED]
 To: Satyam [EMAIL PROTECTED]
 Cc: php-general@lists.php.net
 Sent: Wednesday, March 14, 2007 4:49 PM
 Subject: Re: Fw: [PHP] PHP URL issues
 
 
  On Wed, 2007-03-14 at 16:31 +0100, Satyam wrote:
  One more example of a questionable benchmark, not wrong but I wonder (as 
  I
  was doing in my previous) whether it is really representative.
 
  There are two main ways to handle strings, one is to malloc exactly the
  required memory for each string and keep moving characters around from 
  one
  chunk of memory to another.   If you append a single character to a 
  string,
  you would measure both, add their lengths plus whatever overhead your 
  data
  representation requires, malloc that much memory, move the characters 
  from
  each source and then free the memory occupied by the first.
 
  The other way to do it is to malloc memory in more or less fixed sizes 
  and
  include in the header of your variable a length field.
 
  You forgot realloc().
 
 
 Yes I did, but it doesn't matter that much.  When asigning by blocks the 
 best strategy is to keep all blocks the same size, or of a few assorted 
 sizes, and link them in lists because blocks of different sizes end up 
 fragmenting the memory too much and giving the garbage collector lots of 
 trouble, if all blocks are of the same size, they are immediately reusable. 
 Basically, if you are dealing with the memory yourself, assigning it, 
 freeing it, collecting garbage afterwards and defragmenting, you won't 
 resort that much to individual calls to the memory library functions, you 
 just grab a big chunk and manage it on your own.

I realize that, but in the absence of your own management system (option
2 you mention) it is superior to using malloc(), memcpy(), and free().

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] PHP URL issues

2007-03-14 Thread Jim Lucas

Steve wrote:
I personally have not unfortunately. A good friend of mine is also a 
developer who initially told me about it when I first began coding. Because 
I don't want to stick with the he-said, she-said approach, I did a quick 
google search and came up with this link:


http://spindrop.us/2007/03/03/php-double-versus-single-quotes/

There's several other pages saying similar things if you do look around.

Even the performance different isn't significant, it will add up. If 
something like this is known to help ever so slightly with execution time 
and it's something you can teach yourself to do subconsciously, then I feel 
it's definitely worthwhile to pursue.


Richard Lynch [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]

On Tue, March 13, 2007 9:31 am, Steve wrote:

This may or may not help, but here's a few things to note:

1) I would avoid placing variable output in double quoted strings.
While not
important for smaller scripts, doing a large number of outputs like
this
causes a decent performance hit. In fact, I wouldn't use double quotes
ever
in php. Instead, strive for something like:

echo 'ba href=test.php?term='.$letter_value.''.$letter_value.'
nbsp;/a/b';

Have you benchmarked this, or can you provide a link to others'
benchmarks demonstrating this perofmrnace hit?...

--
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So? 


Check out this page I just created using the example from the link that 
you provided.


I have grown off what the above examples page.

it takes a few seconds to load, so be patient.

http://www.cmsws.com/examples/php/speed_variables.php



--
Enjoy,

Jim Lucas

Different eyes see different things. Different hearts beat on different 
strings. But there are times for you and me when all such things agree.


- Rush

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



Re: [PHP] PHP URL issues

2007-03-13 Thread Don Don

I've just noticed that if am passing only one value it works fine, but when am 
passing in more than one none works.
   
  Why is that or what could be wrong ?
   
  e.g.  this works
  echo ba href='test.php?term=$letter_value'$letter_value nbsp;/a/b; 
on test.php i can display the value of term but with this
   
  echo ba href='test.php?term=$letter_valuetype=$type_value'$letter_value 
nbsp;/a/b; on test.php the values are empty.
  
Nikola Stjelja [EMAIL PROTECTED] wrote:
  If you are going to insert variables like $var_name in a string you need to 
enclose that string with double qoutations marks, not single. PHP will replace 
var names with values only inside double qoutations.

Hope that helps 

  On 3/12/07, Don Don [EMAIL PROTECTED] wrote:  I've got the following url 
rewriting problem.

  on page 1 i've got this

  p a href='page1.php?messageId=$tmpForumuserId=$user_id' See /a/p

  and on page 2 i've got this 

  $messageID = $_REQUEST[messageId];
$userID = $_REQUEST[userId];


when i check to see the values of these variables its says its empty, but when 
i place my cursor on the link in 
page 1 i can see both variables being show with their values in the browser.  
But on page 2 i cant get the values
Something seems wrong perharps ?

  Cheers


-
Now that's room service! Choose from over 150,000 hotels 
in 45,000 destinations on Yahoo! Travel to find your fit.



-- 
Please visit this site and play my RPG!  

http://www.1km1kt.net/rpg/Marinci.php 



 
-
Don't get soaked.  Take a quick peek at the forecast 
 with theYahoo! Search weather shortcut.

Re: [PHP] PHP URL issues

2007-03-13 Thread Don Don

I've just noticed that if am passing only one value it works fine, but when am 
passing in more than one none works.
   
  Why is that or what could be wrong ?
   
  e.g.  this works
  echo ba href='test.php?term=$letter_value'$letter_value nbsp;/a/b; 
on test.php i can display the value of term but with this
   
  echo ba href='test.php?term=$letter_valuetype=$type_value'$letter_value 
nbsp;/a/b; on test.php the values are empty.
  
Nikola Stjelja [EMAIL PROTECTED] wrote:
  If you are going to insert variables like $var_name in a string you need to 
enclose that string with double qoutations marks, not single. PHP will replace 
var names with values only inside double qoutations.

Hope that helps 

  On 3/12/07, Don Don [EMAIL PROTECTED] wrote:   I've got the following url 
rewriting problem.

  on page 1 i've got this

  p a href='page1.php?messageId=$tmpForumuserId=$user_id' See /a/p

  and on page 2 i've got this 

  $messageID = $_REQUEST[messageId];
$userID = $_REQUEST[userId];


when i check to see the values of these variables its says its empty, but when 
i place my cursor on the link in 
page 1 i can see both variables being show with their values in the browser.  
But on page 2 i cant get the values
Something seems wrong perharps ?

  Cheers


-
Now that's room service! Choose from over 150,000 hotels 
in 45,000 destinations on Yahoo! Travel to find your fit.



-- 
Please visit this site and play my RPG!  

http://www.1km1kt.net/rpg/Marinci.php 



 
-
Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives. Check it out.

Re: [PHP] PHP URL issues

2007-03-13 Thread Satyam
You should use urlencode() on variables that will go into URL arguments. 
You might have a whitespace in any of those variables and the URL stops at 
the first whitespace.  If those spaces are at the ends and are not 
significant, you might want to use trim().





- Original Message - 
From: Don Don [EMAIL PROTECTED]

To: PHP List php-general@lists.php.net
Sent: Tuesday, March 13, 2007 11:37 AM
Subject: Re: [PHP] PHP URL issues




I've just noticed that if am passing only one value it works fine, but 
when am passing in more than one none works.


 Why is that or what could be wrong ?

 e.g.  this works
 echo ba href='test.php?term=$letter_value'$letter_value 
nbsp;/a/b; on test.php i can display the value of term but with this


 echo ba 
href='test.php?term=$letter_valuetype=$type_value'$letter_value 
nbsp;/a/b; on test.php the values are empty.


Nikola Stjelja [EMAIL PROTECTED] wrote:
 If you are going to insert variables like $var_name in a string you need 
to enclose that string with double qoutations marks, not single. PHP will 
replace var names with values only inside double qoutations.


Hope that helps

 On 3/12/07, Don Don [EMAIL PROTECTED] wrote:  I've got the following 
url rewriting problem.


 on page 1 i've got this

 p a href='page1.php?messageId=$tmpForumuserId=$user_id' See /a/p

 and on page 2 i've got this

 $messageID = $_REQUEST[messageId];
$userID = $_REQUEST[userId];


when i check to see the values of these variables its says its empty, but 
when i place my cursor on the link in
page 1 i can see both variables being show with their values in the 
browser.  But on page 2 i cant get the values

Something seems wrong perharps ?

 Cheers


-
Now that's room service! Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.



--
Please visit this site and play my RPG!

http://www.1km1kt.net/rpg/Marinci.php




-
Don't get soaked.  Take a quick peek at the forecast
with theYahoo! Search weather shortcut.






No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.10/720 - Release Date: 12/03/2007 
19:19


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



Re: [PHP] PHP URL issues

2007-03-13 Thread Steve
This may or may not help, but here's a few things to note:

1) I would avoid placing variable output in double quoted strings. While not 
important for smaller scripts, doing a large number of outputs like this 
causes a decent performance hit. In fact, I wouldn't use double quotes ever 
in php. Instead, strive for something like:

echo 'ba href=test.php?term='.$letter_value.''.$letter_value.' 
nbsp;/a/b';

for your anchor statement. This translates to

echo 'ba 
href=test.php?term='.$letter_value.'amp;type='.$type_value.''.$letter_value.'
 
nbsp;/a/b';

for your second one.

2) If you didn't notice above, I replaced your  with the html entity 
equivalent amp;. I did this because I'm pretty stubborn when it comes to 
trying to keep things as close to strict following of the xhtml 1.0+ 
standards as I can.

If the URL still isn't working after that update, you have some more 
options:

1) First, I would double check that both variables have a value coming into 
that block of code. Output them before you create the url.

2) Then, I would isolate the url itself and see if you can print that out 
before putting it in the anchor statement. Something like:

$url = 'test.php?term='.$letter_value.'amp;type='.$type_value;

If you can echo that out, try putting that value back into the anchor:

echo 'a href='.$url.''.$letter_value.'/a';

3) If that doesn't work, try just passing the second value that wasn't 
working before.

If none of that works, double check the spelling of all variables and 
possibly start attempting to typecast the values appropriately. I have a 
feeling, though, it won't make it this far and by doing one of the above you 
will notice things start working or the mistake you made.


Don Don [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]

 I've just noticed that if am passing only one value it works fine, but 
 when am passing in more than one none works.

  Why is that or what could be wrong ?

  e.g.  this works
  echo ba href='test.php?term=$letter_value'$letter_value 
 nbsp;/a/b; on test.php i can display the value of term but with this

  echo ba 
 href='test.php?term=$letter_valuetype=$type_value'$letter_value 
 nbsp;/a/b; on test.php the values are empty.

 Nikola Stjelja [EMAIL PROTECTED] wrote:
  If you are going to insert variables like $var_name in a string you need 
 to enclose that string with double qoutations marks, not single. PHP will 
 replace var names with values only inside double qoutations.

 Hope that helps

  On 3/12/07, Don Don [EMAIL PROTECTED] wrote:  I've got the following 
 url rewriting problem.

  on page 1 i've got this

  p a href='page1.php?messageId=$tmpForumuserId=$user_id' See /a/p

  and on page 2 i've got this

  $messageID = $_REQUEST[messageId];
 $userID = $_REQUEST[userId];


 when i check to see the values of these variables its says its empty, but 
 when i place my cursor on the link in
 page 1 i can see both variables being show with their values in the 
 browser.  But on page 2 i cant get the values
 Something seems wrong perharps ?

  Cheers


 -
 Now that's room service! Choose from over 150,000 hotels
 in 45,000 destinations on Yahoo! Travel to find your fit.



 -- 
 Please visit this site and play my RPG!

 http://www.1km1kt.net/rpg/Marinci.php




 -
 Don't get soaked.  Take a quick peek at the forecast
 with theYahoo! Search weather shortcut. 

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



Re: [PHP] PHP URL issues

2007-03-13 Thread Don Don
$query_string = 'testId='. urlencode(trim($tmpTestId)) . 'userId=' . 
urlencode(trim($tmpUserId));
print 'pa href=viewpage.php?'. htmlentities($query_string) .' View Values 
/a/p';
   
  on view page i am trying to display the values using $_GET[value] and it sill 
returns 

Satyam [EMAIL PROTECTED] wrote:
  You should use urlencode() on variables that will go into URL arguments. 
You might have a whitespace in any of those variables and the URL stops at 
the first whitespace. If those spaces are at the ends and are not 
significant, you might want to use trim().




- Original Message - 
From: Don Don 

To: PHP List 

Sent: Tuesday, March 13, 2007 11:37 AM
Subject: Re: [PHP] PHP URL issues



 I've just noticed that if am passing only one value it works fine, but 
 when am passing in more than one none works.

 Why is that or what could be wrong ?

 e.g. this works
 echo $letter_value 
  ; on test.php i can display the value of term but with this

 echo  href='test.php?term=$letter_valuetype=$type_value'$letter_value 
  ; on test.php the values are empty.

 Nikola Stjelja wrote:
 If you are going to insert variables like $var_name in a string you need 
 to enclose that string with double qoutations marks, not single. PHP will 
 replace var names with values only inside double qoutations.

 Hope that helps

 On 3/12/07, Don Don 
wrote: I've got the following 
 url rewriting problem.

 on page 1 i've got this

   See 


 and on page 2 i've got this

 $messageID = $_REQUEST[messageId];
 $userID = $_REQUEST[userId];


 when i check to see the values of these variables its says its empty, but 
 when i place my cursor on the link in
 page 1 i can see both variables being show with their values in the 
 browser. But on page 2 i cant get the values
 Something seems wrong perharps ?

 Cheers


 -
 Now that's room service! Choose from over 150,000 hotels
 in 45,000 destinations on Yahoo! Travel to find your fit.



 -- 
 Please visit this site and play my RPG!

 http://www.1km1kt.net/rpg/Marinci.php




 -
 Don't get soaked. Take a quick peek at the forecast
 with theYahoo! Search weather shortcut.





No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.10/720 - Release Date: 12/03/2007 
19:19

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



 
-
We won't tell. Get more on shows you hate to love
(and love to hate): Yahoo! TV's Guilty Pleasures list.

Re: [PHP] PHP URL issues

2007-03-13 Thread Steve
Instead of trying to call specific $_GET values, try printing out the entire 
$_GET variable.

echo 'pre';
print_r($_GET);
echo '/pre';

Anything else there?

Don Don [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 $query_string = 'testId='. urlencode(trim($tmpTestId)) . 'userId=' . 
 urlencode(trim($tmpUserId));
 print 'pa href=viewpage.php?'. htmlentities($query_string) .' View 
 Values /a/p';

  on view page i am trying to display the values using $_GET[value] and it 
 sill returns 

 Satyam [EMAIL PROTECTED] wrote:
  You should use urlencode() on variables that will go into URL arguments.
 You might have a whitespace in any of those variables and the URL stops at
 the first whitespace. If those spaces are at the ends and are not
 significant, you might want to use trim().




 - Original Message - 
 From: Don Don

 To: PHP List

 Sent: Tuesday, March 13, 2007 11:37 AM
 Subject: Re: [PHP] PHP URL issues



 I've just noticed that if am passing only one value it works fine, but
 when am passing in more than one none works.

 Why is that or what could be wrong ?

 e.g. this works
 echo $letter_value
  ; on test.php i can display the value of term but with this

 echo  href='test.php?term=$letter_valuetype=$type_value'$letter_value
  ; on test.php the values are empty.

 Nikola Stjelja wrote:
 If you are going to insert variables like $var_name in a string you need
 to enclose that string with double qoutations marks, not single. PHP will
 replace var names with values only inside double qoutations.

 Hope that helps

 On 3/12/07, Don Don
 wrote: I've got the following
 url rewriting problem.

 on page 1 i've got this

   See


 and on page 2 i've got this

 $messageID = $_REQUEST[messageId];
 $userID = $_REQUEST[userId];


 when i check to see the values of these variables its says its empty, but
 when i place my cursor on the link in
 page 1 i can see both variables being show with their values in the
 browser. But on page 2 i cant get the values
 Something seems wrong perharps ?

 Cheers


 -
 Now that's room service! Choose from over 150,000 hotels
 in 45,000 destinations on Yahoo! Travel to find your fit.



 -- 
 Please visit this site and play my RPG!

 http://www.1km1kt.net/rpg/Marinci.php




 -
 Don't get soaked. Take a quick peek at the forecast
 with theYahoo! Search weather shortcut.


 


 No virus found in this incoming message.
 Checked by AVG Free Edition.
 Version: 7.5.446 / Virus Database: 268.18.10/720 - Release Date: 
 12/03/2007
 19:19

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




 -
 We won't tell. Get more on shows you hate to love
 (and love to hate): Yahoo! TV's Guilty Pleasures list. 

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



Re: [PHP] PHP URL issues

2007-03-13 Thread Satyam
I wouldn't do the htmlentities() on the whole argument list.  Depending on the 
Doctype version you have declared and depending how well implemented it is in 
each browser, it may render the argument list useless.  Unless you declared the 
strictest and latest version of HTML, all browsers will take a plain  in 
between arguments instead of an amp;. 

Haven't you seen the page source as received by the browser?  All browsers give 
you that option somewhere in their menues.   What does the URL look like in the 
Location box in the browser?  Just to know whether the problem is in the 
assembly of the URL or in reading it back.  If the URL shows correctly, try a 
var_dump($_GET).  Show it within a pre section so even whitespace is clearly 
visible.

Satyam

  - Original Message - 
  From: Don Don 
  To: Satyam ; PHP List 
  Sent: Tuesday, March 13, 2007 4:01 PM
  Subject: Re: [PHP] PHP URL issues


  $query_string = 'testId='. urlencode(trim($tmpTestId)) . 'userId=' . 
urlencode(trim($tmpUserId));
  print 'pa href=viewpage.php?'. htmlentities($query_string) .' View 
Values /a/p';

  on view page i am trying to display the values using $_GET[value] and it sill 
returns 

  Satyam [EMAIL PROTECTED] wrote:
You should use urlencode() on variables that will go into URL arguments. 
You might have a whitespace in any of those variables and the URL stops at 
the first whitespace. If those spaces are at the ends and are not 
significant, you might want to use trim().




- Original Message - 
From: Don Don 
To: PHP List 
Sent: Tuesday, March 13, 2007 11:37 AM
Subject: Re: [PHP] PHP URL issues



 I've just noticed that if am passing only one value it works fine, but 
 when am passing in more than one none works.

 Why is that or what could be wrong ?

 e.g. this works
 echo $letter_value 
  ; on test.php i can display the value of term but with this

 echo  href='test.php?term=$letter_valuetype=$type_value'$letter_value 
  ; on test.php the values are empty.

 Nikola Stjelja wrote:
 If you are going to insert variables like $var_name in a string you need 
 to enclose that string with double qoutations marks, not single. PHP will 
 replace var names with values only inside double qoutations.

 Hope that helps

 On 3/12/07, Don Don wrote: I've got the following 
 url rewriting problem.

 on page 1 i've got this

 
See 


 and on page 2 i've got this

 $messageID = $_REQUEST[messageId];
 $userID = $_REQUEST[userId];


 when i check to see the values of these variables its says its empty, but 
 when i place my cursor on the link in
 page 1 i can see both variables being show with their values in the 
 browser. But on page 2 i cant get the values
 Something seems wrong perharps ?

 Cheers


 -
 Now that's room service! Choose from over 150,000 hotels
 in 45,000 destinations on Yahoo! Travel to find your fit.



 -- 
 Please visit this site and play my RPG!

 http://www.1km1kt.net/rpg/Marinci.php




 -
 Don't get soaked. Take a quick peek at the forecast
 with theYahoo! Search weather shortcut.






No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.10/720 - Release Date: 12/03/2007 
19:19

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






--
  We won't tell. Get more on shows you hate to love
  (and love to hate): Yahoo! TV's Guilty Pleasures list.


--


  No virus found in this incoming message.
  Checked by AVG Free Edition.
  Version: 7.5.446 / Virus Database: 268.18.10/720 - Release Date: 12/03/2007 
19:19


[PHP] PHP URL issues

2007-03-12 Thread Don Don
I've got the following url rewriting problem.
   
  on page 1 i've got this
   
  p a href='page1.php?messageId=$tmpForumuserId=$user_id' See /a/p
   
  and on page 2 i've got this
   
  $messageID = $_REQUEST[messageId];
$userID = $_REQUEST[userId];
   
  
when i check to see the values of these variables its says its empty, but when 
i place my cursor on the link in
page 1 i can see both variables being show with their values in the browser.  
But on page 2 i cant get the values
Something seems wrong perharps ?
   
  Cheers

 
-
Now that's room service! Choose from over 150,000 hotels 
in 45,000 destinations on Yahoo! Travel to find your fit.

Re: [PHP] PHP URL issues

2007-03-12 Thread Tijnema !

On 3/12/07, Don Don [EMAIL PROTECTED] wrote:


I've got the following url rewriting problem.

on page 1 i've got this

p a href='page1.php?messageId=$tmpForumuserId=$user_id' See /a/p

and on page 2 i've got this

$messageID = $_REQUEST[messageId];
$userID = $_REQUEST[userId];


when i check to see the values of these variables its says its empty, but
when i place my cursor on the link in
page 1 i can see both variables being show with their values in the
browser.  But on page 2 i cant get the values
Something seems wrong perharps ?

Cheers



I don't know if it matters, but if the variables are coming from the url,
you could also retrieve them with $_GET
$messageID = $_GET[messageId];
$userID = $_GET[userId];

And in your link, i see it is pointing to page1.php, i don't know if that is
just a typo in the example

Tijnema

-

Now that's room service! Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.


Re: [PHP] PHP URL issues

2007-03-12 Thread Németh Zoltán
2007. 03. 12, hétfő keltezéssel 05.50-kor Don Don ezt írta:
 I've got the following url rewriting problem.

   on page 1 i've got this

   p a href='page1.php?messageId=$tmpForumuserId=$user_id' See /a/p

is this all within something like an echo statement with  marks?
otherwise the values might not display correctly


   and on page 2 i've got this

   $messageID = $_REQUEST[messageId];
 $userID = $_REQUEST[userId];

why use $_REQUEST? for this $_GET should be okay, and less confusing

hope that helps
Zoltán Németh


   
 when i check to see the values of these variables its says its empty, but 
 when i place my cursor on the link in
 page 1 i can see both variables being show with their values in the browser.  
 But on page 2 i cant get the values
 Something seems wrong perharps ?

   Cheers
 
  
 -
 Now that's room service! Choose from over 150,000 hotels 
 in 45,000 destinations on Yahoo! Travel to find your fit.

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



Re: [PHP] PHP URL issues

2007-03-12 Thread Richard Lynch
On Mon, March 12, 2007 7:50 am, Don Don wrote:
 I've got the following url rewriting problem.

   on page 1 i've got this

   p a href='page1.php?messageId=$tmpForumuserId=$user_id' See
 /a/p

   and on page 2 i've got this

   $messageID = $_REQUEST[messageId];
 $userID = $_REQUEST[userId];

You switched from Id to ID (capital 'D') and probably switched back
again in your 'echo' to see the values...

 when i check to see the values of these variables its says its empty,
 but when i place my cursor on the link in
 page 1 i can see both variables being show with their values in the
 browser.  But on page 2 i cant get the values
 Something seems wrong perharps ?

I am pretty sure that there are no harps involved.
:-)

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] url fopen() failed to open stream

2007-03-09 Thread Tijnema !

On 3/9/07, Michael Clayfield [EMAIL PROTECTED] wrote:


when i open up a url with fopen(), i get this error message:*

Warning*: fopen(http://sumurlhere.whatever/index.html) [function.fopen
http://127.0.0.1/bots2/function.fopen]: failed to open stream: A
connection attempt failed because the connected party did not properly
respond after a period of time, or established connection failed because
connected host has failed to respond. in
*C:\xampp\htdocs\bots2\main.php* on line *4
*
i believe this could because i am behind a proxy server, would someone
be able to confirm this? also if this is the problem, where would i set
the proxy server to be used?*
*



Maybe you could post your code, let's say line 1-5
I don't know a lot about proxy, but you might want to take a look at the
curl documentation, I don't know what your exactly gonna retrieve from the
server, but i think curl could do it.
curl documentation: www.php.net/curl

Tijnema

--

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




[PHP] url fopen() failed to open stream

2007-03-08 Thread Michael Clayfield

when i open up a url with fopen(), i get this error message:*

Warning*: fopen(http://sumurlhere.whatever/index.html) [function.fopen 
http://127.0.0.1/bots2/function.fopen]: failed to open stream: A 
connection attempt failed because the connected party did not properly 
respond after a period of time, or established connection failed because 
connected host has failed to respond. in 
*C:\xampp\htdocs\bots2\main.php* on line *4

*
i believe this could because i am behind a proxy server, would someone 
be able to confirm this? also if this is the problem, where would i set 
the proxy server to be used?*

*

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



Re: [PHP] url obfuscation

2006-07-13 Thread Richard Lynch
On Fri, July 7, 2006 10:56 pm, Anas Mughal wrote:
 My URLs are constant. They are not changing.
 All my dynamic pages are indexed nicely on Google.

 I agree that a computerized screen scrapper could still screen scrap
 most of
 my site. However, a simple script that attempts to bump up the
 identifier of
 a resource in a URL, would not work. Here is example:

 http://mydomain.com/view_resource.php?id=1
 http://mydomain.com/view_resource.php?id=2
 http://mydomain.com/view_resource.php?id=3
 http://mydomain.com/view_resource.php?id=4

 That would not work because my IDs are not sequential.

 Any thoughts...

Do your other pages link to the pages?

Because I don't need to PREDICT the URLs, just follow them from page
to page.

That's pretty much how a search engine works.

If you really want to stop a web-scraper, you pretty much have to
accept that you'll not be listed in Google (et al) as well.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



  1   2   3   4   5   >