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



[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] Template system in PHP

2008-02-13 Thread Xavier de Lapeyre
Lol...
If IE7 goes hun what?
I wonder what would happen in lt IE7 :)

GO FIREFOX!!!


Xavier



-Original Message-
From: Nathan Rixham [mailto:[EMAIL PROTECTED] 
Sent: mercredi 13 février 2008 01:27
To: php-general@lists.php.net
Subject: Re: [PHP] Template system in PHP

*sigh* as always, firefox obeys, ie7 goes huh what?

Nathan Rixham wrote:
 Are you creating custom DTD's or 1.1 XHTML Mods then? I'd like to see 
 that, it's something I'd toyed with a few times in the past but found it 
 far too time consuming (even for me), and opted for the ol' redefine 
 everything in CSS
 
 *lightbulb* :: runs off to try css on custom tags why have i never 
 tried that before :: ponders accessibility.. :: wanders off to waste 
 time researching anyways
 
 Robert Cummings wrote:
 On Tue, 2008-02-12 at 15:02 -0600, Greg Donald wrote:
 On Feb 12, 2008 2:57 PM, Robert Cummings [EMAIL PROTECTED] wrote:
 I prefer content formatting encapsulation as provided by custom tags.
 Decorators?

 Custom tags (XML style ones anyways) provide support for arbitrary
 ordering and omission of optional attributes. They nest nicer than
 function calls, and they have the same general formatting as the HTML
 with which you are working. Additionally, they provide the opportunity
 to punt anything not necessary at run-time to pre-compiled HTML.

 Cheers,
 Rob.

-- 
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] Template system in PHP

2008-02-13 Thread Xavier de Lapeyre
Sounds interesting...
Are your XML predefined or generated on the run? From say a DB?


Xavier

Please consider the environment before printing this mail note. 



-Original Message-
From: Nathan Rixham [mailto:[EMAIL PROTECTED] 
Sent: mercredi 13 février 2008 01:20
To: php-general@lists.php.net
Subject: Re: [PHP] Template system in PHP

Are you creating custom DTD's or 1.1 XHTML Mods then? I'd like to see 
that, it's something I'd toyed with a few times in the past but found it 
far too time consuming (even for me), and opted for the ol' redefine 
everything in CSS

*lightbulb* :: runs off to try css on custom tags why have i never 
tried that before :: ponders accessibility.. :: wanders off to waste 
time researching anyways

Robert Cummings wrote:
 On Tue, 2008-02-12 at 15:02 -0600, Greg Donald wrote:
 On Feb 12, 2008 2:57 PM, Robert Cummings [EMAIL PROTECTED] wrote:
 I prefer content formatting encapsulation as provided by custom tags.
 Decorators?
 
 Custom tags (XML style ones anyways) provide support for arbitrary
 ordering and omission of optional attributes. They nest nicer than
 function calls, and they have the same general formatting as the HTML
 with which you are working. Additionally, they provide the opportunity
 to punt anything not necessary at run-time to pre-compiled HTML.
 
 Cheers,
 Rob.

-- 
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] Template system in PHP

2008-02-13 Thread Xavier de Lapeyre
Wow,
Thnks...
Seems that are lots of routes to it.


Xavier de Lapeyre
Web Developer
Enterprise Data Services
www.eds.mu



Please consider the environment before printing this mail note. 



-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED] 
Sent: mercredi 13 février 2008 00:57
To: Shawn McKenzie
Cc: php-general@lists.php.net
Subject: Re: [PHP] Template system in PHP


On Tue, 2008-02-12 at 14:22 -0600, Shawn McKenzie wrote:
 Ryan A wrote:
  Add my vote too for Smarty 
  
  HTH,
  -R
  
  
  

  
  Looking for last minute shopping deals?  
  Find them fast with Yahoo! Search.  
  http://tools.search.yahoo.com/newsearch/category.php?category=shopping
 
 I like smarty and it's very powerful, however what you find is that it's
 just a less capable replacement for PHP.  If I want conditional
 statements to display HTML and/or loop through arrays, why would I want
 to do it in smarty tags?  Instead of moving display away from logic, it
 just replaces the logic with a different language.  When I use templates
 I pretty much want variable substitution.  My next project I'll probably
 use HTML files with little bits of PHP echos etc... sprinkled throughout.

