php-general Digest 28 Jun 2003 13:28:55 -0000 Issue 2144
Topics (messages 153241 through 153258):
Re: @import
153241 by: Brian V Bonini
153243 by: electroteque
Re: nl2br and <br />
153242 by: Lars Torben Wilson
Re: Classes within classes
153244 by: Lars Torben Wilson
Compile php
153245 by: J.F.Kishor
Re: 'Cannot send Headers' Problem!! MOre..
153246 by: PHPSpooky
153248 by: Rasmus Lerdorf
153250 by: PHPSpooky
153255 by: electroteque
Re: 'Cannot send Headers' Problem!!
153247 by: PHPSpooky
Pushing MySQL AB for using PHP for stored procedures language
153249 by: Sancar Saran
<?xml ?> parsing problem
153251 by: Daniele Baroncelli
153252 by: Ernest E Vogelsinger
153253 by: David Otton
Re: Forms / Array Question...
153254 by: Justin French
__FILE__ plus variables?
153256 by: Sam Folk-Williams
153257 by: David Nicholson
153258 by: Tularis
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 ---
On Fri, 2003-06-27 at 21:02, Brian V Bonini wrote:
> On Fri, 2003-06-27 at 20:21, Leif K-Brooks wrote:
> > Brian V Bonini wrote:
> >
> > >Can anyone make this work with Mozilla?
> > >
> > ><style type="text/css" xml:lang="en" lang="en">
> > >@import url("site.css.php");
> > ></style>
> > >
> > >No matter what I try , header("Content-type: text/css")
> > >or ini_set to will not output anything other then text/html
> > >
> > >
> > >
> > >
> > This has nothing to do with PHP.
>
> Actually, it does. The only reason it does not work is that I can not
> get php to output anything other then text/html for .php files so it
> fails because of this.... Mozilla needs to see a text/css mimetype
> for this instance of site.css.php in order to render it correctly.
The problem turned out to be that having default_mimetype text/css set
in php.ini seemed to be overriding any attempt I made to set the mime
type via the header function. I thought you are supposed to be able to
over ride the global configs via ini_set or that defining the mime type
via header() would over ride it on a per file basis but apparently not.
In either case I don't think you can get any more PHP related then that.
--- End Message ---
--- Begin Message ---
why php ? why not just use a .css file like everyone else ?
-----Original Message-----
From: Brian V Bonini [mailto:[EMAIL PROTECTED]
Sent: Saturday, June 28, 2003 11:02 AM
To: Leif K-Brooks
Cc: PHP Lists
Subject: Re: [PHP] @import
On Fri, 2003-06-27 at 20:21, Leif K-Brooks wrote:
> Brian V Bonini wrote:
>
> >Can anyone make this work with Mozilla?
> >
> ><style type="text/css" xml:lang="en" lang="en">
> >@import url("site.css.php");
> ></style>
> >
> >No matter what I try , header("Content-type: text/css")
> >or ini_set to will not output anything other then text/html
> >
> >
> >
> >
> This has nothing to do with PHP.
Actually, it does. The only reason it does not work is that I can not
get php to output anything other then text/html for .php files so it
fails because of this.... Mozilla needs to see a text/css mimetype
for this instance of site.css.php in order to render it correctly.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
On Fri, 2003-06-27 at 14:07, Raymond C. Rodgers wrote:
> I'm sure that this has probably been discussed before, but I couldn't
> seem to find any direct references to such a discussion. The line break
> tags that nl2br() produces have the forward slash embedded in them,
> which is not in the HTML 4.x standard. While this isn't a big deal
> really, the fact of the matter is that web browsers built to the
> specifications of the W3C HTML 4.x standards may not like this. In fact
> the W3C HTML validator reports this as an error.
>
> I read on the function description page that this is apparently an XHTML
> curiosity. Would it be possible for someone to add an optional flag to
> nl2br() to specify HTML rather than XHTML compliance? For instance, a
> call to nl2br() without XHTML compliance might look like this:
>
> $mystring=nl2br($myotherstring,false);
>
> For compatibility's sake, maybe default the flag to true and make the
> flag optional. If unspecified, the call to nl2br() would continue to
> function as it always has. However if specified, and set to false, the
> function would return the HTML compliant break tag <br>.
>
> Thoughts? Comments?
> --
> Raymond C. Rodgers
> http://bbnk.dhs.org/~rrodgers/
> http://www.j-a-n.net/
Hi there,
This has actually been beaten to death over the years. One place to
start reading in the archives:
http://marc.theaimsgroup.com/?l=php-dev&w=2&r=1&s=nl2br+AND+xhtml&q=b
This will give links to some discussions and a few bug reports on the
topic.
Anyway, the argument goes something like this: <br> is not XHTML
compliant, but <br /> is. There are browsers which do not like <br/>,
but all are supposed to ignore unrecognized attributes, which is what
the / gets interpreted as when there is a space before it--which is why
<br /> is output instead of <br/>.
To my knowledge, in the 3 years of sporadic debate on the topic, nobody
has yet come forward with a demonstration of a browser which incorrectly
handles <br />.
If you're having trouble validating, see if using html 4 transitional
helps any. Otherwise, the function is easily doable yourself in a
couple of lines of code.
However, if you read all that and still think you've got a shot at
changing the minds of the dev team, feel free to open a new feature
request bug report in the bug database at http://bugs.php.net. Note that
I'm not going to argue for or against. :)
Hope this helps,
Torben
--
Torben Wilson <[EMAIL PROTECTED]> +1.604.709.0506
http://www.thebuttlesschaps.com http://www.inflatableeye.com
http://www.hybrid17.com http://www.themainonmain.com
-----==== Boycott Starbucks! http://www.haidabuckscafe.com ====-----
--- End Message ---
--- Begin Message ---
On Fri, 2003-06-27 at 03:09, Dave Alger wrote:
> Hiya,
>
> It would be useful for me to be able to use a class within another class and
> I don't know if that's permissable in PHP.
Hi there!
It is indeed possible. However, that's not the problem here. The problem
is that class attribute initializers can only be constant values (i.e.
no variables or non-constant expressions). This is explained in the
manual's section on Classes and Objects:
http://www.php.net/manual/en/language.oop.php
Specifically, check out the note right after the Caution box.
> Here's an example of what I'm trying to do. Is it just simply not permitted
> or am I going about it the wrong way?
[snip]
This is a minor rewrite which shows one way to do what you want:
<?php
error_reporting(E_ALL);
ini_set('display_errors', true);
class CSSFont
{
var $family ='Arial';
var $size ='12pt';
var $style = 'none';
function Output()
{
$out = "\n";
$out .= "font-family:".$this->family.";\n";
$out .= "font-size:".$this->size.";\n";
$out .= "font-style:".$this->style.";\n";
return $out;
}
}
class CSSBorder
{
var $font1;
var $font2;
var $out = '';
function Output()
{
$this->out = $this->font1->Output();
$this->out .= " other stuff goes here ";
$this->out .= $this->font2->Output();
}
function Display()
{
echo $this->out;
}
function CSSBorder()
{
$this->font1 = new CSSFont;
$this->font2 = new CSSFont;
}
}
$border = new CSSBorder();
$border->Output();
$border->Display();
?>
> Thanks in advance for any help,
>
> Dave
Hope this helps clarify things,
Torben
--
Torben Wilson <[EMAIL PROTECTED]> +1.604.709.0506
http://www.thebuttlesschaps.com http://www.inflatableeye.com
http://www.hybrid17.com http://www.themainonmain.com
-----==== Boycott Starbucks! http://www.haidabuckscafe.com ====-----
--- End Message ---
--- Begin Message ---
Hi all,
I have a doubt, is there a way to compile php as a class file,
so that it would be more secured.
And I should be able to be invoked by a HTML client interface.
Thanks in adv
- JFK
kishor
Nilgiri Networks
--- End Message ---
--- Begin Message ---
Glory!
Well so far all solutions have failed..
I gave the include functions as the first line of my directory.php as
this..
<?php include("global.inc.php");?>
I've given HTML in it's original form.. as well as in echo.. tried
both..
This..
<body bgcolor="#314160" background="bg.jpg" topmargin=0 marginheight=0
link=#ffdead vlink=#ffffff alink=#ffdead>
Or this..
echo "<body bgcolor=#314160 background=\"bg.jpg\" topmargin=0
marginheight=0 link=#ffdead vlink=#ffffff alink=#ffdead>";
for each line.
And yet nothing is working!
I still get the Headers cannot be modified error..
Is there no solution to this problem?
PHPSpooky
> -----Original Message-----
> From: Marek Kilimajer [mailto:[EMAIL PROTECTED]
> Sent: Friday, June 27, 2003 7:25 PM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] 'Cannot send Headers' Problem!! MOre..
>
> The top means the top of the file, not the top of your coding.
> Simply:
> Line 1. of directory.php: <?php include_once("global.inc.php") ?>
> Line 2. of directory.php: <html>
> Line 3. of directory.php: <head>
> ....
>
> PHPSpooky wrote:
> >>Headers can't be sent after HTML output, it's as simple
> >>as it sounds. What that means is, if you suddenly decide
> >>you want to send a Location header to redirect the browser,
> >>you can't if you outputted any HTML before the line that
> >>outputs the location, unless ofcourse your using Output
> >>Buffering.
> >
> >
> > Excellent.. I understand that fine. But what is the solution for
this?
> >
> >
>
>
--- End Message ---
--- Begin Message ---
First, where is your header call? And when you do a view source on the
page with the error, what do you see before that error is shown?
-Rasmus
On Sat, 28 Jun 2003, PHPSpooky wrote:
> Glory!
>
> Well so far all solutions have failed..
> I gave the include functions as the first line of my directory.php as
> this..
>
> <?php include("global.inc.php");?>
>
> I've given HTML in it's original form.. as well as in echo.. tried
> both..
>
> This..
>
> <body bgcolor="#314160" background="bg.jpg" topmargin=0 marginheight=0
> link=#ffdead vlink=#ffffff alink=#ffdead>
>
> Or this..
>
> echo "<body bgcolor=#314160 background=\"bg.jpg\" topmargin=0
> marginheight=0 link=#ffdead vlink=#ffffff alink=#ffdead>";
>
> for each line.
>
> And yet nothing is working!
> I still get the Headers cannot be modified error..
>
> Is there no solution to this problem?
>
> PHPSpooky
>
>
> > -----Original Message-----
> > From: Marek Kilimajer [mailto:[EMAIL PROTECTED]
> > Sent: Friday, June 27, 2003 7:25 PM
> > To: [EMAIL PROTECTED]
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: [PHP] 'Cannot send Headers' Problem!! MOre..
> >
> > The top means the top of the file, not the top of your coding.
> > Simply:
> > Line 1. of directory.php: <?php include_once("global.inc.php") ?>
> > Line 2. of directory.php: <html>
> > Line 3. of directory.php: <head>
> > ....
> >
> > PHPSpooky wrote:
> > >>Headers can't be sent after HTML output, it's as simple
> > >>as it sounds. What that means is, if you suddenly decide
> > >>you want to send a Location header to redirect the browser,
> > >>you can't if you outputted any HTML before the line that
> > >>outputs the location, unless ofcourse your using Output
> > >>Buffering.
> > >
> > >
> > > Excellent.. I understand that fine. But what is the solution for
> this?
> > >
> > >
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Glory!
I have two files, directory.php and global.inc.php
In directory.php ... this is the first line :
<?php include("global.inc.php");?>
followed by the HTML tags..
<HTML>
<HEAD>
and at Line 54 begins the php code in this page..
<?php
$admin = is_admin();
$return = numlinks_array(); // Build array of number of links in each
category
$numlinks = $return[0];
$numlinkstree = $return[1];
$thematrix="1";
________________
Now, in global.inc.php, this is the function in question, the Admin
Login function, which contains lines 533, 534 & 535 ..
function login($username, $password)
{
setcookie("Links_Cookie_User", $username, time() + 3600);
setcookie("Links_Cookie_Pass", $password, time() + 3600);
header("Location: directory.php");
exit;
}
On trying to login, I get this error..
Warning: Cannot modify header information - headers already sent by
(output started at /home/unbreaka/public_html/mjs/directory.php:4) in
/home/unbreaka/public_html/mjs/global.inc.php on line 533
Warning: Cannot modify header information - headers already sent by
(output started at /home/unbreaka/public_html/mjs/directory.php:4) in
/home/unbreaka/public_html/mjs/global.inc.php on line 534
Warning: Cannot modify header information - headers already sent by
(output started at /home/unbreaka/public_html/mjs/directory.php:4) in
/home/unbreaka/public_html/mjs/global.inc.php on line 535
Upon 'View Source' of this page.. I have all the HTML tags that I have
in directory.php .. which begin after the include function, but make up
the interface of the page.
Line 4 of Directory.php currently is..
<META http-equiv=Keywords content="michael, jackson, mj, michael
jackson, king of pop, king, pop, bad, dangerous, music, r&b, off the
wall, history, thriller, scream, invincible, gloria brown, rahul s
johari, album, songs, grammy, awards, you rock my world, cry, black or
white, world, earth, pop, mp3, guestbook, mailing list, directory,
guide, countries, sites, websites, list, site" name=Keywords>
I have tried a lot of things.. moved the incude function to the top,
given all HTML statements in echo .. things like that.. nothing has
worked so far.
Thanks,
PHPSpooky
> -----Original Message-----
> From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]
> Sent: Saturday, June 28, 2003 11:50 AM
> To: PHPSpooky
> Cc: 'Marek Kilimajer'; [EMAIL PROTECTED]
> Subject: RE: [PHP] 'Cannot send Headers' Problem!! MOre..
>
> First, where is your header call? And when you do a view source on
the
> page with the error, what do you see before that error is shown?
>
> -Rasmus
--- End Message ---
--- Begin Message ---
there is a possible problem if there is whitespace before or after a php tag
check that !!
-----Original Message-----
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]
Sent: Saturday, June 28, 2003 4:20 PM
To: PHPSpooky
Cc: 'Marek Kilimajer'; [EMAIL PROTECTED]
Subject: RE: [PHP] 'Cannot send Headers' Problem!! MOre..
First, where is your header call? And when you do a view source on the
page with the error, what do you see before that error is shown?
-Rasmus
On Sat, 28 Jun 2003, PHPSpooky wrote:
> Glory!
>
> Well so far all solutions have failed..
> I gave the include functions as the first line of my directory.php as
> this..
>
> <?php include("global.inc.php");?>
>
> I've given HTML in it's original form.. as well as in echo.. tried
> both..
>
> This..
>
> <body bgcolor="#314160" background="bg.jpg" topmargin=0 marginheight=0
> link=#ffdead vlink=#ffffff alink=#ffdead>
>
> Or this..
>
> echo "<body bgcolor=#314160 background=\"bg.jpg\" topmargin=0
> marginheight=0 link=#ffdead vlink=#ffffff alink=#ffdead>";
>
> for each line.
>
> And yet nothing is working!
> I still get the Headers cannot be modified error..
>
> Is there no solution to this problem?
>
> PHPSpooky
>
>
> > -----Original Message-----
> > From: Marek Kilimajer [mailto:[EMAIL PROTECTED]
> > Sent: Friday, June 27, 2003 7:25 PM
> > To: [EMAIL PROTECTED]
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: [PHP] 'Cannot send Headers' Problem!! MOre..
> >
> > The top means the top of the file, not the top of your coding.
> > Simply:
> > Line 1. of directory.php: <?php include_once("global.inc.php") ?>
> > Line 2. of directory.php: <html>
> > Line 3. of directory.php: <head>
> > ....
> >
> > PHPSpooky wrote:
> > >>Headers can't be sent after HTML output, it's as simple
> > >>as it sounds. What that means is, if you suddenly decide
> > >>you want to send a Location header to redirect the browser,
> > >>you can't if you outputted any HTML before the line that
> > >>outputs the location, unless ofcourse your using Output
> > >>Buffering.
> > >
> > >
> > > Excellent.. I understand that fine. But what is the solution for
> this?
> > >
> > >
> >
> >
>
>
>
> --
> 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
--- End Message ---
--- Begin Message ---
> From: Jason Wong [mailto:[EMAIL PROTECTED]
> And a search of the archives would have told you exactly what could
cause
> that
> to happen and how to solve it. But you've done that already though
haven't
> you?
Exactly. You're on the right track my friend. Been there.. done that. To
no avail. You couldn't have been more precise Mr. Wong.
PHPSpooky
--- End Message ---
--- Begin Message ---
Dear PHP users,
MySQL AB, going to add stored procedure language for MySQL. They say
"Stored procedures are currently being implemented. This effort is based on
SQL-99, which has a basic syntax similar (but not identical) to Oracle
PL/SQL. We will also implement the SQL-99 framework to hook in external
languages, and (where possible) compatibility with, for example, PL/SQL and
T-SQL."
As you know our community mostly uses MySQL for SQL needs, also we had lots of
open source projects depend on MySQL.
So I'm asking community to push MySQL AB to implement PHP language to MySQL
stored procedure language.
Please wisit following url (MySQL AB todo list) and add your comments
http://www.mysql.com/doc/en/TODO_MySQL_5.0.html
Thanks...
Sancar "Delifisek" Saran
--- End Message ---
--- Begin Message ---
Hi guys,
I have problem in including this text in my PHP parsed file for XHTML
definition:
<?xml version="1.0" encoding="iso-8859-1"?>
<!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">
It works if I remove the first line:
<?xml version="1.0" encoding="iso-8859-1"?>
So, I am assuming PHP has problems with the <? ?> symbols, as they are
recognised to be PHP code delimiters.
Considering that I don't have control of the PHP configuration on the
server, does anyone have any idea of how I could handle this parsing
problem, still being able to define the file as XHTML?
Cheers
Daniele
--- End Message ---
--- Begin Message ---
At 12:33 28.06.2003, Daniele Baroncelli said:
--------------------[snip]--------------------
>I have problem in including this text in my PHP parsed file for XHTML
>definition:
>
><?xml version="1.0" encoding="iso-8859-1"?>
><!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">
>
>
>It works if I remove the first line:
>
><?xml version="1.0" encoding="iso-8859-1"?>
>
>
>So, I am assuming PHP has problems with the <? ?> symbols, as they are
>recognised to be PHP code delimiters.
I believe short_open_tag is set to "On" in php.ini, thus when seeing '<?',
PHP starts acting.
>Considering that I don't have control of the PHP configuration on the
>server, does anyone have any idea of how I could handle this parsing
>problem, still being able to define the file as XHTML?
Within your PHP code:
echo '<?xml...';
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
--- End Message ---
--- Begin Message ---
On Sat, 28 Jun 2003 12:33:27 +0200, you wrote:
>I have problem in including this text in my PHP parsed file for XHTML
>definition:
>It works if I remove the first line:
>
><?xml version="1.0" encoding="iso-8859-1"?>
>So, I am assuming PHP has problems with the <? ?> symbols, as they are
>recognised to be PHP code delimiters.
Yup.
try
<? echo ('<?xml version="1.0" encoding="UTF-8"?>' . "\r\n"); ?>
or turning short tags off.
--- End Message ---
--- Begin Message ---
on 28/06/03 4:20 AM, Noel Wade ([EMAIL PROTECTED]) wrote:
> Anyone know if this (A) works
have you tried it? surely it couldn't take more than 10 seconds to find out
eh?
> and
> (B) is not actually just some undefined behavior that's risky to use?
it's quite common, although i believe the syntax is name='foo[1]' not
name='$foo[1]'.
Justin
--- End Message ---
--- Begin Message ---
I have a password protected site. If you go to an inside page before
logging in, it redirects you to the log in page. I would like to grab
the URL that a user tries to access and send them back there after they
log in. I'm using __FILE__ to get the file name (secondary.php for
example) but that doesn't return the variables
(secondary.php?cat_id=267). Is there a way for me to get the full URL
not just the filename?
Sam
--- End Message ---
--- Begin Message ---
Hello,
This is a reply to an e-mail that you wrote on Sat, 28 Jun 2003 at 13:16,
lines prefixed by '>' were originally written by you.
> I have a password protected site. If you go to an inside page before
> logging in, it redirects you to the log in page. I would like to grab
> the URL that a user tries to access and send them back there after
> they
> log in. I'm using __FILE__ to get the file name (secondary.php
for
> example) but that doesn't return the variables
> (secondary.php?cat_id=267). Is there a way for me to get the full
URL
> not just the filename?
> Sam
Using my Apache installation it is in $_SERVER['REQUEST_URI'].
At a guess I would say most other web servers will put it there too.
David.
--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/
Professional Web Development by David Nicholson
http://www.djnicholson.com/
QuizSender.com - How well do your friends actually know you?
http://www.quizsender.com/
(developed entirely in PHP)
--- End Message ---
--- Begin Message ---
David Nicholson wrote:
Hello,
This is a reply to an e-mail that you wrote on Sat, 28 Jun 2003 at 13:16,
lines prefixed by '>' were originally written by you.
I have a password protected site. If you go to an inside page before
logging in, it redirects you to the log in page. I would like to grab
the URL that a user tries to access and send them back there after
they
log in. I'm using __FILE__ to get the file name (secondary.php
for
example) but that doesn't return the variables
(secondary.php?cat_id=267). Is there a way for me to get the full
URL
not just the filename?
Sam
Using my Apache installation it is in $_SERVER['REQUEST_URI'].
At a guess I would say most other web servers will put it there too.
David.
on IIS you can access it using $_SERVER['query']
--- End Message ---