Re: [PHP] Variable Variables and Super Global Arrays

2008-10-12 Thread Richard Heyes
> $varname = "\$_SERVER['REMOTE_ADDR']";
> $varvalue = $$varname;

That's wrong. Offhand you'll end up printing a string. I tried this:



And it was fine.

-- 
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org

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



Re: [PHP] template usage

2008-10-12 Thread Alain Roger
I'm just reading a book on PHP and they promote quite heavily smarty as
template designer tool for presenting information and data to users.

they absolutly do not talk about pear and i'm a little surprised. That's why
i'm wondering who use what and for which reason.

Basically let's say for data/information presentation to end user...what is
the best lib (pear, smarty) ?

On Sun, Oct 12, 2008 at 11:32 AM, Ashley Sheridan
<[EMAIL PROTECTED]>wrote:

> On Sun, 2008-10-12 at 11:09 +0200, Alain Roger wrote:
> > Hi,
> >
> > i would like to know if you are a lot to use PHP templates for your web
> > application or web sites ?
> > if yes, which one do you use (smarty, pear, yapter, phplib,...) ?
> > and for which reason ? what is/are the advantages over the others ?
> >
> > thanks a lot,
> >
> I wouldn't really call them templates, they're more libraries, and they
> all have their individual uses. Generally, your use of them will depend
> on what you actually want.
>
> Can you explain a few details of what you are actually looking to do?
>
>
> Ash
> www.ashleysheridan.co.uk
>
>


-- 
Alain

Windows XP SP3
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008


Re: [PHP] template usage

2008-10-12 Thread Ashley Sheridan
On Sun, 2008-10-12 at 11:33 +0200, Alain Roger wrote:
> I'm just reading a book on PHP and they promote quite heavily smarty as
> template designer tool for presenting information and data to users.
> 
> they absolutly do not talk about pear and i'm a little surprised. That's why
> i'm wondering who use what and for which reason.
> 
> Basically let's say for data/information presentation to end user...what is
> the best lib (pear, smarty) ?
> 
> On Sun, Oct 12, 2008 at 11:32 AM, Ashley Sheridan
> <[EMAIL PROTECTED]>wrote:
> 
> > On Sun, 2008-10-12 at 11:09 +0200, Alain Roger wrote:
> > > Hi,
> > >
> > > i would like to know if you are a lot to use PHP templates for your web
> > > application or web sites ?
> > > if yes, which one do you use (smarty, pear, yapter, phplib,...) ?
> > > and for which reason ? what is/are the advantages over the others ?
> > >
> > > thanks a lot,
> > >
> > I wouldn't really call them templates, they're more libraries, and they
> > all have their individual uses. Generally, your use of them will depend
> > on what you actually want.
> >
> > Can you explain a few details of what you are actually looking to do?
> >
> >
> > Ash
> > www.ashleysheridan.co.uk
> >
> >
> 
> 
I'm not sure comparing Pear and Smarty is really how to go about it.
It's a bit like comparing a apples and oranges. Smarty is indeed a
template/presentation framework, but Pear is more a library of
components (as is phplib) which offers some presentation components, but
isn't solely designed towards that purpose. Personally, if I were you,
I'd go with Smarty for the time being, as it has been designed as a
template engine, so it should be easier to get to grips with.


Ash
www.ashleysheridan.co.uk


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



RE: [PHP] trouble uploading more than 500 bytes...

