php-general Digest 14 Nov 2005 09:43:42 -0000 Issue 3793

Topics (messages 225698 through 225724):

Re: Printing to a buffer
        225698 by: Todd Cary
        225699 by: Jasper Bryant-Greene
        225700 by: Marcus Bointon
        225703 by: Todd Cary
        225704 by: Todd Cary
        225706 by: M. Sokolewicz
        225708 by: Todd Cary
        225709 by: Todd Cary

mod_rewrite and include paths
        225701 by: Marcus Bointon
        225702 by: Marco Kaiser
        225710 by: Marcus Bointon

Output_Buffer problem
        225705 by: Todd Cary
        225707 by: David Tulloh

please shed some light on SQLsyntax error
        225711 by: Bruce Gilbert
        225713 by: Jasper Bryant-Greene
        225714 by: Bruce Gilbert
        225715 by: Jasper Bryant-Greene
        225716 by: Bruce Gilbert
        225717 by: Jasper Bryant-Greene
        225722 by: Stephen Leaf
        225723 by: Max Schwanekamp

Zend + Eclipse + Standized Framework
        225712 by: Dan Rossi
        225718 by: Marco Kaiser

Page Update Script
        225719 by: Wolf

Good user comment system?
        225720 by: Guy Brom

Savant question
        225721 by: Ligaya Turmelle

file get contents
        225724 by: Ross

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

Many thanks!  I did not know that MIME-Type.  Change duly made!

Todd

Marcus Bointon wrote:

On 13 Nov 2005, at 00:17, Jasper Bryant-Greene wrote:

seem to do that. I just tried "application/text" since I use "application/pdf" for other applications.


Whatever it's giving the user the ability to do, it's probably because the browser doesn't recognise the (invalid) MIME-Type.


Quite - it's right up there with 'application/force-download'. If you want to suggest (the final choice is not yours to make) that a browser might download something instead of displaying it, set an appropriate content-disposition header instead of setting the wrong type.

Marcus

--- End Message ---
--- Begin Message ---
Todd Cary wrote:
Marcus -

Many thanks!  I did not know that MIME-Type.  Change duly made!

You're not suggesting that you actually set the MIME-Type to application/force-download, are you?



Todd

Marcus Bointon wrote:

On 13 Nov 2005, at 00:17, Jasper Bryant-Greene wrote:

seem to do that. I just tried "application/text" since I use "application/pdf" for other applications.


Whatever it's giving the user the ability to do, it's probably because the browser doesn't recognise the (invalid) MIME-Type.


Quite - it's right up there with 'application/force-download'. If you want to suggest (the final choice is not yours to make) that a browser might download something instead of displaying it, set an appropriate content-disposition header instead of setting the wrong type.

Marcus


--- End Message ---
--- Begin Message ---
On 13 Nov 2005, at 19:27, Jasper Bryant-Greene wrote:

Many thanks!  I did not know that MIME-Type.  Change duly made!

You're not suggesting that you actually set the MIME-Type to application/force-download, are you?

I think he is. I've called the MIME-type police and they'll be round later.

Todd, I think you should read this: http://support.microsoft.com/kb/ q260519/

There's a PHP example just before the user notes here: http:// www.php.net/header

Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk

--- End Message ---
--- Begin Message ---

Just before the police knocked at my door, I made a few changes!

<?
  ob_start();
  print "This is a test<br>";
  $buf = ob_get_contents();
  $len = strlen($buf);
  ob_end_clean();
  header("Content-type: text/plain");
  header("Content-Length: $len");
  header("Content-Disposition: attachment; filename=sfyc.html");
  print($buf);
?>

Todd
Marcus Bointon wrote:
On 13 Nov 2005, at 19:27, Jasper Bryant-Greene wrote:

Many thanks!  I did not know that MIME-Type.  Change duly made!


You're not suggesting that you actually set the MIME-Type to application/force-download, are you?


I think he is. I've called the MIME-type police and they'll be round later.

Todd, I think you should read this: http://support.microsoft.com/kb/ q260519/

There's a PHP example just before the user notes here: http:// www.php.net/header

