0

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");

?>
2
Contributors
3
Replies
5
Views
7 Years
Discussion Span
Last Post by mrjoli021
0

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>';

Edited by Kruptein: n/a

0

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">';
}
?>
0

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.