php-general Digest 16 Jul 2008 07:23:32 -0000 Issue 5571

Topics (messages 276878 through 276901):

Re: Advice on a radar chart
        276878 by: Richard Heyes
        276880 by: tedd
        276881 by: Richard Heyes

Re: Math Weirdness
        276879 by: tedd

is there a problem with php script pulling HTML out of database as it writes 
the page??
        276882 by: Rod Clay
        276883 by: Stut
        276884 by: Alex Chamberlain
        276885 by: dg
        276886 by: Rod Clay
        276887 by: dg
        276888 by: Rod Clay

Re: "Warning:Cannot modify header information -" Error
        276889 by: Daniel Brown

Changing PHP.ini
        276890 by: Adam Gerson
        276891 by: bruce
        276897 by: Thorsten Suckow-Homberg

Re: is there a problem with php script pulling HTML out of database as it 
writes the page??]
        276892 by: Rod Clay

Lookimg for a script....
        276893 by: Pete Holsberg
        276899 by: Daniel Brown

Re: DB search and case sensitive comparison
        276894 by: Chris

test
        276895 by: Børge Holen

Re: is there a problem with php script pulling HTML out of database as it 
writes the page??]]
        276896 by: Rod Clay

Downloading a file
        276898 by: Robbert van Andel

Your Event T's
        276900 by: Jeff Saxby

How can i get the location of an exit()/die() from within 
register_shutdown_function()?
        276901 by: Mathijs van Veluw

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 ---
If you are willing to use googles chart api ..

http://code.google.com/apis/chart/#radar

Nope. It's not something I need to implement, mmore a personal (albeit with this lists help) project.

--
Richard Heyes

Employ me:
http://www.phpguru.org/cv

--- End Message ---
--- Begin Message ---
At 8:26 PM +0100 7/15/08, Richard Heyes wrote:
If you are willing to use googles chart api ..

http://code.google.com/apis/chart/#radar

Nope. It's not something I need to implement, mmore a personal (albeit with this lists help) project.

--
Richard Heyes

Richard:

What do you want to implement as a radar chart?

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
What do you want to implement as a radar chart?

Nothing in particular. Just a generic radar chart for representing data.

--
Richard Heyes

Employ me:
http://www.phpguru.org/cv

--- End Message ---
--- Begin Message ---
At 8:21 PM +0200 7/15/08, Jochem Maas wrote:
Robert Cummings schreef:
On Tue, 2008-07-15 at 12:37 -0400, tedd wrote:
At 12:31 PM -0400 7/15/08, Robert Cummings wrote:
Umm... here it is to unlimited precision: 1Ž4

Cheers,
Rob.
Yeah and here's Ÿ

Like or not, that's all there is to it.

Weird... you're client bastar-dized my beautiful pi symbol.

no it's the worst round error ever. how exactly do you go
from 3.1 to .25 :-P

Well, someone's client took infinity and turned it into an integral.

tdd



--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message --- Hello. Again, I'm fairly new to php so please forgive me if my question is a very simple or obvious one.

I've just tried testing for the first time some php code that is pulling text out of a database to print it on the webpage. Some of this text includes HTML, specifically in this case an <img src="xxxxxxxxx"> statement. Much to my surprise, this is not working. Is there a problem with pulling HTML out of a database like this as the page is being written? There's no problem of course if my php code is writing the HTML to the page - in this case, the <img src="xxxxxx"> statement works fine and the image is displayed. Why is it a problem when my php script pulls the HTML code out of a database and writes it to the page from there??

It would appear that when my php script writes HTML to the page a process of some kind is executed to, in this case, get the image and put it on the page. Apparently this same process is NOT executed if the HTML is retrieved from a database and simply written to the page from there. Is this correct? And, if it is, can anyone suggest a workaround, another way to get done what I'm trying to do here?

Thanks for any help you can give me.

Rod Clay



--- End Message ---
--- Begin Message ---
On 15 Jul 2008, at 22:36, Rod Clay wrote:
Hello. Again, I'm fairly new to php so please forgive me if my question is a very simple or obvious one.

I've just tried testing for the first time some php code that is pulling text out of a database to print it on the webpage. Some of this text includes HTML, specifically in this case an <img src="xxxxxxxxx"> statement. Much to my surprise, this is not working. Is there a problem with pulling HTML out of a database like this as the page is being written? There's no problem of course if my php code is writing the HTML to the page - in this case, the <img src="xxxxxx"> statement works fine and the image is displayed. Why is it a problem when my php script pulls the HTML code out of a database and writes it to the page from there??