Marcus

--- End Message ---
--- Begin Message ---

Just before the police knocked at my door, I made a few changes!

<?
  ob_start();
  print "This is a test<br>";
  $buf = ob_get_contents();
  $len = strlen($buf);
  ob_end_clean();
  header("Content-type: text/plain");
  header("Content-Length: $len");
  header("Content-Disposition: attachment; filename=sfyc.html");
  print($buf);
?>

Todd
Marcus Bointon wrote:
On 13 Nov 2005, at 19:27, Jasper Bryant-Greene wrote:

Many thanks!  I did not know that MIME-Type.  Change duly made!


You're not suggesting that you actually set the MIME-Type to application/force-download, are you?


I think he is. I've called the MIME-type police and they'll be round later.

Todd, I think you should read this: http://support.microsoft.com/kb/ q260519/

There's a PHP example just before the user notes here: http:// www.php.net/header

Marcus

--- End Message ---
--- Begin Message ---
call me stupid, but why don't you do it like this:

$buf = "This is a test<br>";
header("Content-type: text/plain");
header("Content-Length: ".strlen($buf));
header("Content-Disposition: attachment; filename=sfyc.html");
echo $buf;

??
looks easier to me... no output buffering required...

Todd Cary wrote:

Just before the police knocked at my door, I made a few changes!

<?
  ob_start();
  print "This is a test<br>";
  $buf = ob_get_contents();
  $len = strlen($buf);
  ob_end_clean();
  header("Content-type: text/plain");
  header("Content-Length: $len");
  header("Content-Disposition: attachment; filename=sfyc.html");
  print($buf);
?>

Todd
Marcus Bointon wrote:

On 13 Nov 2005, at 19:27, Jasper Bryant-Greene wrote:

Many thanks!  I did not know that MIME-Type.  Change duly made!



You're not suggesting that you actually set the MIME-Type to application/force-download, are you?



I think he is. I've called the MIME-type police and they'll be round later.

Todd, I think you should read this: http://support.microsoft.com/kb/ q260519/

There's a PHP example just before the user notes here: http:// www.php.net/header

Marcus

--- End Message ---
--- Begin Message --- Because this was just a test of what will be many "print" lines. The original application used a file to hold the data and upon request by the user, it was emailed. But with my client's shared server, files cannot be opened...a pain.

If you have a better solution, I am open to other ideas.

Todd

M. Sokolewicz wrote:
call me stupid, but why don't you do it like this:

$buf = "This is a test<br>";
header("Content-type: text/plain");
header("Content-Length: ".strlen($buf));
header("Content-Disposition: attachment; filename=sfyc.html");
echo $buf;

??
looks easier to me... no output buffering required...

Todd Cary wrote:


Just before the police knocked at my door, I made a few changes!

<?
  ob_start();
  print "This is a test<br>";
  $buf = ob_get_contents();
  $len = strlen($buf);
  ob_end_clean();
  header("Content-type: text/plain");
  header("Content-Length: $len");
  header("Content-Disposition: attachment; filename=sfyc.html");
  print($buf);
?>

Todd
Marcus Bointon wrote:

On 13 Nov 2005, at 19:27, Jasper Bryant-Greene wrote:

Many thanks!  I did not know that MIME-Type.  Change duly made!




You're not suggesting that you actually set the MIME-Type to application/force-download, are you?




I think he is. I've called the MIME-type police and they'll be round later.

Todd, I think you should read this: http://support.microsoft.com/kb/ q260519/

There's a PHP example just before the user notes here: http:// www.php.net/header

Marcus

--- End Message ---
--- Begin Message --- Because this was just a test of what will be many "print" lines. The original application used a file to hold the data and upon request by the user, it was emailed. But with my client's shared server, files cannot be opened...a pain.

If you have a better solution, I am open to other ideas.

Todd

M. Sokolewicz wrote:
call me stupid, but why don't you do it like this:

$buf = "This is a test<br>";
header("Content-type: text/plain");
header("Content-Length: ".strlen($buf));
header("Content-Disposition: attachment; filename=sfyc.html");
echo $buf;

