OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
php-general Digest 26 May 2007 13:32:07 -0000 Issue 4812

php-general-digest-helplists.php.net
Date: Sat May 26 2007 - 08:32:07 CDT


php-general Digest 26 May 2007 13:32:07 -0000 Issue 4812

Topics (messages 255671 through 255678):

Re: PHP debugger
        255671 by: Miles Thompson

installing error
        255672 by: Rafael Mora
        255675 by: Richard Davey
        255676 by: Tijnema
        255677 by: Sathyashrayan

Using PHP to retrieve and display file from MySQL database
        255673 by: benc11.gmail.com
        255674 by: Jared Farrish

Re: Form Validation Issues
        255678 by: David Robley

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


On 5/25/07, Jochem Maas <jochemiamjochem.com> wrote:
> Miles Thompson wrote:
>
> ....
>
> > Suggestions will be most welcome. Also, I'm not married to this, so if
> > anyone thinks there is a better debugger, please jump in.
>
> I'm not going to jump in there ... I almost drown in that quagmire
> everytime I have to get a debugger setup working ... but ...
>
> >
> > Regards - Miles Thompson
> >
> > PS Why are we doing this? Because we are getting tired of debugging
> > with Javascript alert() boxes. /mt
> >
> > PPS And we are using those because of Joomla! Some things are buried
> > so deeply we cannot use print() or echo(). /mt
>
> 2 things:
>
> 1. when you have no hair left whatsoever:
>
> var_dump($foo); exit;
>
> 2. error_log() is your friend .... tail the log and run the code.
>
> just a thought.
>

Hey Jochem,

It's been a long slog, and I'm still playing with "test" programs to
figure out how things work. It sure isn't like using a desktop
debugger, especially as we are doing it all remotely.

Thanks for your comments - Miles

attached mail follows:


Hello does anyone know the correct way to install PHP and APACHE (last
versions both of them) on WinXP???, Im doing it with the installers and I
cannot even run phpinfo(); script, I see apache's error log and it says that
i cant find SAM directory

Thank you in advance
Rafa

attached mail follows:


Hi Rafael,

Saturday, May 26, 2007, 12:38:15 AM, you wrote:

> Hello does anyone know the correct way to install PHP and APACHE (last
> versions both of them) on WinXP???, Im doing it with the installers and I
> cannot even run phpinfo(); script, I see apache's error log and it says that
> i cant find SAM directory

http://wamp.corephp.co.uk

Cheers,

Rich
--
Zend Certified Engineer
http://www.corephp.co.uk

"Never trust a computer you can't throw out of a window"

attached mail follows:


On 5/26/07, Richard Davey <richcorephp.co.uk> wrote:
> Hi Rafael,
>
> Saturday, May 26, 2007, 12:38:15 AM, you wrote:
>
> > Hello does anyone know the correct way to install PHP and APACHE (last
> > versions both of them) on WinXP???, Im doing it with the installers and I
> > cannot even run phpinfo(); script, I see apache's error log and it says that
> > i cant find SAM directory
>
> http://wamp.corephp.co.uk
>
> Cheers,
>
> Rich

You could also try programs like "EasyPHP", it contains
Apache/PHP/MySQL/PHPMyAdmin in one installer package.

Tijnema

attached mail follows:


On 5/26/07, Tijnema <tijnemagmail.com> wrote:
>
> On 5/26/07, Richard Davey <richcorephp.co.uk> wrote:
> > Hi Rafael,
> >
> > Saturday, May 26, 2007, 12:38:15 AM, you wrote:
> >
> > > Hello does anyone know the correct way to install PHP and APACHE (last
> > > versions both of them) on WinXP???, Im doing it with the installers
> and I
> > > cannot even run phpinfo(); script, I see apache's error log and it
> says that
> > > i cant find SAM directory
> >
> > http://wamp.corephp.co.uk
> >
> > Cheers,
> >
> > Rich

May be this helps.

http://www.tanguay.info/wamp/installPhp5.php5

--
"War doesn't determine who is right, war determines who is left."
                                                                 Chinese
proverb

attached mail follows:


I am trying to download a file from MySQL and display it using the
following PHP script,
but it isn't displaying the file just a list of files in the database.
 Please help.

---- Code Begin ----
<?
if(isset($_GET['id']))
{
        include 'library/config.php';
        include 'library/opendb.php';

        $id = $_GET['id'];
        $query = "SELECT name, type, size, content FROM upload WHERE id = '$id'";
        $result = mysql_query($query) or die('Error, query failed');
        list($name, $type, $size, $content) = mysql_fetch_array($result);

        header("Content-Disposition: attachment; filename=$name");
        header("Content-length: $size");
        header("Content-type: $type");
        echo $content;

        include 'library/closedb.php';
        exit;
}

?>
<html>
<head>
<title>Download File From MySQL</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?
include 'library/config.php';
include 'library/opendb.php';

$query = "SELECT id, name FROM upload";
$result = mysql_query($query) or die('Error, query failed');
if(mysql_num_rows($result) == 0)
{
        echo "Database is empty <br>";
}
else
{
        while(list($id, $name) = mysql_fetch_array($result))
        {
?>
        <a href="download.php?id=<?=$id;?>"><?=$name;?></a> <br>
<?
        }
}
include 'library/closedb.php';
?>
</body>
</html>

---- Code End ----

attached mail follows:


>>> <a href="download.php?id=<?=$id;?>"><?=$name;?></a> <br>

Is there a valid $id being passed through a query ($_GET) variable, like
so?:

http://www.filecircus.com/somewhere/outthere/gimme.php?id=badphoto103

What happens when you click on that?

--
Jared Farrish
Intermediate Web Developer
Denton, Tx

Abraham Maslow: "If the only tool you have is a hammer, you tend to see
every problem as a nail." $$

attached mail follows:


tedd wrote:

<SNIP on topic stuff>

>> "Some men are born to greatness, some achieve greatness,
>> and some have greatness thrust upon them."
>>
>>Unknown
>
> Hi Jim:
>
> You might try the array below and the quote above, I believe, was
> Douglas MacArthur of WWII fame.

Is that the same Douglas MacArthur who was once known as William
Shakespeare :-) IIRC that is from Twelfth Night.

Cheers
--
David Robley

No, I'm from Iowa. I only work in Outer Space.
Today is Sweetmorn, the 73rd day of Discord in the YOLD 3173.