2008-10-12 Thread Karl St-Jacques
> > Hello, > > > > I have trouble uploading files to a server. Actually I can't 
> > upload more than 500 bytes or so.> > > > Here's a quick print_r of the 
> > $_FILES > > > > [_FILES] => Array( [avatar] => Array ( [name] => index.html 
> > [type] => text/html [tmp_name] => /tmp/phpRbmXK5 [error] => 0 [size] => 505 
> > ))> > If I try bigger file (540 bytes or 2mb) it's simply return this. > > 
> > > > [_FILES] => Array([avatar] => Array( [name] => ajax-loader.gif [type] 
> > => [tmp_name] => [error] => 3 [size] => 0)> > )> > > > error 3 is partial 
> > files sended. (By the way, there's no processing, only a print_r();> > > > 
> > So here's my setup from the php.ini> > > > PHP Version 5.2.4-2ubuntu5.3> > 
> > > > max_execution_time 1000 1000 > > max_input_nesting_level 64 64 > > 
> > max_input_time 1000 1000 > > memory_limit 999M 999M> > post_max_size 200M 
> > 200M> > upload_max_filesize 200M 200M> > upload_tmp_dir no value no value> 
> > > > > > > I run Apache/2.2.8> > > > I checked the /tmp folder. it's empty, 
> > even if uploading really big file, same for /var/tmp. the permission seems 
> > to be ok (chmod 777).> > > > So, I'm pretty clueless about that one.> > 
> > Anyone have any insight about this ? > > > > Thanks, > > Karl.> > > > 
> > _> > > Bit 
> > of a silly question, but it's bit me in the ass before. Are you sure> 
> > you're editing the right php.ini file? I was working on a server at work> 
> > where someone had left 3 php.ini files, all in places that looked like> 
> > they were meant to be, and the only way to find the real one was through> a 
> > phpinfo() check. Also, have you restarted the web server (Apache or> IIS) 
> > since making the changes?> > > Ash> www.ashleysheridan.co.uk> 
(Do you have rules or code of conduct for reply in this mailing list ?)
 
Yup, the setting I wrote was the setting I took directly from the phpinfo(); 
And I restarted apache more than enough for the next 2 years (even the server 
:| ).
 
I'm totally lost about that one ! 
 
Thank,
Karl
_



[PHP] template usage

2008-10-12 Thread Alain Roger
Hi,

i would like to know if you are a lot to use PHP templates for your web
application or web sites ?
if yes, which one do you use (smarty, pear, yapter, phplib,...) ?
and for which reason ? what is/are the advantages over the others ?

thanks a lot,

-- 
Alain

Windows XP SP3
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008


Re: [PHP] trouble uploading more than 500 bytes...

2008-10-12 Thread Ashley Sheridan
On Sat, 2008-10-11 at 22:31 -0400, Karl St-Jacques wrote:
> Hello, 
>  
> I have trouble uploading files to a server. Actually I can't upload more than 
> 500 bytes or so.
>  
> Here's a quick print_r of the $_FILES 
>  
> [_FILES] => Array(  [avatar] => Array  ([name] => index.html[type] => 
> text/html[tmp_name] => /tmp/phpRbmXK5[error] => 0[size] => 505  ))
> If I try bigger file (540 bytes or 2mb) it's simply return this. 
>  
> [_FILES] => Array([avatar] => Array(  [name] => ajax-loader.gif  [type] =>   
> [tmp_name] =>   [error] => 3  [size] => 0)
> )
>  
> error 3 is partial files sended. (By the way, there's no processing, only a 
> print_r();
>  
> So here's my setup from the php.ini
>  
> PHP Version 5.2.4-2ubuntu5.3
>  
> max_execution_time 1000 1000 
> max_input_nesting_level 64 64 
> max_input_time 1000 1000 
> memory_limit 999M 999M
> post_max_size 200M 200M
> upload_max_filesize 200M 200M
> upload_tmp_dir no value no value
> 
> 
> I run Apache/2.2.8
>  
> I checked the /tmp folder. it's empty, even if uploading really big file, 
> same for /var/tmp. the permission seems to be ok (chmod 777).
>  
> So, I'm pretty clueless about that one.
> Anyone have any insight about this ? 
>  
> Thanks, 
> Karl.
>  
> _
> 
Bit of a silly question, but it's bit me in the ass before. Are you sure
you're editing the right php.ini file? I was working on a server at work
where someone had left 3 php.ini files, all in places that looked like
they were meant to be, and the only way to find the real one was through
a phpinfo() check. Also, have you restarted the web server (Apache or
IIS) since making the changes?


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] template usage

2008-10-12 Thread Ashley Sheridan
On Sun, 2008-10-12 at 11:09 +0200, Alain Roger wrote:
> Hi,
> 
> i would like to know if you are a lot to use PHP templates for your web
> application or web sites ?
> if yes, which one do you use (smarty, pear, yapter, phplib,...) ?
> and for which reason ? what is/are the advantages over the others ?
> 
> thanks a lot,
> 
I wouldn't really call them templates, they're more libraries, and they
all have their individual uses. Generally, your use of them will depend
on what you actually want.

Can you explain a few details of what you are actually looking to do?


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] Re: Remove index.php from url

2008-10-12 Thread Ashley Sheridan
On Sat, 2008-10-11 at 18:56 +0100, Richard Heyes wrote:

> > mod_rewite if you use Apache.
> 
> Or, if you don't have it (not very likely), directories. Eg For the
> URL you gave, make a dir called company and put a default document in
> there (usually index.html). You will end up with a trailing slash on
> the URL, and it does incur a redirect, but it works. This might even
> work with IIS, so it would be cross-server compatible.
> 
> -- 
> Richard Heyes
> 
> HTML5 Graphing for FF, Chrome, Opera and Safari:
> http://www.rgraph.org
> 

Thanks everyone, I'll look into these in a bit more depth when I get
back into work tomorrow.


Ash
www.ashleysheridan.co.uk


RE: [PHP] trouble uploading more than 500 bytes...