??
looks easier to me... no output buffering required...

Todd Cary wrote:


Just before the police knocked at my door, I made a few changes!

<?
  ob_start();
  print "This is a test<br>";
  $buf = ob_get_contents();
  $len = strlen($buf);
  ob_end_clean();
  header("Content-type: text/plain");
  header("Content-Length: $len");
  header("Content-Disposition: attachment; filename=sfyc.html");
  print($buf);
?>

Todd
Marcus Bointon wrote:

On 13 Nov 2005, at 19:27, Jasper Bryant-Greene wrote:

Many thanks!  I did not know that MIME-Type.  Change duly made!




You're not suggesting that you actually set the MIME-Type to application/force-download, are you?




I think he is. I've called the MIME-type police and they'll be round later.

Todd, I think you should read this: http://support.microsoft.com/kb/ q260519/

There's a PHP example just before the user notes here: http:// www.php.net/header

Marcus

--- End Message ---
--- Begin Message ---
This seems like a simple problem...

I have a rewrite like this:

RewriteRule ^x/([0-9]+) x.php?x=$1 [PT,L]

This maps a url like http://www.example.com/x/123 to http:// www.example.com/x.php?x=123

x.php contains a line to include some class like:

require_once 'x.class.php';

My include path contains '.' (plus paths to pear, etc), and the class file is in the top level directory.

This configuration will fail with a file not found error. Because of the rewrite, PHP ends up looking for x/x.class.php instead of just x.class.php. If I change the PT option to R (AKA ugly mode), it works fine as PHP gets to know about the real URL.

So how can I get PHP to look in /? I can set include_path with a php_value in .htaccess, but I can only set it absolutely (losing existing values), not add to it (AFAIK?). I don't want to add an absolute path to my global include_path as there may be multiple independent deployments of the same scripts on the server, and I don't want them including each others files. Adding .. to the path would work but is a security risk. Any other ideas?

Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk

--- End Message ---
--- Begin Message ---
Hi Marcus,

try to use realpath, dirname and other related funktion to resolv the real path.

dirname(__FILE__) ?

-- Marco

--- End Message ---
--- Begin Message ---
On 13 Nov 2005, at 22:15, Marco Kaiser wrote:

try to use realpath, dirname and other related funktion to resolv the real path.

dirname(__FILE__) ?

Good point (you can tell I've been up too long). I've just had a play with that - I appended the current path to my include_path, but it seems it's not inherited, so sub-includes are not found. I also tried chdir(dirname(__FILE__)) which had the same results and interferes with the operation of require_once (the same file found by a different path doesn't get counted as the same file). Incidentally doing just 'echo getcwd();' seems to fail completely when called via a rewrite. After all that, smarty still can't find its templates_c for some reason. I'm sure there must be something simple and elegant I'm missing. Probably a good night's sleep.

Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk

--- End Message ---
--- Begin Message --- My client has switched to a shared server, so direct access to the php.ini is not availble. Our calendar program expects to have output_buffering set to On ("1").

Currently, I get the expected error of

Warning: Cannot modify header information - headers already sent by (output started at /home/content/s/f/y/sfycadmin/html/php/calendar/private/ltw_config.php:375) in /home/content/s/f/y/sfycadmin/html/php/calendar/private/ltwdisplaymonth.php on line 283

At the top of ltwdisplaymonth.php, I tried ini_set(output_buffering, "1"), but that does not appear to have an effect.

Have I missed something?

Todd

--- End Message ---
--- Begin Message ---
The documentation[1] lists output_buffering as changeable PERDIR.  This
means you can't set it in the file.  Instead you should look into
setting it in the apache .htaccess file.

1: http://php.net/manual/en/ref.outcontrol.php


Todd Cary wrote:
> My client has switched to a shared server, so direct access to the
> php.ini is not availble.  Our calendar program expects to have
> output_buffering set to On ("1").
> 
> Currently, I get the expected error of
> 
> Warning: Cannot modify header information - headers already sent by
> (output started at
> /home/content/s/f/y/sfycadmin/html/php/calendar/private/ltw_config.php:375)
> in
> /home/content/s/f/y/sfycadmin/html/php/calendar/private/ltwdisplaymonth.php
> on line 283
> 
> At the top of ltwdisplaymonth.php, I tried ini_set(output_buffering,
> "1"), but that does not appear to have an effect.
> 
> Have I missed something?
> 
> Todd
> 

