How pass value from form to php


In this tutorial learn how to pass value from html form to php file and print 
the value,How to contact string using pass value from form to php  
pass value from html to php using post method
EXAMPLE: Create index.php


<html>
<head>
</head>
<body>

<!--Here already form and lets create a php to get value and contact string  -->
<form action="data.php" method="post">

<input type="text" name="name" value="first name">

<input type="text" name="lastname" value="last name">

<input type="submit" name="submit" value="submit">

</form>

</body>

</html>


data.php



<?php 

//here we will contact string to get a value 

// keep name as input type 

$name=$_POST['name'];
$lastname=$_POST['lastname'];

echo $name ." ". $lastname;

//contact string using . add space

//give the space

No comments:

Post a Comment

how to call ssh from vs code

 To call SSH from VS Code, you can use the built-in Remote Development extension. This extension allows you to open a remote folder or works...