I know I'm probably doing this in a retarded way, but I'm having trouble with my post script(s).
First here is the form I get the submitted info to be posted from:
<html>
<head>
<title>Post New</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.cusForm { font-family: Arial, Helvetica, sans-serif; font-size: 11px; color: #FFFFFF; background-color: #999999; border: thin #000000 ridge}
.formStyle { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;
color: #FFFFFF; background-color: #333333; width: 50%; padding-right: 10px; padding-left: 10px; border: #006699;
border-style: ridge; border-top-width: thin; border-right-width: thin; border-bottom-width: thin; border-left-width: thin}
.regText { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; color: #FFFFFF}
-->
</style>
</head>
<body bgcolor="#000000" text="#FFFFFF">
<p class="regText">To make a new post fill out the form and hit submit. Fill all
fields.</p>
<form name="postNew" method="post" action="http://localhost:8080/tests/News01.php" class="formStyle">
<p> </p>
<p>Author </p>
<p>
<input type="text" name="author" class="cusForm" value="Your name.">
</p>
<p> Date </p>
<p>
<input type="text" name="date" class="cusForm" value="?/?/?">
</p>
<p> Message </p>
<p>
<textarea name="msgBox" class="cusForm" cols="50" rows="10">Your message here.</textarea>
</p>
<p>
<input type="submit" name="postnew" value="Post New Message">
<input type="reset" name="clear" value="Clear Form">
</p>
<p> </p></form>
<p> </p>
</body>
</html>
Then it goes here to News01.php to be read into variables:
<?php
$_POST['author'];
$_POST['date'];
$_POST['msgBox'];
$authorN01 = $_POST['author'];
$dateN01 = $_POST['date'];
$newmessageN01 = $_POST['msgBox'];
$News01A = $authorN01;
$News01D = $dateN01;
$News01M = $newmessageN01;
echo $authorN01;
echo "<p>";
echo $dateN01;
echo "<p>";
echo $newmessageN01;
//***********************************************************************
//******************************FUNCTIONS********************************
//***********************************************************************
function Get_Author ($News01A, $authorN01) //Returns the author.
{
$News01A = $authorN01;
return $News01A;
}
//***********************************************************************
function Get_Date ($News01D, $dateN01) //Returns the date.
{
$News01D = $dateN01;
return $News01D;
}
//***********************************************************************
function Get_Message ($News01M, $newmessageN01) //Returns the message.
{
$News01D = $newmessageN01;
return $News01M;
}
//***********************************************************************
?>
That also includes my functions that will be called in the next file:
<div id="NewsBox01" style="position:absolute; left:147px; top:176px; width:467px; height:175px; z-index:8; visibility: visible" class="newsTab">
<p>
<?php
Get_Author ($News01A, $authorN01);
Get_Date ($News01D, $dateN01);
Get_Message ($News01M, $newmessageN01);
echo $News01A;
echo " : ";
echo $News01D;
echo "<br><br>";
echo $News01M;
?>
</p>
</div>
That's a section from my index.php that calls the function and grab those variables posted in the original form file.
My problem reisides in the transfer on the variables to index.php.
When I echo the variables in News01.php they print out with the value I gave them in the form post. Then when I go back to index.php they don't print when called by the function. Anyone know why?