Hi,
i want to create a html form to submit data with PHP in MODx (by using a snippet),
i created some codes like below:
<?php
print '
<form action="[~[*id*]~]" method="POST">
link:<input type="text" name="link" />
comment"<textarea name="comment"></textarea>
<input type="submit" name="submit" value="GO" />
</form>
';
$link=$_POST['link'];
$comment=$_POST['comment'];
mysql_query("INSERT INTO modx_sand (`link`, `comment`) VALUES ('$link','$comment')") or die("Couldn't insert to sandTable:".mysql_error());
?>
but i see different behaviors,
sometimes it works well and create a row in database,
sometimes it creates a row with
empty columns in database,
and sometimes (now) it goes to link of snippet (
http://site-url/manager/index.php?id=18);
please help me to create this snippet.
thanks
AHHP