php-general Digest 13 Oct 2008 06:37:25 -0000 Issue 5732
Topics (messages 281752 through 281777):
RewriteRule
281752 by: Ron Piggott
281762 by: Daniel Brown
281767 by: Yeti
Re: template usage
281753 by: Nathan Rixham
281756 by: Ashley Sheridan
281757 by: Robert Cummings
281759 by: Nathan Rixham
281765 by: Micah Gersten
281771 by: Ashley Sheridan
HTML5 canvas tag
281754 by: Richard Heyes
281758 by: Ashley Sheridan
281760 by: Nathan Rixham
281763 by: Daniel Brown
281764 by: Ashley Sheridan
281766 by: Daniel Brown
281769 by: Jonesy
281770 by: Ashley Sheridan
281772 by: Yeti
281773 by: Ashley Sheridan
281774 by: TG
281775 by: Ashley Sheridan
Re: Variable Variables and Super Global Arrays
281755 by: Micah Gersten
Re: Remove index.php from url
281761 by: Nathan Rixham
Re: Alternative to HTTP_REFERER?
281768 by: Yeti
281777 by: Per Jessen
Re: Setcookie()
281776 by: Micah Gersten
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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).
--
</Daniel P. Brown>
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.
--- End Message ---
--- Begin Message ---
#.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
--- End Message ---
--- Begin Message ---
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.
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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:
<mw:portlet>
My content goes here
</mw:portlet>
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
--- End Message ---
--- Begin Message ---
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.
--- End Message ---
--- Begin Message ---
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.
>
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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!
--- End Message ---
--- Begin Message ---
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 <canvas> since 1.8 I
believe, which equated to Firefox 1.5.
--
</Daniel P. Brown>
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.
--- End Message ---
--- Begin Message ---
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 <canvas> 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
--- End Message ---
--- Begin Message ---
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.
--
</Daniel P. Brown>
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.
--- End Message ---
--- Begin Message ---
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 <canvas> 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 & XXXXbanter.com: jonz.net/ng.htm
--- End Message ---
--- Begin Message ---
On Sun, 2008-10-12 at 20:53 +0000, 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 <canvas> 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 & XXXXbanter.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
--- End Message ---
--- Begin Message ---
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.
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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 <[EMAIL PROTECTED]>
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
>
>
--- End Message ---
--- Begin Message ---
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 <[EMAIL PROTECTED]>
> 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
--- End Message ---
--- Begin Message ---
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]
> <mailto:[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:
> >
> > <?php
> > $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
>
>
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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 ##################
<?php
$location = (empty($_SERVER["REQUEST_URI"])) ? 'Location: test2.php' :
'Location:
test2.php?ref='.urlencode(base64_encode(gzdeflate($_SERVER["REQUEST_URI"],
8)));
header($location);
?>
################## test.php ##################
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Referrer Test Page</title>
<script type="text/javascript">
alert('Referrer ('+(typeof
document.referrer)+'['+document.referrer.length+']):
'+document.referrer);
</script>
</head>
<body>
<h1>Referred page</h1>
<?
$page = ($_GET['ref']) ?
@gzinflate(base64_decode(urldecode($_GET['ref']))) : 'not found';
echo <<<REFERRER
<h2>Referring page: $page</h2>
REFERRER;
?>
</body>
</html>
#####################
A yeti
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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
>>
>>
>>
>
>
--- End Message ---