--- End Message ---
--- Begin Message ---
I am trying to set up a contact list database using guidance from a
PHP/MySQL book I recenty purchased, and not aving done this before I
am not sure what the following error means or where I shoudl look for
this kind of error. I have a table set up in MySQL using PHPMyadmin,
and I am thinking it may be something in my table? Please let me know
if anyone lese is familiar of this type of error below:

"You have an error in your SQL syntax. Check the manual that
corresponds to your MySQL server version for the right syntax to use
near 'List values ('', 'firstname', 'lastname', 'address', '


thanks in advance,

Bruce Gilbert

--- End Message ---
--- Begin Message ---
Bruce Gilbert wrote:
I am trying to set up a contact list database using guidance from a
PHP/MySQL book I recenty purchased, and not aving done this before I
am not sure what the following error means or where I shoudl look for
this kind of error. I have a table set up in MySQL using PHPMyadmin,
and I am thinking it may be something in my table? Please let me know
if anyone lese is familiar of this type of error below:

"You have an error in your SQL syntax. Check the manual that
corresponds to your MySQL server version for the right syntax to use
near 'List values ('', 'firstname', 'lastname', 'address', '

You would need to show us the SQL that was causing that error. Otherwise it is fairly meaningless.

Jasper

--- End Message ---
--- Begin Message ---
>You would need to show us the SQL that was causing that error. Otherwise
>it is fairly meaningless.

hope this helps...

<?

//check for required form variables
if ((!$_POST[f_name]) || (!$_POST[l_name])) {
        
header("Location:http://www.inspired-evolution.com/show_addcontact.php";);
        exit;
}else {
        //if form variables are present,start a session
        session_start();
}

//check for validity of user
if ($_SESSION[valid] != "yes") {
        header("Location:http://www.inspired-evolution.com/contact_menu.php";);
        exit;
}

//set up table and database names
$db_name ="bruceg_contactlist";
$table_name ="Contact List";

//connect to server and select database
$connection = @mysql_connect("69.90.6.198","database_username","password")
or die(mysql_error());
$db = @mysql_select_db($db_name,$connection) or die(mysql_error());

//build and issue query
$sql = "INSERT INTO $table_name values ('', '$_POST[f_name]',
'$_POST[l_name]', '$_POST[address1]', '$_POST[address2]',
'$_POST[address3]', '$_POST[postcode]', '$_POST[country]',
'$_POST[prim_tel]', '$_POST[sec_tel]', '$_POST[email]',
'$_POST[birthday]')";

$result = @mysql_query($sql,$connection)or die(mysql_error());

?>

On 11/13/05, Jasper Bryant-Greene <[EMAIL PROTECTED]> wrote:
> Bruce Gilbert wrote:
> > I am trying to set up a contact list database using guidance from a
> > PHP/MySQL book I recenty purchased, and not aving done this before I
> > am not sure what the following error means or where I shoudl look for
> > this kind of error. I have a table set up in MySQL using PHPMyadmin,
> > and I am thinking it may be something in my table? Please let me know
> > if anyone lese is familiar of this type of error below:
> >
> > "You have an error in your SQL syntax. Check the manual that
> > corresponds to your MySQL server version for the right syntax to use
> > near 'List values ('', 'firstname', 'lastname', 'address', '
>
> You would need to show us the SQL that was causing that error. Otherwise
> it is fairly meaningless.
>
> Jasper
>


--
::Bruce::

--- End Message ---
--- Begin Message ---
Bruce Gilbert wrote:
You would need to show us the SQL that was causing that error. Otherwise
it is fairly meaningless.

hope this helps...

<?

