I wrote this simple form, but I don't know theory about filling form. In future I want filling my form from MySQL, but now I need somehow test my form:
<table>
<tr>
<td><p style="text-align: right">name:</p></td>
<th><p style="text-align: left">',$name,'</p></th>
</tr>
<tr>
<td><p style="text-align: right">age:</p></td>
<th><p style="text-align: left">',$age,'</p></th>
</tr>
<tr>
<td><p style="text-align: right">place:</p></td>
<th><p style="text-align: left">',$place,'</p></th>
</tr>
</table>
So, I need replace $name, $age, $place
in url like: http://test.mydomain.com/testform.php?name="Name Example"
... How can I write/get url in correct form for result name: Name Example, not name: ',$name,'
?
If I understand you right, you want to make something like this: http://www.w3schools.com/php/php_form_complete.asp
You can check out the w3schools page about php form handling here: http://www.w3schools.com/php/php_forms.asp
Everything is explained over here. (If I understand you right). Is this what you are looking for?
If I understood correctly, you want to send a form with GET
method.
You must use the method="GET"
in your HTML <form>
tag.
Example of your form.php:
<FORM METHOD="GET" ACTION="testform.php">
<!-- your form goes here -->
</FORM>
Now, if you want to get the variables in your testform.php page, you need to use $_GET
in PHP.
Example of your testform.php:
<?php
// get FORM variables
$name = $_GET['name'];
$age = $_GET['age'];
// print variables
echo $name;
echo '<br>';
echo $age;
?>
To print the variable in a table like your example, you can retrieve first the variables, and then put into the table:
Another example:
<?php
// get FORM variables
$name = $_GET['name'];
// ...
?>
<table>
<tr>
<td><p style="text-align: right">name:</p></td>
<th><p style="text-align: left"><?php echo $name ?></p></th>
</tr>
</table>