View Single Post

  #2 (permalink)  
Old 01-20-2004
Tyrone Slothrop
 
Posts: n/a
Default Re: Basic PHP question

On Tue, 20 Jan 2004 09:34:52 -0600, "Darryl" <darryl@osborne-ind.com>
wrote:

>Greetings,
>I have a page called test.php. I want to call the same page but pass a
>variable to
>it so that data on the page (retrieved from mysql database ) changes.
>
>So, can I have inside test.php a call to test.php with a variable ?


Of course! It would go something like this:

<html>
<head>title</head>
<body>
<?php if ($somevar) {
# make data call here returning some data
?>
This is page with somevar.
<?php } else { ?>
This is without somevar.
<php } ?>
</body>
</head>

$somevar could be sent by post (form) or get (query string).
Reply With Quote