//check for required form variables
if ((!$_POST[f_name]) || (!$_POST[l_name])) {

Unrelated, but you should have quotes here. Like $_POST['f_name']

        
header("Location:http://www.inspired-evolution.com/show_addcontact.php";);

There should also probably be a space between the : and the start of the URL here.

        exit;
}else {
        //if form variables are present,start a session
        session_start();
}

//check for validity of user
if ($_SESSION[valid] != "yes") {

Again, quotes on the array subscript.

        header("Location:http://www.inspired-evolution.com/contact_menu.php";);

And space between colon and URL here.

        exit;
}

//set up table and database names
$db_name ="bruceg_contactlist";
$table_name ="Contact List";

//connect to server and select database
$connection = @mysql_connect("69.90.6.198","database_username","password")
or die(mysql_error());
$db = @mysql_select_db($db_name,$connection) or die(mysql_error());

//build and issue query
$sql = "INSERT INTO $table_name values ('', '$_POST[f_name]',

You'll be wanting to put backticks (`) around the table name, because it contains a space.

Jasper

--- End Message ---
--- Begin Message ---
for the table name you mean like this?

$table_name =" 'Contact List' ";

On 11/13/05, Jasper Bryant-Greene <[EMAIL PROTECTED]> wrote:
> Bruce Gilbert wrote:
> >> You would need to show us the SQL that was causing that error. Otherwise
> >> it is fairly meaningless.
> >
> > hope this helps...
> >
> > <?
> >
> > //check for required form variables
> > if ((!$_POST[f_name]) || (!$_POST[l_name])) {
>
> Unrelated, but you should have quotes here. Like $_POST['f_name']
>
> >
>       
> header("Location:http://www.inspired-evolution.com/show_addcontact.php";);
>
> There should also probably be a space between the : and the start of the
>   URL here.
>
> >     exit;
> > }else {
> >     //if form variables are present,start a session
> >     session_start();
> > }
> >
> > //check for validity of user
> > if ($_SESSION[valid] != "yes") {
>
> Again, quotes on the array subscript.
>
> >     header("Location:http://www.inspired-evolution.com/contact_menu.php";);
>
> And space between colon and URL here.
>
> >     exit;
> > }
> >
> > //set up table and database names
> > $db_name ="bruceg_contactlist";
> > $table_name ="Contact List";
> >
> > //connect to server and select database
> > $connection =
> @mysql_connect("69.90.6.198","database_username","password")
> > or die(mysql_error());
> > $db = @mysql_select_db($db_name,$connection) or die(mysql_error());
> >
> > //build and issue query
> > $sql = "INSERT INTO $table_name values ('', '$_POST[f_name]',
>
> You'll be wanting to put backticks (`) around the table name, because it
> contains a space.
>
> Jasper
>


--
::Bruce::

--- End Message ---
--- Begin Message ---
Bruce Gilbert wrote:
for the table name you mean like this?

$table_name =" 'Contact List' ";

No, backticks. I gave an example of the backtick in my email (in brackets). It is on the same key as the tilde, and looks like this: `

Also, I would probably left $table_name as it was and put the backticks in the SQL statement, like this:

$sql = "INSERT INTO `$table_name` values ('', '$_POST[f_name]', [...]

Jasper


On 11/13/05, Jasper Bryant-Greene <[EMAIL PROTECTED]> wrote:
Bruce Gilbert wrote:
You would need to show us the SQL that was causing that error. Otherwise
it is fairly meaningless.
hope this helps...

<?

//check for required form variables
if ((!$_POST[f_name]) || (!$_POST[l_name])) {
Unrelated, but you should have quotes here. Like $_POST['f_name']

        
header("Location:http://www.inspired-evolution.com/show_addcontact.php";);

There should also probably be a space between the : and the start of the
  URL here.

        exit;
}else {
        //if form variables are present,start a session
        session_start();
}

//check for validity of user
if ($_SESSION[valid] != "yes") {
Again, quotes on the array subscript.

        header("Location:http://www.inspired-evolution.com/contact_menu.php";);
And space between colon and URL here.

        exit;
}

//set up table and database names
$db_name ="bruceg_contactlist";
$table_name ="Contact List";

//connect to server and select database
$connection =
@mysql_connect("69.90.6.198","database_username","password")
or die(mysql_error());
$db = @mysql_select_db($db_name,$connection) or die(mysql_error());

//build and issue query
$sql = "INSERT INTO $table_name values ('', '$_POST[f_name]',
You'll be wanting to put backticks (`) around the table name, because it
contains a space.

