[thelist] php - displaying default data
Travis
tr at hl-productions.com
Wed Jan 28 21:14:27 CST 2004
That did it. Thanks alot!
Travis
----- Original Message -----
From: "Manuel González Noriega" <manuel at simplelogica.net>
To: <thelist at lists.evolt.org>
Sent: Wednesday, January 28, 2004 06:07 PM
Subject: Re: [thelist] php - displaying default data
> El mié, 28-01-2004 a las 23:23, Travis escribió:
>
> First, this is not an error but a notice, with the "error reporting"
> settings in php.ini you can switch off the error messages for this kind
> of issues
>
> > Here are the errors I'm gettting:
> >
> > Notice: Undefined index: month
> > Notice: Undefined index: year
>
> > Once you choose a link, it works fine. Here's my php code that works
fine:
> >
> > <?
> > $monthTemp = $_GET["month"];
> > $yearTemp = $_GET["year"];
> > ?>
> >
>
> Ok, the first time you enter the page $_GET[] is empty and thus the
> notices. Let's get down to business
>
> http://php.net/isset
>
> // Check than both variables exist
> if (isset($_GET['month']) && isset($_GET['year'])) {
>
> // If so, assign
> $monthTemp = $_GET["month"];
> $yearTemp = $_GET["year"];
> include( "blog/$yearTemp/$monthTemp.php" );
>
> }
>
> else {
> // If they ain't set, proceed as desired
>
> }
>
>
> Note you could also use if (!empty($_GET))
>
> http://php.net/empty
>
> HTH :)
> --
> Manuel González Noriega
> Simplelógica, construcción web
> URL: http://simplelogica.net
> EMAIL: simplelogica at simplelogica.net
> TELEFONO: (+34) 985 22 12 65
>
> Logicola es el weblog de Simplelógica http://simplelogica.net/logicola/
>
> --
> * * Please support the community that supports you. * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>
More information about the thelist
mailing list