Hello friends, I am new to PHP. I would like to know how I can create a PHP page by sending a parameter to another PHP script somewhere in the server, and have a page generated on the fly. Thanks
@patimagesApr 02.2007 — #you can send your parameter using get or post to the 2nd php file, have the parameter read and save a new file on your server using fwrite.
or let´s say you have your content stored in a database. in the db table you have a field called id, a field called news_headline and a field called news.
your url looks like this: yoursite.com/index.php?id=2
then you use php to select the database entry with id 2 in the db and display it.
$id = $_GET['id'];
$query = "SELECT news_headline, news FROM yourtable WHERE id = '$id'";
$result = mysql_query($query);
<h1><?php echo $row['news_headline'];?></h1>
<p><?php echo $row['news'];?></p>
so you only need one php file (index.php) to display any news you have in your db. index.php?id=34, index.php?id=158, index.php?id=4, whatever you like.