Jasper



--
::Bruce::

--- End Message ---
--- Begin Message ---
I believe it's proper SQL syntax to use a double quote " tho for column names.
I've heard of backtick working.. but in any example I've ever seen both in 
classes and on mysql and postgresql sites they always use "" I don't use `` 
so I'm not sure how widely they are accepted.

Just ran a test in sqlite and postgresql `` are not accepted.

On Sunday 13 November 2005 06:31 pm, Jasper Bryant-Greene wrote:
> Bruce Gilbert wrote:
> > for the table name you mean like this?
> >
> > $table_name =" 'Contact List' ";
>
> No, backticks. I gave an example of the backtick in my email (in
> brackets). It is on the same key as the tilde, and looks like this: `
>
> Also, I would probably left $table_name as it was and put the backticks
> in the SQL statement, like this:
>
> $sql = "INSERT INTO `$table_name` values ('', '$_POST[f_name]', [...]
>
> Jasper
>
> > On 11/13/05, Jasper Bryant-Greene <[EMAIL PROTECTED]> wrote:
> >> Bruce Gilbert wrote:
> >>>> You would need to show us the SQL that was causing that error.
> >>>> Otherwise it is fairly meaningless.
> >>>
> >>> hope this helps...
> >>>
> >>> <?
> >>>
> >>> //check for required form variables
> >>> if ((!$_POST[f_name]) || (!$_POST[l_name])) {
> >>
> >> Unrelated, but you should have quotes here. Like $_POST['f_name']
> >>
> >>    header("Location:http://www.inspired-evolution.com/show_addcontact.php";
> >>);
> >>
> >> There should also probably be a space between the : and the start of the
> >>   URL here.
> >>
> >>>   exit;
> >>> }else {
> >>>   //if form variables are present,start a session
> >>>   session_start();
> >>> }
> >>>
> >>> //check for validity of user
> >>> if ($_SESSION[valid] != "yes") {
> >>
> >> Again, quotes on the array subscript.
> >>
> >>>   header("Location:http://www.inspired-evolution.com/contact_menu.php";);
> >>
> >> And space between colon and URL here.
> >>
> >>>   exit;
> >>> }
> >>>
> >>> //set up table and database names
> >>> $db_name ="bruceg_contactlist";
> >>> $table_name ="Contact List";
> >>>
> >>> //connect to server and select database
> >>> $connection =
> >>
> >> @mysql_connect("69.90.6.198","database_username","password")
> >>
> >>> or die(mysql_error());
> >>> $db = @mysql_select_db($db_name,$connection) or die(mysql_error());
> >>>
> >>> //build and issue query
> >>> $sql = "INSERT INTO $table_name values ('', '$_POST[f_name]',
> >>
> >> You'll be wanting to put backticks (`) around the table name, because it
> >> contains a space.
> >>
> >> Jasper
> >
> > --
> >
> > ::Bruce::

--- End Message ---
--- Begin Message ---
Bruce Gilbert wrote:
//build and issue query
$sql = "INSERT INTO $table_name values ('', '$_POST[f_name]',
'$_POST[l_name]', '$_POST[address1]', '$_POST[address2]',
'$_POST[address3]', '$_POST[postcode]', '$_POST[country]',
'$_POST[prim_tel]', '$_POST[sec_tel]', '$_POST[email]',
'$_POST[birthday]')";

Holy riddled-with-security-holes batman! Strange that no one has jumped on this. That code could be easily hijacked to do nasty things to your server. Google "sql injection php" or something like that and you'll get lots of resources. E.g.:
http://dev.mysql.com/tech-resources/articles/guide-to-php-security.html

PS - Hello all! This is my first post to the list; I've been lurking for a week or two.

--
Max Schwanekamp
http://www.neptunewebworks.com/

