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 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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']) |
|
|||
|
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']) |
|
|||
|
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 |
|
|||
|
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. |
|
|||
|
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']) > > |
|
|||
|
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']) > > > > > > |