2008-10-12 Thread Ashley Sheridan
On Sun, 2008-10-12 at 07:54 -0400, Karl St-Jacques wrote:
> > > Hello, > > > > I have trouble uploading files to a server. Actually I 
> > > can't upload more than 500 bytes or so.> > > > Here's a quick print_r of 
> > > the $_FILES > > > > [_FILES] => Array( [avatar] => Array ( [name] => 
> > > index.html [type] => text/html [tmp_name] => /tmp/phpRbmXK5 [error] => 0 
> > > [size] => 505 ))> > If I try bigger file (540 bytes or 2mb) it's simply 
> > > return this. > > > > [_FILES] => Array([avatar] => Array( [name] => 
> > > ajax-loader.gif [type] => [tmp_name] => [error] => 3 [size] => 0)> > )> > 
> > > > > error 3 is partial files sended. (By the way, there's no processing, 
> > > only a print_r();> > > > So here's my setup from the php.ini> > > > PHP 
> > > Version 5.2.4-2ubuntu5.3> > > > max_execution_time 1000 1000 > > 
> > > max_input_nesting_level 64 64 > > max_input_time 1000 1000 > > 
> > > memory_limit 999M 999M> > post_max_size 200M 200M> > upload_max_filesize 
> > > 200M 200M> > upload_tmp_dir no value no value> > > > > > I run 
> > > Apache/2.2.8> > > > I checked the /tmp folder. it's empty, even if 
> > > uploading really big file, same for /var/tmp. the permission seems to be 
> > > ok (chmod 777).> > > > So, I'm pretty clueless about that one.> > Anyone 
> > > have any insight about this ? > > > > Thanks, > > Karl.> > > > 
> > > _> > > 
> > > Bit of a silly question, but it's bit me in the ass before. Are you sure> 
> > > you're editing the right php.ini file? I was working on a server at work> 
> > > where someone had left 3 php.ini files, all in places that looked like> 
> > > they were meant to be, and the only way to find the real one was through> 
> > > a phpinfo() check. Also, have you restarted the web server (Apache or> 
> > > IIS) since making the changes?> > > Ash> www.ashleysheridan.co.uk> 
> (Do you have rules or code of conduct for reply in this mailing list ?)
>  
> Yup, the setting I wrote was the setting I took directly from the phpinfo(); 
> And I restarted apache more than enough for the next 2 years (even the server 
> :| ).
>  
> I'm totally lost about that one ! 
>  
> Thank,
> Karl
> _
> 
No, not sure where the code of conduct is, but hang about for a while
and you should get the general idea ;)

As for your problem, I had a quick look at the error code you're
getting, and it means that the file was only partially uploaded. Is the
file being changed on your local machine before it's being uploaded?
Also, try to see if you can test the same script with different
browsers, and if possible on a different server. That should isolate
where the problem is.


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] Setcookie()

2008-10-12 Thread Bastien Koert
On Sat, Oct 11, 2008 at 12:33 PM, Per Jessen <[EMAIL PROTECTED]> wrote:

> Ben Stones wrote:
>
> > What I mean is I cannot use setcookie, I need to check if user
> > credentials are correct first (which is BEFORE setcookie) and if so,
> > set a cookie. I can't do that unless setcookie is first, but I need to
> > check if the user credentials is correct. Furthermore I cannot use
> > setcookie in the header as I want to display a message saying that
> > they have successfully logged in in the correct area of my template.
>
> Well, I'm doing exactly that and it works just fine. This is a rough
> outline of the flow:
>
> GET (form with user and password fields)
> POST 
>
> validate user+password, save in session
> setcookie().
> redirect with 303 to 
>
> GET 
>
>
> /Per Jessen, Zürich
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> Its likely just a little html or a blank line that is setting the headers
before you are attempting to set the cookie


-- 

Bastien

Cat, the other other white meat


Re: [PHP] trouble uploading more than 500 bytes...

2008-10-12 Thread Daniel Brown
On Sun, Oct 12, 2008 at 8:58 AM, Ashley Sheridan
<[EMAIL PROTECTED]> wrote:
>>
> No, not sure where the code of conduct is, but hang about for a while
> and you should get the general idea ;)

Just the stuff at http://php.net/mailinglists.

-- 

More full-root dedicated server packages:
Intel 2.4GHz/60GB/512MB/2TB $49.99/mo.
Intel 3.06GHz/80GB/1GB/2TB $59.99/mo.
Intel 2.4GHz/320/GB/1GB/3TB $74.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] Variable Variables and Super Global Arrays

2008-10-12 Thread Micah Gersten
That's fine as a test, but you never want to get a variable name from a
URL in practice.

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



Richard Heyes wrote:
>> $varname = "\$_SERVER['REMOTE_ADDR']";
>> $varvalue = $$varname;
>> 
>
> That's wrong. Offhand you'll end up printing a string. I tried this:
>
>  $a   = 365;
> $b   = 366;
>
> $var = $_GET['var'];
>
> echo $$var;
> ?>
>
> And it was fine.
>
>   

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



Re: [PHP] Variable Variables and Super Global Arrays

2008-10-12 Thread Richard Heyes
> That's fine as a test, but you never want to get a variable name from a
> URL in practice.

Of course you can, as long as it's sanitized and checked.

-- 
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org

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



[PHP] RewriteRule

2008-10-12 Thread Ron Piggott
I am needing to pass 2 variables in a script I am writing.  Does anyone
know how to do this?

http://www.domain.com/blog/1/2/

I know how to pass 1; I have no idea how to write a rewrite rule to pass
the 2 as well.

Thanks,

Ron


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



[PHP] Re: template usage

2008-10-12 Thread Nathan Rixham

Alain Roger wrote:

Hi,

i would like to know if you are a lot to use PHP templates for your web
application or web sites ?
if yes, which one do you use (smarty, pear, yapter, phplib,...) ?
and for which reason ? what is/are the advantages over the others ?

thanks a lot,



I'd vote smarty or using xslt; smarty is very good and nine out of 10 
designers I know prefer it.


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



