This is a discussion on newbie needs major help within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hello all I have a list of weblog (blog) entries within a MySQL database which are being retrieved by index....
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello all
I have a list of weblog (blog) entries within a MySQL database which are being retrieved by index.php using the string of $mid=9 where '9' is the current month (September) that I want retrieved. Is there a way of automatically retrieving the month depending on what current month we are in so that when users go to my website they see the current months entries displayed and which changes as the month changes, i.e. the index page retrieves October's entries when the month changes to October? For an example, you can visit www.mightymouse.net and click on the 'log' link, you'll notice how the current months entries are displayed automatically without any user interaction. Please Help. Many thanks. Sippy |
|
|||
|
Sippy wrote:
> Hello all > > I have a list of weblog (blog) entries within a MySQL database which are > being retrieved by index.php using the string of $mid=9 where '9' is the > current month (September) that I want retrieved. Is there a way of > automatically retrieving the month depending on what current month we are in > so that when users go to my website they see the current months entries > displayed and which changes as the month changes, i.e. the index page > retrieves October's entries when the month changes to October? For an > example, you can visit www.mightymouse.net and click on the 'log' link, > you'll notice how the current months entries are displayed automatically > without any user interaction. > > Please Help. > > Many thanks. > > Sippy > > See manual: http://www.php.net/date http://www.php.net/empty http://www.php.net/header PHP Code:
Goodluck. Mouse. |
|
|||
|
Thanks for your help, Mouse
I've tried the code but it comes up with this PHP error: Parse error: parse error, unexpected '{' in /home/demon/public_html/sippy/index.php on line 3 Any ideas as to why that is happening? "@neotm.homelinux.org^',^" <".??????????????????????? wrote in message news:ch77ln$qpi$1@reader10.wxs.nl... > Sippy wrote: > > Hello all > > > > I have a list of weblog (blog) entries within a MySQL database which are > > being retrieved by index.php using the string of $mid=9 where '9' is the > > current month (September) that I want retrieved. Is there a way of > > automatically retrieving the month depending on what current month we are in > > so that when users go to my website they see the current months entries > > displayed and which changes as the month changes, i.e. the index page > > retrieves October's entries when the month changes to October? For an > > example, you can visit www.mightymouse.net and click on the 'log' link, > > you'll notice how the current months entries are displayed automatically > > without any user interaction. > > > > Please Help. > > > > Many thanks. > > > > Sippy > > > > > > See manual: http://www.php.net/date > http://www.php.net/empty > http://www.php.net/header > > PHP Code:
> > Goodluck. > > Mouse. |
|
|||
|
Sippy wrote:
if ( empty($_GET['mid']) ) { $month = date(m); header("Location: index.php?mid=$month"); } i forgot one `)` But this is not a put-your-script-request-here-place. Use your own brains, also ;-) And if you think, the manual from php.net is to hard. try a book: http://www.oreilly.com/catalog/learnphp5/ Mouse. > Thanks for your help, Mouse > > I've tried the code but it comes up with this PHP error: > Parse error: parse error, unexpected '{' in > /home/demon/public_html/sippy/index.php on line 3 > > Any ideas as to why that is happening? > > > "@neotm.homelinux.org^',^" <".??????????????????????? wrote in message > news:ch77ln$qpi$1@reader10.wxs.nl... > >>Sippy wrote: >> >>>Hello all >>> >>>I have a list of weblog (blog) entries within a MySQL database which are >>>being retrieved by index.php using the string of $mid=9 where '9' is the >>>current month (September) that I want retrieved. Is there a way of >>>automatically retrieving the month depending on what current month we > > are in > >>>so that when users go to my website they see the current months entries >>>displayed and which changes as the month changes, i.e. the index page >>>retrieves October's entries when the month changes to October? For an >>>example, you can visit www.mightymouse.net and click on the 'log' link, >>>you'll notice how the current months entries are displayed automatically >>>without any user interaction. >>> >>>Please Help. >>> >>>Many thanks. >>> >>>Sippy >>> >>> >> >>See manual: http://www.php.net/date >>http://www.php.net/empty >>http://www.php.net/header >> >> PHP Code:
>> >>Goodluck. >> >>Mouse. > > > |
|
|||
|
Hello Maurice,
Before I begin, I have to say a huge thank you to yourself for kindly helping me out - it works a charm. I know that this isn't a 'request a script' news server, and in my defence, I have to say that I am currently learning PHP and that I did try a piece of code created by myself which looked similar to your code except the 'if ( empty($_GET['mid']) )' but the page wouldn't load, it just came up with a blank page! Thanks anyway, I really appreciate it :) "Maurice" <neotm_dont|S.P..a..M@neotm.homelinux.org> wrote in message news:ch7nme$dt5$1@reader13.wxs.nl... > Sippy wrote: > > if ( empty($_GET['mid']) ) > { > $month = date(m); > header("Location: index.php?mid=$month"); > } > > i forgot one `)` > But this is not a put-your-script-request-here-place. > Use your own brains, also ;-) > > And if you think, the manual from php.net is to hard. > try a book: http://www.oreilly.com/catalog/learnphp5/ > > Mouse. > > > Thanks for your help, Mouse > > > > I've tried the code but it comes up with this PHP error: > > Parse error: parse error, unexpected '{' in > > /home/demon/public_html/sippy/index.php on line 3 > > > > Any ideas as to why that is happening? > > > > > > "@neotm.homelinux.org^',^" <".??????????????????????? wrote in message > > news:ch77ln$qpi$1@reader10.wxs.nl... > > > >>Sippy wrote: > >> > >>>Hello all > >>> > >>>I have a list of weblog (blog) entries within a MySQL database which are > >>>being retrieved by index.php using the string of $mid=9 where '9' is the > >>>current month (September) that I want retrieved. Is there a way of > >>>automatically retrieving the month depending on what current month we > > > > are in > > > >>>so that when users go to my website they see the current months entries > >>>displayed and which changes as the month changes, i.e. the index page > >>>retrieves October's entries when the month changes to October? For an > >>>example, you can visit www.mightymouse.net and click on the 'log' link, > >>>you'll notice how the current months entries are displayed automatically > >>>without any user interaction. > >>> > >>>Please Help. > >>> > >>>Many thanks. > >>> > >>>Sippy > >>> > >>> > >> > >>See manual: http://www.php.net/date > >>http://www.php.net/empty > >>http://www.php.net/header > >> > >> PHP Code:
> >> > >>Goodluck. > >> > >>Mouse. > > > > > > |
|
|||
|
"Sippy" <demonnet@btinternet.com> wrote in message
news:ch7vep$p3$1@hercules.btinternet.com... > Hello Maurice, > > Before I begin, I have to say a huge thank you to yourself for kindly > helping me out - it works a charm. > > I know that this isn't a 'request a script' news server, and in my defence, > I have to say that I am currently learning PHP and that I did try a piece of > code created by myself which looked similar to your code except the 'if ( > empty($_GET['mid']) )' but the page wouldn't load, it just came up with a > blank page! > > Thanks anyway, I really appreciate it :) > In which case the proper netiquette would be to post your failing code and ask for help with it. - Virgil |