I prefer content formatting encapsulation as provided by custom tags.

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

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



[PHP] Template system in PHP

2008-02-12 Thread Xavier de Lapeyre
Hi,
I need to develop a website, but my management is rather unstable in his
vision for the layout.
I'm thinking of developing the components as classes and functions, and
then use a template system to render the layout.
If the management wishes to change the layout, I'll just have to modify
my template and the jobs' done.

Do any of you guys  gurls know of a way to implement that template
system.

(The best one I know of is that of Wordpress)

Regards,
Xavier de Lapeyre
Web Developer

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



RE: [PHP] Question about development

2008-02-12 Thread Xavier de Lapeyre
Hi,
I usually use a MoSCoW Analysis.

http://en.wikipedia.org/wiki/MoSCoW_Method

From then on, I move into detailing each needs.
The S - Should have and C - could have parts are rather tricky if you are new 
to it.

So far this method has saved me more than once in many projects.

The most important aspects are the Must Have (which you should implement at all 
cost in the development cycle) and the Wont Have.
Correctly defining the Wont Haves is a must.
You won't like to have to re-do your whole development simply because you 
forgot to point out that there Wont have multiple languages.
Or that there Wont Have a forum in this version.

One little trick that I used now is the following point in the Won't Have 
section.  Any not mentioned above as default.


Dummy Site  
Version 1.X 
MoSCoW Analysis 

Must Have Features  
1   Registration FeatureAllows user to register to website
2   Login Feature   Allows user to login to website - Requires registration
3   Recover Pwd Feature Allows user to reset his password   - 
Unique email required - mail() function - Overwrite pwd with a random pwd - 
Send hash MD5
4   Search  Allows users to search for posts- basic search - 
advanced search
5   Product display
6   Add Products
7   Display latest news 

Should Have Features
1   Profile Updates Allows users to update their profiles.  - Change 
password
- Change display name
- Change information details
- Cannot change email

Could Have Features 
1   Forum
2   Chat

Wont Have Features  
1   Any not mentioned above 
2   Multiple Languages  


Xavier de Lapeyre
Web Developer

Please consider the environment before printing this mail note. 


-Original Message-
From: Jason Pruim [mailto:[EMAIL PROTECTED] 
Sent: mardi 12 février 2008 19:50
To: PHP-General General
Subject: [PHP] Question about development

Hi Everyone,

I know this isn't 100% on topic... But when is any post to this list  
100% on topic? :)

I've been doing some googling trying to find info on how to plan for  
what a website needs. Stuff like Does it need a forum, live support,  
database driven etc. etc. Does anyone have a form that they use to  
give to the client asking them to outline some ideas that they have  
about the website?

What I'm looking for is something that I could give to a potential  
client and ask them to describe some basic aspects of their target  
audience, a rough idea of what they want it to look like, or at least  
other sites that they like. Stuff like that..

Even if you don't have such a form, I'm sure you all have standard  
questions you ask each client before giving a quote :)

Anyone want to share with the class?

If there is interest, I may even put it together on a webpage to help  
future people :)
--

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

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



RE: [PHP] Assign variable to a block of html code

2007-12-20 Thread Xavier de Lapeyre
Yeps,
Sorry bout that.

Thnks for pointing it out.
Xavier