[PHP] HTML5 canvas tag

2008-10-12 Thread Richard Heyes
Hi,

Not quite PHP, but since you're all web developers you may well be
interested in this:

http://www.phpguru.org/static/canvas.html

It's a short piece on the new HTML5 canvas tag. Bonza.

-- 
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org

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



Re: [PHP] Variable Variables and Super Global Arrays

2008-10-12 Thread Micah Gersten
I mean that it is open for hacking if you pass a variable name through a
URL.

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



daniel danon wrote:
> What do you mean?
>
> On Sun, Oct 12, 2008 at 5:40 PM, Micah Gersten <[EMAIL PROTECTED]
> > wrote:
>
> That's fine as a test, but you never want to get a variable name
> from a
> URL in practice.
>
> Thank you,
> Micah Gersten
> onShore Networks
> Internal Developer
> http://www.onshore.com
>
>
>
> Richard Heyes wrote:
> >> $varname = "\$_SERVER['REMOTE_ADDR']";
> >> $varvalue = $$varname;
> >>
> >
> > That's wrong. Offhand you'll end up printing a string. I tried this:
> >
> >  > $a   = 365;
> > $b   = 366;
> >
> > $var = $_GET['var'];
> >
> > echo $$var;
> > ?>
> >
> > And it was fine.
> >
> >
>
> --
> 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] Re: template usage

2008-10-12 Thread Ashley Sheridan
On Sun, 2008-10-12 at 18:04 +0100, Nathan Rixham wrote:
> Alain Roger wrote:
> > Hi,
> > 
> > i would like to know if you are a lot to use PHP templates for your web
> > application or web sites ?
> > if yes, which one do you use (smarty, pear, yapter, phplib,...) ?
> > and for which reason ? what is/are the advantages over the others ?
> > 
> > thanks a lot,
> > 
> 
> I'd vote smarty or using xslt; smarty is very good and nine out of 10 
> designers I know prefer it.
> 
XSLT is for transforming XML documents, so not good for use as a PHP
template!


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] template usage

2008-10-12 Thread Robert Cummings
On Sun, 2008-10-12 at 11:09 +0200, Alain Roger wrote:
> Hi,
> 
> i would like to know if you are a lot to use PHP templates for your web
> application or web sites ?
> if yes, which one do you use (smarty, pear, yapter, phplib,...) ?
> and for which reason ? what is/are the advantages over the others ?

I use TemplateJinn :)

Unlike almost every other template engine out there it doesn't require
the framework be instantiated at runtime. It can be used to generate
static HTML files or it can be used in conjunction with InterJinn or
other frameworks. For instance, I use TemplateJinn to organize and build
my MediaWiki skins too. Usually when I create a template I pull out into
separate file logically distinct layout elements. For example the header
is in it's own template, any layout panes such as banner, left column,
right column, footer, and content area are also in their own file. Then,
I use a template that groups these together where I want them.
Additionally, for often use elements I will create a custom tag so that
I can just use a single tag to simpify and centralize rendering. An
example being MediaWiki's concept of a portlet. For these I just do:


My content goes here


This generates the wrapping divs for the portlet that enables easy CSS
customization and future proofs my design so that if ever I want more
elements to the portlet design I can just change the custom tag code and
recompile the skin. MediaWiki never has to know anything about InterJinn
or TemplateJinn or that the skin it is using was create via a template
engine.

Interestingly there was a recent thread about frameworks and someone
posted a blog where some guy did a benchmark using various frameworks.
Well "Hello World" if done in InterJinn would probably be done as a
static template compilation (one expects the developer to use the right
framework tool), and thus would be on par with Apache's static content
load (faster than PHP). In other words the benchmark is a load of crap
since if you use a tool properly there are ways to make it perform while
still having the convenience of a Framework. As such, TemplateJinn can
be leveraged via InterJinn so that static content pages use the same
layout as the entire site but for which the layout was generated at site
compilation time and can be requested subsequently without invoking the
PHP engine. My guess though, is that the guy would have implemented
"Hello World" with InterJinn via a module instead of using the
appropriate framework tool just so he could crap on frameworks some
more :)

The downside... for some anyways... of the TemplateJinn system, is that
you need to be comfortable editing your HTML by hand. There's no WYSIWYG
for custom tags. Personally, I prefer hand crafting my HTML layouts. I
find the browser itself to be the best available WYSIWYG.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


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



Re: [PHP] HTML5 canvas tag

2008-10-12 Thread Ashley Sheridan
On Sun, 2008-10-12 at 18:21 +0100, Richard Heyes wrote:
> Hi,
> 
> Not quite PHP, but since you're all web developers you may well be
> interested in this:
> 
> http://www.phpguru.org/static/canvas.html
> 
> It's a short piece on the new HTML5 canvas tag. Bonza.
> 
> -- 
> Richard Heyes
> 
> HTML5 Graphing for FF, Chrome, Opera and Safari:
> http://www.rgraph.org
> 
Hmm, it doesn't mention which versions of the browsers it lists are
capable of displaying the canvas tag. I'm still using Firefox 2 on this
computer, and all I got was 5 horizontal bands of grey and blue.


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] Re: template usage

