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 Quote Link to comment 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)). Quote Link to comment 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] Quote Link to comment 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] Quote Link to comment Share on other sites More sharing options...
keithschm Posted March 29, 2006 Author Share Posted March 29, 2006 thank you Quote Link to comment Share on other sites More sharing options...
ober Posted March 29, 2006 Share Posted March 29, 2006 Anytime. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.