-Original Message-
From: Darren Whitlen [mailto:[EMAIL PROTECTED] 
Sent: jeudi 20 décembre 2007 13:13
To: php-general@lists.php.net
Subject: Re: [PHP] Assign variable to a block of html code

Xavier de Lapeyre wrote:
 You should try the HEREDOC structure. 
 See link: http://php.net/heredoc
 
 It should look to something like:
 
 $myblokvar = EOF
 table blabla
   tr
   td
   Welcome $name to this website! 
   /td
   /tr
 /table
 EOF;

Xavier,

You should test this before you send it.. it doesn't even parse!
The closing EOF should not start with the . It should only be the 
identifier (EOF) followed by ; and a new line.

-
$myblokvar = EOF
table blabla
.

EOF;
-

Darren

 
 No need of quotes or php start/end tags when placing a variable.
 
 To use it afterwards simply call the $mylokvar variable.
 
 Hope it helped!
 
 Xavier
 Web Developer
 Site: www.eds.mu
 
 
 
 
 -Original Message-
 From: Stephen Johnson [mailto:[EMAIL PROTECTED] 
 Sent: jeudi 20 décembre 2007 07:43
 To: php mail; PHP General List
 Subject: Re: [PHP] Assign variable to a block of html code
 
 What you have will work, you just need to escape out the double quotes in
 the html.  
 
 
 
 
 On 12/19/07 7:38 PM, php mail [EMAIL PROTECTED] wrote:
 
 Hi All,

 Is it possible to assign variable to a block of html code ?

 Something like this :

 $myblokvar = 
 table width=487 border=0 cellspacing=0 cellpadding=0
   tr
 tdtable width=487 border=0 cellspacing=0 cellpadding=0
   tr
 tdimg src=images/bartitle_login.gif alt=Login width=475
 height=30 //td
 tdnbsp;/td
   /tr
   tr
 td class=produktable width=100% border=0 cellpadding=3
 cellspacing=2
   tr
 td class=katalog
 ?=$log_info?
 /td
   /tr
   /table/td
 tdnbsp;/td
   /tr
   tr
 td class=produknbsp;/td
 tdnbsp;/td
   /tr
 /table/td
   /tr
 /table
 ;

 Although example above is not working, what I want to achieve is something
 like that. Is it possible how can I do that ?

 Regards,

 Feris
 

-- 
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] Assign variable to a block of html code

2007-12-20 Thread Xavier de Lapeyre
Quote:

You could just swap all the double quotes in the HTML tags for single quotes -
that would work in this instance...

$myblokvar = 
table width='487' border='0' cellspacing='0' cellpadding='0'
...
/table
;


That's a way too, but it does not preserve the indentation.
The HEREDOC syntax behave much like the pre HTML tag for PHP, and it also 
removed the hassle of placing escape tags!

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





-Original Message-
From: Peter Ford [mailto:[EMAIL PROTECTED] 
Sent: jeudi 20 décembre 2007 13:17
To: php-general@lists.php.net
Subject: Re: [PHP] Assign variable to a block of html code

You could just swap all the double quotes in the HTML tags for single quotes -
that would work in this instance...

$myblokvar = 
table width='487' border='0' cellspacing='0' cellpadding='0'
...
/table
;


Or perhaps a HereDoc syntax:

$myblokvar = EndOfMyHTMLBlock
table width=487 border=0 cellspacing=0 cellpadding=0
...
/table
EndOfMyHTMLBlock;

Then you don't need to worry about what quotes you use, and if you start putting
stuff like onclick events in you can mix quotes up happily ...


I go to great lengths to avoid escaping quotes - it just looks ugly.
That is, however, a personal foible.

Cheers
Pete


Stephen Johnson wrote:
 What you have will work, you just need to escape out the double quotes in
 the html.  
 
 
 
 
 On 12/19/07 7:38 PM, php mail [EMAIL PROTECTED] wrote:
 
 Hi All,

 Is it possible to assign variable to a block of html code ?

 Something like this :

 $myblokvar = 
 table width=487 border=0 cellspacing=0 cellpadding=0
   tr
 tdtable width=487 border=0 cellspacing=0 cellpadding=0
   tr
 tdimg src=images/bartitle_login.gif alt=Login width=475
 height=30 //td
 tdnbsp;/td
   /tr
   tr
 td class=produktable width=100% border=0 cellpadding=3
 cellspacing=2
   tr
 td class=katalog
 ?=$log_info?
 /td
   /tr
   /table/td
 tdnbsp;/td
   /tr
   tr
 td class=produknbsp;/td
 tdnbsp;/td
   /tr
 /table/td
   /tr
 /table
 ;

 Although example above is not working, what I want to achieve is something
 like that. Is it possible how can I do that ?

 Regards,

 Feris
 

-- 
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] Just to confirm...

2007-12-20 Thread Xavier de Lapeyre
 ?
 if(stristr($_SERVER['HTTP_USER_AGENT'],msie)) {
 die(No friend of Internet Exploder is a friend of mine.);
 }
 ?

Lol!!! I need to implement that on ALL my sites ... XD!!


Xavier de Lapeyre




-Original Message-
From: Richard Heyes [mailto:[EMAIL PROTECTED] 
Sent: jeudi 20 décembre 2007 14:26
To: Daniel Brown
Cc: Stut; [EMAIL PROTECTED]; Zoltán Németh; PHP General List
Subject: Re: [PHP] Just to confirm...

 Bah!  You're right, I changed it to just be an easter egg in the
 code.  The original (now commented out) was:
 ?
 if(stristr($_SERVER['HTTP_USER_AGENT'],msie)) {
 die(No friend of Internet Exploder is a friend of mine.);
 }
 ?
 
 It initially started to try to stop cURL, wget, Lynx, and other
 automated clients from grabbing the content from the page.  Again, I
 know that headers can be spoofed, but that's a different topic.  I try
 to make a joke and Stut shoots me in the ass.  ;-P

I've got to ask, why on earth would you want to do this? Robots and 
things like wget I could understand more, but purposefully cutting out a 
large chunk of your audience?

-- 
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

-- 
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] Assign variable to a block of html code

2007-12-19 Thread Xavier de Lapeyre
You should try the HEREDOC structure. 
See link: http://php.net/heredoc

It should look to something like:

$myblokvar = EOF
table blabla
tr
td
Welcome $name to this website! 
/td
/tr
/table
EOF;

No need of quotes or php start/end tags when placing a variable.

To use it afterwards simply call the $mylokvar variable.

Hope it helped!

Xavier
Web Developer
Site: www.eds.mu




-Original Message-
From: Stephen Johnson [mailto:[EMAIL PROTECTED] 
Sent: jeudi 20 décembre 2007 07:43
To: php mail; PHP General List
Subject: Re: [PHP] Assign variable to a block of html code

What you have will work, you just need to escape out the double quotes in
the html.  




On 12/19/07 7:38 PM, php mail [EMAIL PROTECTED] wrote:

 Hi All,
 
 Is it possible to assign variable to a block of html code ?
 
 Something like this :
 
 $myblokvar = 
 table width=487 border=0 cellspacing=0 cellpadding=0
   tr
 tdtable width=487 border=0 cellspacing=0 cellpadding=0
   tr
 tdimg src=images/bartitle_login.gif alt=Login width=475
 height=30 //td
 tdnbsp;/td
   /tr
   tr
 td class=produktable width=100% border=0 cellpadding=3
 cellspacing=2
   tr
 td class=katalog
 ?=$log_info?
 /td
   /tr
   /table/td
 tdnbsp;/td
   /tr
   tr
 td class=produknbsp;/td
 tdnbsp;/td
   /tr
 /table/td
   /tr
 /table
 ;
 
 Although example above is not working, what I want to achieve is something
 like that. Is it possible how can I do that ?
 
 Regards,
 
 Feris

-- 
Stephen Johnson
The Lone Coder

http://www.ouradoptionblog.com
*Join us on our adoption journey*

[EMAIL PROTECTED]
http://www.thelonecoder.com

*Continuing the struggle against bad code*
--

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