How to detect first page entry?

This is a discussion on How to detect first page entry? within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hello, On first entry of my webpage(.php) a specific function must be omitted. On next entries (by clicking a ...


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-26-2005
Henk van Winkoop
 
Posts: n/a
Default How to detect first page entry?

Hello,

On first entry of my webpage(.php) a specific function must be omitted.
On next entries (by clicking a submit button on that page) the specific
function must be executed.

How does my php file distinghuis between first entry and next entries?

I tried isset()/empty()/is_null() variable functions and $GLOBALS but all
variables seems to be cleared/reset on re-entry of the webpage.

How to solve this problem?

Thanks

Henk



Reply With Quote
  #2 (permalink)  
Old 09-26-2005
Kleist
 
Posts: n/a
Default Re: How to detect first page entry?

Henk van Winkoop wrote:
> Hello,
>
> On first entry of my webpage(.php) a specific function must be omitted.
> On next entries (by clicking a submit button on that page) the specific
> function must be executed.
>
> How does my php file distinghuis between first entry and next entries?
>
> I tried isset()/empty()/is_null() variable functions and $GLOBALS but all
> variables seems to be cleared/reset on re-entry of the webpage.
>
> How to solve this problem?



You can check, wether submit button was pressed. If it was,
execute the function. (if $_POST['button_name'])
Reply With Quote
  #3 (permalink)  
Old 09-26-2005
Henk van Winkoop
 
Posts: n/a
Default Re: How to detect first page entry?

Hello,

thanks for your quick answer.

Well I was mistaken, it's not a submit button, it's a picture with an
onclick/submit event:

(A HREF=''><img Src="" OnClick="submit();"></A>

so there's no 'button_name'

Henk


"Kleist" <kleist@tlen.pl> schreef in bericht
news:dh8bfm$1gac$1@news.uar.net...
> Henk van Winkoop wrote:
> > Hello,
> >
> > On first entry of my webpage(.php) a specific function must be omitted.
> > On next entries (by clicking a submit button on that page) the specific
> > function must be executed.
> >
> > How does my php file distinghuis between first entry and next entries?
> >
> > I tried isset()/empty()/is_null() variable functions and $GLOBALS but

all
> > variables seems to be cleared/reset on re-entry of the webpage.
> >
> > How to solve this problem?

>
>
> You can check, wether submit button was pressed. If it was,
> execute the function. (if $_POST['button_name'])



Reply With Quote
  #4 (permalink)  
Old 09-26-2005
Kleist
 
Posts: n/a
Default Re: How to detect first page entry?

Henk van Winkoop wrote:
> Hello,
>
> thanks for your quick answer.
>
> Well I was mistaken, it's not a submit button, it's a picture with an
> onclick/submit event:
>
> (A HREF=''><img Src="" OnClick="submit();"></A>
>
> so there's no 'button_name'
>
> Henk
>
>
> "Kleist" <kleist@tlen.pl> schreef in bericht
> news:dh8bfm$1gac$1@news.uar.net...
>
>>Henk van Winkoop wrote:
>>
>>>Hello,
>>>
>>>On first entry of my webpage(.php) a specific function must be omitted.
>>>On next entries (by clicking a submit button on that page) the specific
>>>function must be executed.
>>>
>>>How does my php file distinghuis between first entry and next entries?
>>>
>>>I tried isset()/empty()/is_null() variable functions and $GLOBALS but

>
> all
>
>>>variables seems to be cleared/reset on re-entry of the webpage.
>>>
>>>How to solve this problem?

>>
>>
>>You can check, wether submit button was pressed. If it was,
>>execute the function. (if $_POST['button_name'])

>
>
>


Set then you have to assign a value to a hidden input by
javascript and check this value in the same way
Reply With Quote
  #5 (permalink)  
Old 09-26-2005
Colin McKinnon
 
Posts: n/a
Default Re: How to detect first page entry?

Henk van Winkoop wrote:

> Hello,
>
> On first entry of my webpage(.php) a specific function must be omitted.
> On next entries (by clicking a submit button on that page) the specific
> function must be executed.
>
> How does my php file distinghuis between first entry and next entries?
>
> I tried isset()/empty()/is_null() variable functions and $GLOBALS but all
> variables seems to be cleared/reset on re-entry of the webpage.
>


Use sessions.

C.
Reply With Quote
  #6 (permalink)  
Old 09-26-2005
Fabian Hore
 
Posts: n/a
Default Re: How to detect first page entry?

if the form has method="post" you could do -


if( $_SERVER['REQUEST_METHOD'] == 'POST' ){
//
}





"Henk van Winkoop" <h.van.winkoop@wxs.nl> wrote in message
news:4337b766$0$24501$ba620dc5@text.nova.planet.nl ...
> Hello,
>
> thanks for your quick answer.
>
> Well I was mistaken, it's not a submit button, it's a picture with an
> onclick/submit event:
>
> (A HREF=''><img Src="" OnClick="submit();"></A>
>
> so there's no 'button_name'
>
> Henk
>
>
> "Kleist" <kleist@tlen.pl> schreef in bericht
> news:dh8bfm$1gac$1@news.uar.net...
>> Henk van Winkoop wrote:
>> > Hello,
>> >
>> > On first entry of my webpage(.php) a specific function must be omitted.
>> > On next entries (by clicking a submit button on that page) the specific
>> > function must be executed.
>> >
>> > How does my php file distinghuis between first entry and next entries?
>> >
>> > I tried isset()/empty()/is_null() variable functions and $GLOBALS but

> all
>> > variables seems to be cleared/reset on re-entry of the webpage.
>> >
>> > How to solve this problem?

>>
>>
>> You can check, wether submit button was pressed. If it was,
>> execute the function. (if $_POST['button_name'])

>
>



Reply With Quote
  #7 (permalink)  
Old 09-27-2005
Henk van Winkoop
 
Posts: n/a
Default Re: How to detect first page entry?

Thanks,

Henk

"Fabian Hore" <fabianhore@email.com> schreef in bericht
news:43382013$0$3613$cc9e4d1f@news.dial.pipex.com. ..
> if the form has method="post" you could do -
>
>
> if( $_SERVER['REQUEST_METHOD'] == 'POST' ){
> //
> }
>
>
>
>
>
> "Henk van Winkoop" <h.van.winkoop@wxs.nl> wrote in message
> news:4337b766$0$24501$ba620dc5@text.nova.planet.nl ...
> > Hello,
> >
> > thanks for your quick answer.
> >
> > Well I was mistaken, it's not a submit button, it's a picture with an
> > onclick/submit event:
> >
> > (A HREF=''><img Src="" OnClick="submit();"></A>
> >
> > so there's no 'button_name'
> >
> > Henk
> >
> >
> > "Kleist" <kleist@tlen.pl> schreef in bericht
> > news:dh8bfm$1gac$1@news.uar.net...
> >> Henk van Winkoop wrote:
> >> > Hello,
> >> >
> >> > On first entry of my webpage(.php) a specific function must be

omitted.
> >> > On next entries (by clicking a submit button on that page) the

specific
> >> > function must be executed.
> >> >
> >> > How does my php file distinghuis between first entry and next

entries?
> >> >
> >> > I tried isset()/empty()/is_null() variable functions and $GLOBALS but

> > all
> >> > variables seems to be cleared/reset on re-entry of the webpage.
> >> >
> >> > How to solve this problem?
> >>
> >>
> >> You can check, wether submit button was pressed. If it was,
> >> execute the function. (if $_POST['button_name'])

> >
> >

>
>



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 01:45 AM.


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