2008-10-12 Thread Nathan Rixham

Ashley Sheridan wrote:

On Sun, 2008-10-12 at 18:04 +0100, Nathan Rixham wrote:

Alain Roger wrote:

Hi,

i would like to know if you are a lot to use PHP templates for your web
application or web sites ?
if yes, which one do you use (smarty, pear, yapter, phplib,...) ?
and for which reason ? what is/are the advantages over the others ?

thanks a lot,

I'd vote smarty or using xslt; smarty is very good and nine out of 10 
designers I know prefer it.



XSLT is for transforming XML documents, so not good for use as a PHP
template!


Ash
www.ashleysheridan.co.uk



I guess it depends how you program, personally I like to program 
everything API style nowadays, dumping out my script output/objects as 
XML then transforming where needed with XSL; you can do it client side 
or server side using http://php.net/manual/en/book.xsl.php - it is a 
nice portable way of doing things (especially when having multiple front 
ends (or using the same system for multiple sites), however as a 
standard stick these variables into this bit of the (x)html then a 
conventional "template engine" is what you need.



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



[PHP] Re: HTML5 canvas tag

2008-10-12 Thread Nathan Rixham

Richard Heyes wrote:

Hi,

Not quite PHP, but since you're all web developers you may well be
interested in this:

http://www.phpguru.org/static/canvas.html

It's a short piece on the new HTML5 canvas tag. Bonza.



very fine work mr heyes, I've been most impressed by you're RGraph - a 
great use for the canvas!


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



Re: [PHP] Re: Re: Remove index.php from url

2008-10-12 Thread Nathan Rixham

Ashley Sheridan wrote:

That wasn't what I was asking. I meant is there an equivalent to
mod-rewrite for IIS? 


old one but ISAPI Rewrite is the pretty much standard implementation

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



Re: [PHP] RewriteRule

2008-10-12 Thread Daniel Brown
On Sun, Oct 12, 2008 at 12:57 PM, Ron Piggott
<[EMAIL PROTECTED]> wrote:
> I am needing to pass 2 variables in a script I am writing.  Does anyone
> know how to do this?
>
> http://www.domain.com/blog/1/2/
>
> I know how to pass 1; I have no idea how to write a rewrite rule to pass
> the 2 as well.

That's an Apache question, Ron, but it's a matter of using
RewriteRule to parse $1 and $2 (and so forth).

-- 

More full-root dedicated server packages:
Intel 2.4GHz/60GB/512MB/2TB $49.99/mo.
Intel 3.06GHz/80GB/1GB/2TB $59.99/mo.
Intel 2.4GHz/320/GB/1GB/3TB $74.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] HTML5 canvas tag

2008-10-12 Thread Daniel Brown
On Sun, Oct 12, 2008 at 1:50 PM, Ashley Sheridan
<[EMAIL PROTECTED]> wrote:
>>
> Hmm, it doesn't mention which versions of the browsers it lists are
> capable of displaying the canvas tag. I'm still using Firefox 2 on this
> computer, and all I got was 5 horizontal bands of grey and blue.

Check your addons and such, Ashley.  Gecko itself (the HTML
rendering engine used in Firefox) has supported  since 1.8 I
believe, which equated to Firefox 1.5.

-- 

More full-root dedicated server packages:
Intel 2.4GHz/60GB/512MB/2TB $49.99/mo.
Intel 3.06GHz/80GB/1GB/2TB $59.99/mo.
Intel 2.4GHz/320/GB/1GB/3TB $74.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] HTML5 canvas tag

2008-10-12 Thread Ashley Sheridan
On Sun, 2008-10-12 at 14:15 -0400, Daniel Brown wrote:
> On Sun, Oct 12, 2008 at 1:50 PM, Ashley Sheridan
> <[EMAIL PROTECTED]> wrote:
> >>
> > Hmm, it doesn't mention which versions of the browsers it lists are
> > capable of displaying the canvas tag. I'm still using Firefox 2 on this
> > computer, and all I got was 5 horizontal bands of grey and blue.
> 
> Check your addons and such, Ashley.  Gecko itself (the HTML
> rendering engine used in Firefox) has supported  since 1.8 I
> believe, which equated to Firefox 1.5.
> 
What add-ons would I be looking for? I was under the impression canvas
support is built in at browser level, not plugin level.


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] Re: template usage

2008-10-12 Thread Micah Gersten
The problem with smarty is that they are still using PHP4 as their main
language so they cannot take advantage of speed improvements in PHP5.
So, my suggestion is that if you're stuck with PHP4, go with smarty,
otherwise, find another engine that's up to date.

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



Nathan Rixham wrote:
> Alain Roger wrote:
>> Hi,
>>
>> i would like to know if you are a lot to use PHP templates for your web
>> application or web sites ?
>> if yes, which one do you use (smarty, pear, yapter, phplib,...) ?
>> and for which reason ? what is/are the advantages over the others ?
>>
>> thanks a lot,
>>
>
> I'd vote smarty or using xslt; smarty is very good and nine out of 10
> designers I know prefer it.
>

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



