Jump to content

help with $_POST


keithschm

Recommended Posts

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
Share on other sites

You need a if/else:

[code]<?php
if(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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.