I have a form that get processed by a php page and depending on what the user decides it will get summited to another php form. But the

<input type="text" name="fname" value="<?php 'echo $tesing';?>"

part does not work inside php.

if i try the code outside it works, but i need it inside the php

if (isset($_GET['check1'])) 
{
	$check1 = $_GET['check1'];

}
	
	if($check1 !== 'unchecked')
	{ 
		$id = "$last_Id";
		
		echo '<form method ="get" action = "tele.php">
	          Phone:
	   		  <input type = "text" name ="number" value= "">
                        <input type="text" name="fname" value="<?php                  'echo $tesing';?>">
	   		<br>';
	   	
	    
	   	echo '<input type = "submit">';
		
		
	}
	else
		print("not checked");

?>

You have to do:

echo '<form method ="get" action = "tele.php">
	          Phone:
	   		  <input type = "text" name ="number" value= "">
                        <input type="text" name="fname" value="' . $tesing . '">
	   		<br>';

when i print this line i get the correct value but when i see it on the text box it shows up as "<?php echo204;?>" which 204 is the value i want to display.

<?php 
if($check1 !== 'unchecked')
	{ 
		$id = "$last_Id";
		print "$id";
		echo '<form method ="get" action = "tele.php">
	          Phone:
	   		  <input type = "text" name ="number" value= "">
	   		  <input type = "text" name = "id" value = "<?php echo'.$id.';?>">
	   		  <br>
	   		  <input type = "submit">';
}
?>

nevermind i fixed it i didnt fully understand your explanation above. but now i do and it worked

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.