Re: [PHP] HTML5 canvas tag

2008-10-12 Thread Daniel Brown
On Sun, Oct 12, 2008 at 2:21 PM, Ashley Sheridan
<[EMAIL PROTECTED]> wrote:
>>
> What add-ons would I be looking for? I was under the impression canvas
> support is built in at browser level, not plugin level.

And that impression would be correct, but some plugins extend and
alter the final result.  Try disabling all plugins and addons, then
view the RGraph display.  Before I left the Mozilla project, this was
pretty much the standard response, and was usually the fix.

-- 

More full-root dedicated server packages:
Intel 2.4GHz/60GB/512MB/2TB $49.99/mo.
Intel 3.06GHz/80GB/1GB/2TB $59.99/mo.
Intel 2.4GHz/320/GB/1GB/3TB $74.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] RewriteRule

2008-10-12 Thread Yeti
#.htaccess

RewriteEngine on
RewriteBase /

#Apache recurses into htaccess 3 times so we have to make sure not to
overwrite an already processed rule
RewriteCond %{REQUEST_URI} !^.*(\.php|\.css|\.js|\.html|\.ico|robots\.txt).*$
#The rewrite condition below can be used to pass through GET
parameters (direct access)
#RewriteCond %{THE_REQUEST} !^.*\?getparam1=.*$
# /blog/*/**/*** -> blog.php?getparam1=*&getparam2=**
#RewriteRule /blog[/]{0,}([a-zA-Z0-9 ]{1,})[/]{0,}([a-zA-Z0-9
]{1,})[/]{0,}[.*]{0,}$ blog.php?getparam1=$1&getparam2=$2
RewriteRule ^blog[/]{0,}([^/]{0,})[/]{0,}([^/]{0,})[/]{0,}.*$
blog.php?getparam1=$1&getparam2=$2  [NC,QSA,L]

# All not found requests --> somefile.php
ErrorDocument 404 /somefile.php

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



Re: [PHP] Alternative to HTTP_REFERER?

2008-10-12 Thread Yeti
By definition: The referer, or HTTP referer, identifies, from the
point of view of an internet webpage or resource, the address of the
webpage (commonly the URL, the more generic URI or the i18n updated
IRI) of the resource which links to it.

More detail at:
http://en.wikipedia.org/wiki/Referer
http://tools.ietf.org/html/rfc2616

So is a redirecting page a referrer or not? I don't know. Had no time
to translate the gibberish.

I experimented a bit with it and the most suitable solution I found
was passing the referring page on with a GET parameter ...

## A page redirecting to test.php ##


## test.php ##
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
http://www.w3.org/1999/xhtml";>


Referrer Test Page

alert('Referrer ('+(typeof
document.referrer)+'['+document.referrer.length+']):
'+document.referrer);



Referred page
Referring page: $page
REFERRER;
?>



#

A yeti

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



[PHP] Re: HTML5 canvas tag

2008-10-12 Thread Jonesy
On Sun, 12 Oct 2008 14:15:10 -0400, Daniel Brown wrote:
> On Sun, Oct 12, 2008 at 1:50 PM, Ashley Sheridan
><[EMAIL PROTECTED]> wrote:
>>>
>> Hmm, it doesn't mention which versions of the browsers it lists are
>> capable of displaying the canvas tag. I'm still using Firefox 2 on this
>> computer, and all I got was 5 horizontal bands of grey and blue.
>
> Check your addons and such, Ashley.  Gecko itself (the HTML
> rendering engine used in Firefox) has supported  since 1.8 I
> believe, which equated to Firefox 1.5.

Probably not Firefox 1.5.  I have FF 1.5 without _any_ add-ons here and 
all I got were the same "5 horizontal bands of grey and blue."

Opera 9.5 works ok.

Jonesy
-- 
  Marvin L Jones| jonz  | W3DHJ  | linux
   38.24N  104.55W  |  @ config.com | Jonesy |  OS/2
* Killfiling google & banter.com: jonz.net/ng.htm


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



Re: [PHP] Re: HTML5 canvas tag

2008-10-12 Thread Ashley Sheridan
On Sun, 2008-10-12 at 20:53 +, Jonesy wrote:
> On Sun, 12 Oct 2008 14:15:10 -0400, Daniel Brown wrote:
> > On Sun, Oct 12, 2008 at 1:50 PM, Ashley Sheridan
> ><[EMAIL PROTECTED]> wrote:
> >>>
> >> Hmm, it doesn't mention which versions of the browsers it lists are
> >> capable of displaying the canvas tag. I'm still using Firefox 2 on this
> >> computer, and all I got was 5 horizontal bands of grey and blue.
> >
> > Check your addons and such, Ashley.  Gecko itself (the HTML
> > rendering engine used in Firefox) has supported  since 1.8 I
> > believe, which equated to Firefox 1.5.
> 
> Probably not Firefox 1.5.  I have FF 1.5 without _any_ add-ons here and 
> all I got were the same "5 horizontal bands of grey and blue."
> 
> Opera 9.5 works ok.
> 
> Jonesy
> -- 
>   Marvin L Jones| jonz  | W3DHJ  | linux
>38.24N  104.55W  |  @ config.com | Jonesy |  OS/2
> * Killfiling google & banter.com: jonz.net/ng.htm
> 
> 
Just disable the add-ons for Fx, and no such luck. Opera 9.2 doesn't
work with it either. I think it goes back to my original point that
version numbers next to the browsers that the tag will work on might be
helpful. It's a bit like saying CSS works on such-and-such browser,
without knowing what version of the browser, and what CSS property.


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] Re: template usage

