i know how to get php to recover and variables stored in a page url but how can i make an if statement that check to see fi there arent any e.g.:

if($urlvariable EXISTS)
{
echo "this is the content page loaded";
}
else *IF urlvariable  DOes NOT EXIST*
{
echo $welcomemessage;
}

that what im tryng to acheive obviously i know it cant literaly be done like that but i hope that makes it clearer what im trying to do?

    if( isset($_POST) )
    {
        echo 'POSTed information exists!';
    }
    elseif( isset($_GET) )
    {
        echo 'GET information exists!';
    }
    else
    {
        echo 'No sent information, Welcome!';
    }

      solved with a little bit of help from BPAT this is the code i used and it worked:

      <?php
      include "config.php3";
      include "dbconnect.php3";
      $id = $_REQUEST['pageid']; 
      
      if( isset($id) ) 
      { 
      $a = "SELECT * FROM $table1 WHERE id = $id";
      $rows = mysql_query($a);
      
      while ($b = mysql_fetch_array($rows)){
      
      $cont = $b['content'];
      }
      
      $test = mysql_num_rows($rows);
      
      
      if($test == 1)
      {
      echo $cont;
      }
      else
      {
      echo "Sorry but it appears this content no longer exists Sorry,<br>
      
      Please content admin at homer09001@gmail.com stating which link you clicked on
      <br>
      thank you :D";
      }
      }
      else
      {
      echo "wlecome content here";
      }
      ?>
      

      $GET and $POST didnt work so i tried $REQUEST and that didnt work so i simply tried $id which is the results of teh $REQUEST

      thanks for your help guys 😃

        6 months later

        I got this to work with-

        <?php
        
        if ( isset( $_GET['var'] ) )
        {
          exit ("GET data set!");
        }
          elseif ( isset( $_POST['var'] ) )
        {
          exit ("POST data set!");
        }
          else
        {
          exit ("No data set!");
        }
        
        ?>
          Write a Reply...