<form name="form" action="[[~[[*id]]]]" method="get">
$output = ''; $output .= "\n" . '<form name="form" action="[[~[[*id]]]]" method="get">'; $output .= "\n " . 'Name: <input type="text" name="name" value="John Doe"><br>'; $output .= "\n " . 'E-mail: <input type="text" name="email" value="[email protected]"><br>'; $output .= "\n " . '<input type="submit">'; $output .= "\n" . '</form>'; $output .= "\n" . $_GET["name"]; $output .= "\n" . . '<br />'; $output .= "\n" . $_GET["email"]; return $output;
I'm pretty sure Bruno17's code is in a snippet in MODX just like yours.
$docId = $modx->resource->get('id'));
return $modx->makeUrl($docId);current Resource-id: [[*id]]<br /> generated by makeUrl: [[!makeUrl]]<br /> generated by tag: [[~[[*id]]]]<br />
I see this:
What do you see if you do a "View Source" on the form page?
<html> <head> <title>MODX Revolution - test</title> <base href="http://bertverberne.com/" /> </head> <body> <form name="form" action="http://bertverberne.com/index.php?id=2" method="get"> Name: <input type="text" name="name" value="John Doe"><br> E-mail: <input type="text" name="email" value="[email protected]"><br> <input type="submit"></form><br /> </body> </html>
Quote from: BobRay at Nov 28, 2013, 09:52 PMI'm pretty sure Bruno17's code is in a snippet in MODX just like yours.
I have copy/pasted exactly strooman's code into a snippet.
For some Testing try this:
snippet 'makeUrl':
$docId = $modx->resource->get('id'));
return $modx->makeUrl($docId);current Resource-id: [[*id]]
generated by makeUrl: [[!makeUrl]]
generated by tag: [[~[[*id]]]]
<?php
if(isset($_POST['submit']))
{
$name = $_POST['name'];
$email = $_POST['email'];
echo 'You entered this name : <b>' . $name . '</b><br />';
echo 'You entered this email : <b>' . $email . '</b>';
}
echo '<form method="post" action="index.php?id=4">';
echo 'Name: <input type="text" name="name" value="John Doe"><br>';
echo 'E-mail: <input type="text" name="email" value="[email protected]"><br>';
echo '<input type="submit" name="submit" value="Submit Form"><br>';
echo '</form>';
?>
Then why returns your example a page with html extension? I thought Modx returns pages with php extension.