2008-10-12 Thread Ashley Sheridan
On Sun, 2008-10-12 at 13:17 -0500, Micah Gersten wrote:
> The problem with smarty is that they are still using PHP4 as their main
> language so they cannot take advantage of speed improvements in PHP5.
> So, my suggestion is that if you're stuck with PHP4, go with smarty,
> otherwise, find another engine that's up to date.
> 
> Thank you,
> Micah Gersten
> onShore Networks
> Internal Developer
> http://www.onshore.com
> 
> 
> 
> Nathan Rixham wrote:
> > Alain Roger wrote:
> >> Hi,
> >>
> >> i would like to know if you are a lot to use PHP templates for your web
> >> application or web sites ?
> >> if yes, which one do you use (smarty, pear, yapter, phplib,...) ?
> >> and for which reason ? what is/are the advantages over the others ?
> >>
> >> thanks a lot,
> >>
> >
> > I'd vote smarty or using xslt; smarty is very good and nine out of 10
> > designers I know prefer it.
> >
> 
That's a fair point. I've never really gone into the whole template
thing myself, as I generally develop systems from scratch with a library
of components I've built up over time.


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] Re: HTML5 canvas tag

2008-10-12 Thread Yeti
I'm not very familiar with the whole thing yet but after looking at
your site I find it quite interesting.
So is it possible to render 3d vector based objects in the canvas and
if so an entire 3d based website?
Are there any 3d libraries yet like OpenGL for applications?
It would be quite handy to describe 3d/2d objects or styles with a
language like CSS. Do you think that will be possible in the near
future?

A yeti.

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



Re: [PHP] Re: HTML5 canvas tag

2008-10-12 Thread Ashley Sheridan
On Sun, 2008-10-12 at 14:50 -0700, Yeti wrote:
> I'm not very familiar with the whole thing yet but after looking at
> your site I find it quite interesting.
> So is it possible to render 3d vector based objects in the canvas and
> if so an entire 3d based website?
> Are there any 3d libraries yet like OpenGL for applications?
> It would be quite handy to describe 3d/2d objects or styles with a
> language like CSS. Do you think that will be possible in the near
> future?
> 
> A yeti.
> 
The best thing I've seen so far for 3D on the web is Papervision. It's
Flash based, but the donkey work is in Actionscript 3.

The best thing I've seen so far in terms of what it's capable of is
probably http://lab.zupko.info/reflection/realz/ which is displaying
real-time reflections for an X-wing starfighter on some sort of ice cube
mirror. You have to see it to understand it. It's also damn fast as
libraries go.


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] Re: HTML5 canvas tag

2008-10-12 Thread TG
This is the coolest thing I've seen using canvas so far:

http://www.abrahamjoffe.com.au/ben/canvascape/


- Original Message -
From: Ashley Sheridan <[EMAIL PROTECTED]>
To: Yeti <[EMAIL PROTECTED]>
Cc: PHP - General 
Date: Sun, 12 Oct 2008 23:08:30 +0100
Subject: Re: [PHP] Re: HTML5 canvas tag

> On Sun, 2008-10-12 at 14:50 -0700, Yeti wrote:
> > I'm not very familiar with the whole thing yet but after looking at
> > your site I find it quite interesting.
> > So is it possible to render 3d vector based objects in the canvas and
> > if so an entire 3d based website?
> > Are there any 3d libraries yet like OpenGL for applications?
> > It would be quite handy to describe 3d/2d objects or styles with a
> > language like CSS. Do you think that will be possible in the near
> > future?
> > 
> > A yeti.
> > 
> The best thing I've seen so far for 3D on the web is Papervision. It's
> Flash based, but the donkey work is in Actionscript 3.
> 
> The best thing I've seen so far in terms of what it's capable of is
> probably http://lab.zupko.info/reflection/realz/ which is displaying
> real-time reflections for an X-wing starfighter on some sort of ice cube
> mirror. You have to see it to understand it. It's also damn fast as
> libraries go.
> 
> 
> Ash
> www.ashleysheridan.co.uk
> 
> 
> -- 
> 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] Re: HTML5 canvas tag

