newbie needs major help

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


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-02-2004
Sippy
 
Posts: n/a
Default newbie needs major help

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


Reply With Quote
  #2 (permalink)  
Old 09-02-2004
@neotm.homelinux.org^',^
 
Posts: n/a
Default Re: newbie needs major help

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:

if ( empty($_GET['mid'])
{
$month date(m);
header("Location: index.php?mid=$month");


Goodluck.

Mouse.
Reply With Quote
  #3 (permalink)  
Old 09-02-2004
Sippy
 
Posts: n/a
Default Re: newbie needs major help

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:
>
> if ( empty(
$_GET['mid'])
> {
$month date(m);
header("Location: index.php?mid=$month");
> }
>

>
>
> Goodluck.
>
> Mouse.



Reply With Quote
  #4 (permalink)  
Old 09-02-2004
Maurice
 
Posts: n/a
Default Re: newbie needs major help

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:
>>
>>if ( empty(
$_GET['mid'])
>>{
>>
$month date(m);
>>
header("Location: index.php?mid=$month");
>>}
>>
>> 
>>
>>
>>Goodluck.
>>
>>Mouse.

>
>
>

Reply With Quote
  #5 (permalink)  
Old 09-02-2004
Sippy
 
Posts: n/a
Default Re: newbie needs major help

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:
> >>
> >>if ( empty(
$_GET['mid'])
> >>{
> >>
$month date(m);
> >>
header("Location: index.php?mid=$month");
> >>}
> >>
> >> 
> >>
> >>
> >>Goodluck.
> >>
> >>Mouse.

> >
> >
> >




Reply With Quote
  #6 (permalink)  
Old 09-03-2004
Virgil Green
 
Posts: n/a
Default Re: newbie needs major help

"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


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 03:37 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0