Jump to content

Passing variables wtih in the reloading applicaion


learningPHP1

Recommended Posts

Hello everybody,

 

Having problems keeping variables within the same page when the content of the page is saved or when the page is reloads to add the next set of data.

The application is a data collecting page so I would need to keep certain variables the same as the same variables needs to appear in the next record.

Looking at the code below, 2 variables are received into the page but it won?t stay if I hit the add button basically reloading the page.

need the 2 variables returned back after clicking save.

 

<?php
echo "<br/>". $TaskId = $_POST['taskid1'];
echo "<br/>". $Site = $_POST['site'];
?>

<body>
<form name="projectwalkthrough" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST" >

	Task ID: <select name="taskid1" > 
	<option value="selectid"> <?PHP if($TaskId) {echo $TaskId;} else {echo "Select Task ID";} ?></option>
		<?PHP        
			while($row1=mysqli_fetch_array($ProjectIDResults))
				{  echo '<option value=" ' . $row1['ci_taskid'] . ' ">' . $row1['ci_taskid'] . '</option>';  }		
		?>
	</select>  

	Site: <select name="site" > 
		<option value="projectsite" > <?PHP if($Site) {echo $Site;} else {echo "select site";} ?></option>
		<?PHP
			while($row=mysqli_fetch_array($ProjectSiteResults))
			{  echo '<option value=" ' . $row['ps_site_short']  . ' ">' . $row['ps_site_short'] . '</option>';  }
		?>
	</select>
    <input type="submit" name="savewalkthrough" id="button" value="Save current scope" />

</body>
</form>
</html>

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.