2008-10-12 Thread Ashley Sheridan
On Sun, 2008-10-12 at 18:08 -0400, TG wrote:
> This is the coolest thing I've seen using canvas so far:
> 
> http://www.abrahamjoffe.com.au/ben/canvascape/
> 
> 
> - Original Message -
> From: Ashley Sheridan <[EMAIL PROTECTED]>
> To: Yeti <[EMAIL PROTECTED]>
> Cc: PHP - General 
> Date: Sun, 12 Oct 2008 23:08:30 +0100
> Subject: Re: [PHP] Re: HTML5 canvas tag
> 
> > On Sun, 2008-10-12 at 14:50 -0700, Yeti wrote:
> > > I'm not very familiar with the whole thing yet but after looking at
> > > your site I find it quite interesting.
> > > So is it possible to render 3d vector based objects in the canvas and
> > > if so an entire 3d based website?
> > > Are there any 3d libraries yet like OpenGL for applications?
> > > It would be quite handy to describe 3d/2d objects or styles with a
> > > language like CSS. Do you think that will be possible in the near
> > > future?
> > > 
> > > A yeti.
> > > 
> > The best thing I've seen so far for 3D on the web is Papervision. It's
> > Flash based, but the donkey work is in Actionscript 3.
> > 
> > The best thing I've seen so far in terms of what it's capable of is
> > probably http://lab.zupko.info/reflection/realz/ which is displaying
> > real-time reflections for an X-wing starfighter on some sort of ice cube
> > mirror. You have to see it to understand it. It's also damn fast as
> > libraries go.
> > 
> > 
> > Ash
> > www.ashleysheridan.co.uk
> > 
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> > 
That's cool! It is a little slow though, speed is not half as good as
Papervision.

I don't know why, but that works for me yet the graph doesn't.


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] Setcookie()

2008-10-12 Thread Micah Gersten
The question is, why aren't you using a session variable instead of
cookies?  That's one of the greatest features of PHP.

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



Ben Stones wrote:
> What I mean is I cannot use setcookie, I need to check if user credentials
> are correct first (which is BEFORE setcookie) and if so, set a cookie. I
> can't do that unless setcookie is first, but I need to check if the user
> credentials is correct. Furthermore I cannot use setcookie in the header as
> I want to display a message saying that they have successfully logged in in
> the correct area of my template.
>
> 2008/10/11 Per Jessen <[EMAIL PROTECTED]>
>
>   
>> Ben Stones wrote:
>>
>> 
>>> I'm using cookies for my website script and upon users logging in a
>>> cookie is set. Problem for me is that the cookie doesn't work due to
>>> headers already sent. Is there anyway of fixing this because, there is
>>> no possible way of adding setcookie() to the top of the PHP file when
>>> the cookie is holding the username from the POSTed form.
>>>   
>> This must be a self imposed restriction on your side, coz' otherwise I
>> see no problem.
>>
>>
>> /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] Alternative to HTTP_REFERER?

2008-10-12 Thread Per Jessen
Yeti wrote:

> By definition: The referer, or HTTP referer, identifies, from the
> point of view of an internet webpage or resource, the address of the
> webpage (commonly the URL, the more generic URI or the i18n updated
> IRI) of the resource which links to it.
> 
> More detail at:
> http://en.wikipedia.org/wiki/Referer
> http://tools.ietf.org/html/rfc2616
> 
> So is a redirecting page a referrer or not? I don't know. Had no time
> to translate the gibberish.

It doesn't have to be a redirect as such - when you set the URL using
javascript, there is also no HTTP_REFERER in MSIE. 

> I experimented a bit with it and the most suitable solution I found
> was passing the referring page on with a GET parameter ...

Which becomes kludgy the minute you've got other GET arguments. 


/Per Jessen, Zürich


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



Re: [PHP] Alternative to HTTP_REFERER?

2008-10-12 Thread Ashley Sheridan
On Mon, 2008-10-13 at 08:37 +0200, Per Jessen wrote:
> Yeti wrote:
> 
> > By definition: The referer, or HTTP referer, identifies, from the
> > point of view of an internet webpage or resource, the address of the
> > webpage (commonly the URL, the more generic URI or the i18n updated
> > IRI) of the resource which links to it.
> > 
> > More detail at:
> > http://en.wikipedia.org/wiki/Referer
> > http://tools.ietf.org/html/rfc2616
> > 
> > So is a redirecting page a referrer or not? I don't know. Had no time
> > to translate the gibberish.
> 
> It doesn't have to be a redirect as such - when you set the URL using
> javascript, there is also no HTTP_REFERER in MSIE. 
> 
> > I experimented a bit with it and the most suitable solution I found
> > was passing the referring page on with a GET parameter ...
> 
> Which becomes kludgy the minute you've got other GET arguments. 
> 
> 
> /Per Jessen, Zürich
> 
> 
You should look at developing the app so that it doesn't rely on
referrer information, as this is unpredictable as you've seen. Not just
with IE as well, because some proxy servers have been known to strip out
this information, and individual users can turn this off if they know
how.

What are you doing with it? Maybe there's another solution to the
problem.


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] RewriteRule

2008-10-12 Thread Per Jessen
Yeti wrote:

> RewriteRule ^blog[/]{0,}([^/]{0,})[/]{0,}([^/]{0,})[/]{0,}.*$
> blog.php?getparam1=$1&getparam2=$2  [NC,QSA,L]

What's the point of using '{0,}' instead '*' ?

I think I would have written something like this:

# http://www.domain.com/blog/1/2/
RewriteRule ^blog/([^/]+)/([^/]+)/ blog.php?getparam1=$1&getparam2=$2 
[NC,QSA,L]


/Per Jessen, Zürich


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