Hello,
I have been seeking for a method to allow students to post contributions in the form that I easily can import as a Tiddler. Now finally I built a very basic mechanism to post a Tiddler to a directory called post as a tid.

It consists of two parts

1. The Upload-button (which is trancluded by a viewTemplate
\define ExportTid() {{$(storyTiddler)$||$:/core/templates/tid-tiddler}}

<$wikify name="ExTid"  text=<<ExportTid>> >
<form action="post.php" method="post">
<span>title:<input type="text" name="title" value=<<storyTiddler>>></span><br>
<span>tiddler:<input type="text" name="content" value=<<ExTid>> ></span><br>
<input type="submit" value="Hochladen">
</form>
</$wikify>


2. The post.php
<?php
$title = $_POST['title'];
$content = $_POST['content'];
$postfile = fopen('post/'.$title.'.tid', "w") or die("Unable to open file!");
fwrite($postfile, $content);
fclose($postfile);
?>

So far it generates a Tid which looks like exactly like the an exported .Tid-file but appear to empty when importing it to TW.
And it closes the wiki.

So there is still a quite bunch of Questions to be solved:

1. What is wrong with my .tid file?
2. How do I avoid the TW form being closed when calling the php?
3. Is there a way to trigger a TW-action with the same click that submits the form? 4. (a php-question)How can I avoid beeing pwned by someone inducing a php through this mechanism.
I hope you can help me solving these things...

Jan


--
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/5AD66DB7.7000400%40googlemail.com.
For more options, visit https://groups.google.com/d/optout.
created: 20180416113827406modified: 20180417215131182tags: Posttitle: 
TestpostingWhy won' t this be imported correctly?

Reply via email to