--- End Message ---
--- Begin Message --- Just found this article via phpeclipse.de stating Zend will be including Eclipse framework in their development schedules :)

http://www.zend.com/news/zendpr.php?id=109

Id like to know more about this standardized application framework. I wonder if it includes the pear framework, or compiled OO based extensions ? Personally, i am trying to avoid all these frameworks until everyones ideas are collabroated into one as i think they only work for some or for the developers purposes only.

I use phpeclipse and find it a nice app to use.
--- End Message ---
--- Begin Message ---
Hi Dan,

there are no details right now. Check frequently zend.com for updates
about the framework and upcomming zend eclipse stuff.

-- Marco

--- End Message ---
--- Begin Message ---
Anyone know of a script out there already which will read directories on
a site and display a list of files updated within the last month?

Just thought I would ask before I invented the wheel!

R

--- End Message ---
--- Begin Message ---
Hi all,

Anyone familiar with a good user-comment system for PHP, preferably one that 
works with adodb and has thread-like design (where users can answer each 
other).

Thanks! 

--- End Message ---
--- Begin Message --- I am trying to use savant and having a few odd problems. I plan on making a simple DB driven site where the majority of the content is held in the DB. I have created a basic template (header, footer, nav and content) to just echo out the content (the content will have a html to format it the way I want). Simple right.

Problem: All the html mark up is being ignored and the content is just "dumping" there. Check for htmlentities you say... did and they are there. So I try to get rid of it with html_entity_decode - thus giving me my html formating back right? Wrong. Same problem. Am I missing something?

index.php

// here we get content. Normally this will be by pulling it out of the DB
   $savant->content = '
       <center>
       <h2>This is a test of the Emergency Broadcasting System</h2>
<p>This is <font color="#008000" size="5">ONLY</font> a test. If this was a real emergancy information would be provided here. This is a test.</p>
       </center>';

   $savant->display('page.tpl.php');


page.tpl.php

 <div id="cont">
    <?php
    if(!empty($this->content))
   {
        echo "{$this->_($this->content)}";
        echo '<----------------------- Break --------------------------->';
        echo html_entity_decode($this->_($this->content));
    }
    ?>
 </div>

displayed in browser page:

<center> <h2>This is a test of the Emergency Broadcasting System</h2> <p>This is <font color="#008000" size="5">ONLY</font> a test.</p> </center><----------------------- Break ---------------------------> <center> <h2>This is a test of the Emergency Broadcasting System</h2> <p>This is <font color="#008000" size="5">ONLY</font> a test.</p> </center>

browser page source:

<div id="cont">
                                
 &lt;center&gt;
 &lt;h2&gt;This is a test of the Emergency Broadcasting System&lt;/h2&gt;
 &lt;p&gt;This is &lt;font color=&quot;#008000&quot; 
size=&quot;5&quot;&gt;ONLY&lt;/font&gt; a test.&lt;/p&gt;

 &lt;/center&gt;<----------------------- Break --------------------------->
 &lt;center&gt;
 &lt;h2&gt;This is a test of the Emergency Broadcasting System&lt;/h2&gt;
 &lt;p&gt;This is &lt;font color=&quot;#008000&quot; 
size=&quot;5&quot;&gt;ONLY&lt;/font&gt; a test.&lt;/p&gt;

 &lt;/center&gt;                        
</div>


--
Respectfully,
Ligaya Turmelle

"Life is a game.... so have fun"

--- End Message ---
--- Begin Message ---
Hello,

I have been  usng the file_get_contents function to insert a (repeating) 
part of my code


$lines = file_get_contents('../shared/acessibility_box.htm');

   echo "$lines";


In this file I have the a self submitting link

<a href="<? $_SERVER['PHP_SELF'];  ?>?text_size=small" class="size1">A</a>


The problem I think is this code is inserted after the page headers have 
been set. And so the line just generates an error.
When I roll over the link I get (or something similar)


http://localhost/nhs/<? $_SERVER['PHP_SELF']; ?>?text_size=small

I have tried most of the other similar functions (include, require) with no 
success.


Any help would be great...


Ross

--- End Message ---

Reply via email to