It would appear that when my php script writes HTML to the page a process of some kind is executed to, in this case, get the image and put it on the page. Apparently this same process is NOT executed if the HTML is retrieved from a database and simply written to the page from there. Is this correct? And, if it is, can anyone suggest a workaround, another way to get done what I'm trying to do here?

Code please, we're not mind readers!

-Stut

--
http://stut.net/

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

> -----Original Message-----
> From: Rod Clay [mailto:[EMAIL PROTECTED]
> Sent: 15 July 2008 22:36
> To: [EMAIL PROTECTED]
> Subject: [PHP] is there a problem with php script pulling HTML out of
> database as it writes the page??
> 
> Hello.  Again, I'm fairly new to php so please forgive me if my
> question
> is a very simple or obvious one.
> 
> I've just tried testing for the first time some php code that is
> pulling
> text out of a database to print it on the webpage.  Some of this text
> includes HTML, specifically in this case an <img src="xxxxxxxxx">
> statement.  Much to my surprise, this is not working.  Is there a
> problem with pulling HTML out of a database like this as the page is
> being written?
> 
> There's no problem of course if my php code is writing the HTML to the
> page - in this case, the <img src="xxxxxx"> statement works fine and
> the
> image is displayed.  Why is it a problem when my php script pulls the
> HTML code out of a database and writes it to the page from there??
> 
> It would appear that when my php script writes HTML to the page a
> process of some kind is executed to, in this case, get the image and
> put
> it on the page.  Apparently this same process is NOT executed if the
> HTML is retrieved from a database and simply written to the page from
> there.  Is this correct?  And, if it is, can anyone suggest a
> workaround, another way to get done what I'm trying to do here?
> 
> Thanks for any help you can give me.
> 
> Rod Clay

Have you got a code snippet??

Alex

No virus found in this outgoing message. Scanned by AVG Free 8.0
Checked by AVG - http://www.avg.com 
Version: 8.0.138 / Virus Database: 270.4.11/1553 - Release Date: 15/07/2008
05:48


--- End Message ---
--- Begin Message --- It would be helpful if you could clarify the error you are getting, but could be something involving quotes, stripslashes() and addslashes();


On Jul 15, 2008, at 2:36 PM, Rod Clay wrote:

Hello. Again, I'm fairly new to php so please forgive me if my question is a very simple or obvious one.

I've just tried testing for the first time some php code that is pulling text out of a database to print it on the webpage. Some of this text includes HTML, specifically in this case an <img src="xxxxxxxxx"> statement. Much to my surprise, this is not working. Is there a problem with pulling HTML out of a database like this as the page is being written? There's no problem of course if my php code is writing the HTML to the page - in this case, the <img src="xxxxxx"> statement works fine and the image is displayed. Why is it a problem when my php script pulls the HTML code out of a database and writes it to the page from there??

It would appear that when my php script writes HTML to the page a process of some kind is executed to, in this case, get the image and put it on the page. Apparently this same process is NOT executed if the HTML is retrieved from a database and simply written to the page from there. Is this correct? And, if it is, can anyone suggest a workaround, another way to get done what I'm trying to do here?

Thanks for any help you can give me.

Rod Clay



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



--- End Message ---
--- Begin Message --- Yes, here's the code that is retrieving "news items" from the database and printing them on the page (I do some other stuff with the text before, and after, I print it, for example, find the sentences, so I can print complete sentences, and not just pieces of sentences). As I say, occasionally these news items contain some HTML, e.g., the <img src="xxxxxxx"> statement. All of the text is being correctly retrieved from the database and written to the page, including the <img src="xxxxxxx"> statement, because I see it all in the page source of the page in my browser. However, the <img src="xxxxxxxx"> statement is NOT working, that is, the image does NOT appear on the page.

$result = mysql_query("SELECT * FROM newsitem ORDER BY newsitem_date DESC");
    if (mysql_num_rows($result) > 0)
    {
     $i = 1;
     while (($row = mysql_fetch_assoc($result)) && ($i < 6)) { ?>
      <div id="newsitem">
<p><?php echo $row['newsitem_date']; ?><b><i><br /> <?php $title = $row['title']; echo $title; echo "</i></b><br> by "; ?> <?php echo $row['author']; echo " of <em>"; echo $row['newsservice']; ?></em><br><br />
      <?php $newsitem_array = explode('.', $row['newsitem_text']);
     $print_newsitem = $newsitem_array[0] . ".";
     $length_newsitem = strlen($print_newsitem);
     for ($j = 1; $length_newsitem < 250; $j++) {
        $print_newsitem = $print_newsitem . $newsitem_array[$j] . ".";
        $length_newsitem = strlen($print_newsitem);
     }
     echo $print_newsitem;
echo "<br>"; $url_string = "<a href=\"" . $row['url'] . "\"> (read more of this article)</a>"; echo $url_string; $blog_result = mysql_query("SELECT * FROM blog where discussion = \"$title\"");
     if (mysql_num_rows($blog_result) > 0)
            $not = "";
     else
         $not = " not";
echo "<br>"; echo "This news item does$not have a blog discussion "; echo "&nbsp;&nbsp;";
     if (mysql_num_rows($blog_result) > 0)
echo "<a href=\"bloglist.php?discussion=$title\">Read this item's blog</a> ";
     else
echo "<a href=\"blog.php?discussion=$title\">Start a discussion on this item</a> ";
       $i++;
      ?>
      </p><br />
      </div>
    <?php
     }
    }
    ?>

Stut wrote:
On 15 Jul 2008, at 22:36, Rod Clay wrote:
Hello. Again, I'm fairly new to php so please forgive me if my question is a very simple or obvious one.

I've just tried testing for the first time some php code that is pulling text out of a database to print it on the webpage. Some of this text includes HTML, specifically in this case an <img src="xxxxxxxxx"> statement. Much to my surprise, this is not working. Is there a problem with pulling HTML out of a database like this as the page is being written? There's no problem of course if my php code is writing the HTML to the page - in this case, the <img src="xxxxxx"> statement works fine and the image is displayed. Why is it a problem when my php script pulls the HTML code out of a database and writes it to the page from there??

It would appear that when my php script writes HTML to the page a process of some kind is executed to, in this case, get the image and put it on the page. Apparently this same process is NOT executed if the HTML is retrieved from a database and simply written to the page from there. Is this correct? And, if it is, can anyone suggest a workaround, another way to get done what I'm trying to do here?

Code please, we're not mind readers!

-Stut


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

On Jul 15, 2008, at 3:06 PM, Rod Clay wrote:

All of the text is being correctly retrieved from the database and written to the page, including the <img src="xxxxxxx"> statement, because I see it all in the page source of the page in my browser. However, the <img src="xxxxxxxx"> statement is NOT working, that is, the image does NOT appear on the page.

What exactly is it printing? What is the doctype?


--- End Message ---
--- Begin Message --- It's (was) not printing anything. Here's the doctype statement: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>

HOWEVER, thanks for all of the responses so far, but please accept my apologies because evidently this is NOT a php question after all - I just tried another, much, much smaller photo and that is printing, so it would appear that it is a much more mundane problem, actually an HTML problem!!!

Again, please accept my apologies for this false alarm, but I had tested and tested and tested this and was stumped an hour ago! Thought it was a different kind of problem. Mea culpa! :-[

dg wrote:

On Jul 15, 2008, at 3:06 PM, Rod Clay wrote:

All of the text is being correctly retrieved from the database and written to the page, including the <img src="xxxxxxx"> statement, because I see it all in the page source of the page in my browser. However, the <img src="xxxxxxxx"> statement is NOT working, that is, the image does NOT appear on the page.

What exactly is it printing? What is the doctype?



--- End Message ---
--- Begin Message ---
On Tue, Jul 15, 2008 at 11:51 AM, Tiji varghese
<[EMAIL PROTECTED]> wrote:
> Hi All !
> I am having some problem with the code below. Everytime I run it it gives me 
> the following error:
> Warning: Cannot modify header information - headers already sent
> by (output started at
> C:\xampp\htdocs\practice.com\displayUserData.php:7) in 
> C:\xampp\htdocs\practice.com\displayUserData.php on line 12

    This message means that something was sent before line 12.  In
your case, the HTML.  All things that have to do with headers must be
before ANYTHING is sent to the browser.  If you need to have the HTML
before a setcookie(), header(), or another header-based PHP action,
check into ob_start() and the other output-buffering functions PHP has
available.

-- 
</Daniel P. Brown>
Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just
$59.99/mo. with no contract!
Dedicated servers, VPS, and hosting from $2.50/mo.

--- End Message ---
--- Begin Message --- By visiting php.info in a web browser I have confirmed the location of my php.ini file as /usr/local/php5/lib/php.ini. I open that file and edit the line:

; - display_errors = Off

and change it to

display_errors = On

I then retstart Appache and visit php.info which still reports display_errors = Off. What else can I do?

Thanks,
Adam


--- End Message ---
--- Begin Message ---
what os are you using?

if you're on linux, type:
 find / -name "php.ini"

do you see multiple copies of the php.ini file?

if you're on windows, use the search function to see if you have multiple
copies of php.ini.

if you really want to do a quick check to see if you're modifying the right
php.ini, just go ahead and rename it to something else, and then restart
apache, and check your results..



-----Original Message-----
From: Adam Gerson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2008 3:36 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Changing PHP.ini


By visiting php.info in a web browser I have confirmed the location of
my php.ini file as /usr/local/php5/lib/php.ini. I open that file and
edit the line:

; - display_errors = Off

and change it to

display_errors = On

I then retstart Appache and visit php.info which still reports
display_errors = Off. What else can I do?

Thanks,
Adam


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


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

By visiting php.info in a web browser I have confirmed the location of my php.ini file as /usr/local/php5/lib/php.ini. I open that file and edit the line:

; - display_errors = Off

and change it to

display_errors = On

I then retstart Appache and visit php.info which still reports display_errors = Off. What else can I do?

Should be simple: create a script with the following code:

<?php
phpinfo();
?>

Then open that script in your browser. The generated output does also provide information about the path of the loaded php.ini.
--- End Message ---
--- Begin Message --- Sorry, I'm back again with this same problem! Apparently the only reason it looked like it was solved an hour ago was because the <img src="xxxxxx"> statement I tried reading out of the database was pointing to an image already on the page!

When the <img src="xxxxxxx"> statement points to an image NOT already on the page, it doesn't work.

I thought the size of the image might be the problem, but no matter how small I make the image, it doesn't work.

Again, any insight into what might be the problem here would be MUCH appreciated.

Is it necessary for an <img src="xxxxxxx"> statement to be in the code of the script writing the page for the image to be correctly inserted onto the page? I believe that's the question.

It looks like when the <img src="xxxxxx"> statement is pulled from a database and copied onto the webpage, some kind of php or HTML parser doesn't get a chance to parse it, resolve it, and go retrieve the image to put it on the page!!!

I hope I'm wrong about this, but at this point I don't have any other plausible theory!!
--- Begin Message --- Yes, here's the code that is retrieving "news items" from the database and printing them on the page (I do some other stuff with the text before, and after, I print it, for example, find the sentences, so I can print complete sentences, and not just pieces of sentences). As I say, occasionally these news items contain some HTML, e.g., the <img src="xxxxxxx"> statement. All of the text is being correctly retrieved from the database and written to the page, including the <img src="xxxxxxx"> statement, because I see it all in the page source of the page in my browser. However, the <img src="xxxxxxxx"> statement is NOT working, that is, the image does NOT appear on the page.

$result = mysql_query("SELECT * FROM newsitem ORDER BY newsitem_date DESC");
    if (mysql_num_rows($result) > 0)
    {
     $i = 1;
     while (($row = mysql_fetch_assoc($result)) && ($i < 6)) { ?>
      <div id="newsitem">
<p><?php echo $row['newsitem_date']; ?><b><i><br /> <?php $title = $row['title']; echo $title; echo "</i></b><br> by "; ?> <?php echo $row['author']; echo " of <em>"; echo $row['newsservice']; ?></em><br><br />
      <?php $newsitem_array = explode('.', $row['newsitem_text']);
     $print_newsitem = $newsitem_array[0] . ".";
     $length_newsitem = strlen($print_newsitem);
     for ($j = 1; $length_newsitem < 250; $j++) {
        $print_newsitem = $print_newsitem . $newsitem_array[$j] . ".";
        $length_newsitem = strlen($print_newsitem);
     }
     echo $print_newsitem;
echo "<br>"; $url_string = "<a href=\"" . $row['url'] . "\"> (read more of this article)</a>"; echo $url_string; $blog_result = mysql_query("SELECT * FROM blog where discussion = \"$title\"");
     if (mysql_num_rows($blog_result) > 0)
            $not = "";
     else
         $not = " not";
echo "<br>"; echo "This news item does$not have a blog discussion "; echo "&nbsp;&nbsp;";
     if (mysql_num_rows($blog_result) > 0)
echo "<a href=\"bloglist.php?discussion=$title\">Read this item's blog</a> ";
     else
echo "<a href=\"blog.php?discussion=$title\">Start a discussion on this item</a> ";
       $i++;
      ?>
      </p><br />
      </div>
    <?php
     }
    }
    ?>

Stut wrote:
On 15 Jul 2008, at 22:36, Rod Clay wrote:
Hello. Again, I'm fairly new to php so please forgive me if my question is a very simple or obvious one.

I've just tried testing for the first time some php code that is pulling text out of a database to print it on the webpage. Some of this text includes HTML, specifically in this case an <img src="xxxxxxxxx"> statement. Much to my surprise, this is not working. Is there a problem with pulling HTML out of a database like this as the page is being written? There's no problem of course if my php code is writing the HTML to the page - in this case, the <img src="xxxxxx"> statement works fine and the image is displayed. Why is it a problem when my php script pulls the HTML code out of a database and writes it to the page from there??

It would appear that when my php script writes HTML to the page a process of some kind is executed to, in this case, get the image and put it on the page. Apparently this same process is NOT executed if the HTML is retrieved from a database and simply written to the page from there. Is this correct? And, if it is, can anyone suggest a workaround, another way to get done what I'm trying to do here?

Code please, we're not mind readers!

-Stut


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



--- End Message ---

--- End Message ---
--- Begin Message --- Can anyone point me to a (free) script that will ask for a person's email address and username, and then look up the password that's in a plain text file?

Thanks.


--- End Message ---
--- Begin Message ---
On Tue, Jul 15, 2008 at 7:34 PM, Pete Holsberg <[EMAIL PROTECTED]> wrote:
> Can anyone point me to a (free) script that will ask for a person's email
> address and username, and then look up the password that's in a plain text
> file?

    http://www.google.com/search?q=flat-file+php+user+management

-- 
</Daniel P. Brown>
Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just
$59.99/mo. with no contract!
Dedicated servers, VPS, and hosting from $2.50/mo.

--- End Message ---
--- Begin Message ---
> Now what I need to do is to ensure that the lookup_string is in the
> useragent string and the CASE is the same: IE: Mozilla and not MOZILLA or
> mozilla etc...

Make the database do the work if possible.

mysql> select * from a where a like '%MOZILLA%';
+---------+
| a       |
+---------+
| Mozilla |
| MOZILLA |
+---------+
2 rows in set (0.00 sec)

mysql> select * from a where a like BINARY '%MOZILLA%';
+---------+
| a       |
+---------+
| MOZILLA |
+---------+
1 row in set (0.00 sec)


-- 
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
test
-- 
---
Børge Holen
http://www.arivene.net

--- End Message ---
--- Begin Message --- OK. Once again, a problem I thought was abstruse and formidable turns out to be ridiculously simple and embarrassingly obvious (once you realize what it is - image not in web server directory!!!) But I didn't know until this happened that the browser sends a follow-up request to the web server for the images it finds specified on the page. This is a very useful piece of knowledge!! It made it obvious that I was looking for the problem in all the wrong places! Sorry for the false alarm. Next time I'll try to have a real problem everyone can sink their teeth into!!
--- Begin Message --- Sorry, I'm back again with this same problem! Apparently the only reason it looked like it was solved an hour ago was because the <img src="xxxxxx"> statement I tried reading out of the database was pointing to an image already on the page!

When the <img src="xxxxxxx"> statement points to an image NOT already on the page, it doesn't work.

I thought the size of the image might be the problem, but no matter how small I make the image, it doesn't work.

Again, any insight into what might be the problem here would be MUCH appreciated.

Is it necessary for an <img src="xxxxxxx"> statement to be in the code of the script writing the page for the image to be correctly inserted onto the page? I believe that's the question.

It looks like when the <img src="xxxxxx"> statement is pulled from a database and copied onto the webpage, some kind of php or HTML parser doesn't get a chance to parse it, resolve it, and go retrieve the image to put it on the page!!!

I hope I'm wrong about this, but at this point I don't have any other plausible theory!!
--- Begin Message --- Yes, here's the code that is retrieving "news items" from the database and printing them on the page (I do some other stuff with the text before, and after, I print it, for example, find the sentences, so I can print complete sentences, and not just pieces of sentences). As I say, occasionally these news items contain some HTML, e.g., the <img src="xxxxxxx"> statement. All of the text is being correctly retrieved from the database and written to the page, including the <img src="xxxxxxx"> statement, because I see it all in the page source of the page in my browser. However, the <img src="xxxxxxxx"> statement is NOT working, that is, the image does NOT appear on the page.

$result = mysql_query("SELECT * FROM newsitem ORDER BY newsitem_date DESC");
    if (mysql_num_rows($result) > 0)
    {
     $i = 1;
     while (($row = mysql_fetch_assoc($result)) && ($i < 6)) { ?>
      <div id="newsitem">
<p><?php echo $row['newsitem_date']; ?><b><i><br /> <?php $title = $row['title']; echo $title; echo "</i></b><br> by "; ?> <?php echo $row['author']; echo " of <em>"; echo $row['newsservice']; ?></em><br><br />
      <?php $newsitem_array = explode('.', $row['newsitem_text']);
     $print_newsitem = $newsitem_array[0] . ".";
     $length_newsitem = strlen($print_newsitem);
     for ($j = 1; $length_newsitem < 250; $j++) {
        $print_newsitem = $print_newsitem . $newsitem_array[$j] . ".";
        $length_newsitem = strlen($print_newsitem);
     }
     echo $print_newsitem;
echo "<br>"; $url_string = "<a href=\"" . $row['url'] . "\"> (read more of this article)</a>"; echo $url_string; $blog_result = mysql_query("SELECT * FROM blog where discussion = \"$title\"");
     if (mysql_num_rows($blog_result) > 0)
            $not = "";
     else
         $not = " not";
echo "<br>"; echo "This news item does$not have a blog discussion "; echo "&nbsp;&nbsp;";
     if (mysql_num_rows($blog_result) > 0)
echo "<a href=\"bloglist.php?discussion=$title\">Read this item's blog</a> ";
     else
echo "<a href=\"blog.php?discussion=$title\">Start a discussion on this item</a> ";
       $i++;
      ?>
      </p><br />
      </div>
    <?php
     }
    }
    ?>

Stut wrote:
On 15 Jul 2008, at 22:36, Rod Clay wrote:
Hello. Again, I'm fairly new to php so please forgive me if my question is a very simple or obvious one.

I've just tried testing for the first time some php code that is pulling text out of a database to print it on the webpage. Some of this text includes HTML, specifically in this case an <img src="xxxxxxxxx"> statement. Much to my surprise, this is not working. Is there a problem with pulling HTML out of a database like this as the page is being written? There's no problem of course if my php code is writing the HTML to the page - in this case, the <img src="xxxxxx"> statement works fine and the image is displayed. Why is it a problem when my php script pulls the HTML code out of a database and writes it to the page from there??

It would appear that when my php script writes HTML to the page a process of some kind is executed to, in this case, get the image and put it on the page. Apparently this same process is NOT executed if the HTML is retrieved from a database and simply written to the page from there. Is this correct? And, if it is, can anyone suggest a workaround, another way to get done what I'm trying to do here?

Code please, we're not mind readers!

-Stut


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




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

--- End Message ---

--- End Message ---
--- Begin Message ---
I am having trouble getting a file to download to work in Internet Explorer.
The site works fine in FireFox.   The page retrieves the contents of a file
from a database and outputs the following

 

<?PHP

               

header("Content-type: application/octet-stream");

header("Content-Disposition: attachment; filename=\"{$data['filename']}\"");

header("Content-Description: PHP Generated Data");

echo $data['file'];

               

?>

 

Where $data['filename'] is the name of the file as stored in the database
and $data['file'] is the contents of the file.  The script used to download
the file is called view.php.  As I mentioned, this works great in FireFox
but with Internet Explorer, I get the following error:

 

Internet Explorer cannot download view.php from www.yourdomain.com.

 

Internet Explorer was not able to open this Internet site. The requested
site is either unavailable or cannot be found. Please try again later.

 

Any help would be greatly appreciated.

 

Robbert


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

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

I have an shutdown function to catch fatal-errors etc..
Now when there is an exit() somewhere i get an empty message from 
get_last_error().
I want to know the location of this exit() or die().

Is there a way to get the file and line-number from where the exit/die 
originated?

Thx in advance.

--- End Message ---

Reply via email to