Writing code requests
-
Your plugin is great, thank you for sharing.
If I go to playground and enter in prompt: write php code for simple text file based cms
I end up with jumbled up code like:
$title = "My CMS";$content = "Welcome to my content management system.";echo "<h1>".$title."</h1>";echo $content;$title = "My CMS";$body = "This is my content";$fp = fopen("content.txt", "w");fwrite($fp, $title."\n".$body);fclose($fp);echo "Done";$file = "content.txt";$content = file_get_contents($file);echo $content;$file = "content.txt";$content = file_get_contents($file);if (isset($_POST['content'])) { $content = $_POST['content']; file_put_contents($file, $content);}?><form action="" method="post"> <textarea name="content" rows="10" cols="100"><?php echo $content; ?></textarea><br> <input type="submit" value="Save"></form><?php$text_file = 'text.txt';$text = file_get_contents($text_file);echo $text;<?php$file = 'file.txt';$content = file_get_contents($file);$lines = explode("\n", $content);$data = array();foreach($lines as $line) { $line = trim($line); if(!empty($line)) { list($key, $value) = explode("=", $line); $data[$key] = $value; }}?>$title = " Simple Text File CMS";$content = "This is a simple text file CMS.";$footer = "Thank you for using Simple Text File CMS!";?>$title = "My Simple CMS";$content = "Welcome to my simple CMS!";if (isset($_GET['page'])) { $page = $_GET['page'];} else { $page = 'home';}if ($page == 'home') { echo $title; echo $content;} elseif ($page == 'about') { echo "About My Simple CMS";} else { echo "404 - Page Not Found";}
Is your plugin not designed to write code?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Writing code requests’ is closed to new replies.