keithschm Posted March 29, 2006 Share Posted March 29, 2006 ok so I have a form that reads and writes to a datbase no problem. when the page loads it has a drop down menu with data and I can pick a name and hit view edit delete, or new to enter a new entry I am doing these options with [code]if(isset($_POST['view'])){[/code]and an entry with view/edit etc..I want when the first page loads to show some data, but only on the first load. not when view or edit is selcted do I ned an if or what. I am not sure.Thanks Link to comment https://forums.phpfreaks.com/topic/6099-help-with-_post/ Share on other sites More sharing options...
ober Posted March 29, 2006 Share Posted March 29, 2006 You need a if/else:[code]<?phpif(isset($_POST['view'])){ // do whatever}else{ // show data}?>[/code]You can add more to that if you want certain things to happen if something else in the post is set. Just add an "else if(isset(whatever)). Link to comment https://forums.phpfreaks.com/topic/6099-help-with-_post/#findComment-21948 Share on other sites More sharing options...
keithschm Posted March 29, 2006 Author Share Posted March 29, 2006 so I shoud do [code]if(isset($_POST['view'])){ // do whatever}if(isset($_POST['edit])){do what ever}if(isset($_POST['new'])){do what ever}else{ // show data}?>[/code] Link to comment https://forums.phpfreaks.com/topic/6099-help-with-_post/#findComment-21978 Share on other sites More sharing options...
ober Posted March 29, 2006 Share Posted March 29, 2006 [code]<?phpif (isset($_POST['view'])){ // view!}elseif(isset($_POST['edit])){ // edit!}elseif(isset($_POST['new'])){ // new!}else{ // show data}?>[/code] Link to comment https://forums.phpfreaks.com/topic/6099-help-with-_post/#findComment-21982 Share on other sites More sharing options...
keithschm Posted March 29, 2006 Author Share Posted March 29, 2006 thank you Link to comment https://forums.phpfreaks.com/topic/6099-help-with-_post/#findComment-21985 Share on other sites More sharing options...
ober Posted March 29, 2006 Share Posted March 29, 2006 Anytime. Link to comment https://forums.phpfreaks.com/topic/6099-help-with-_post/#findComment-21988 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.