I created a few PHP files for users of a popular hardware site to use to “Metro” their news posts. It works fairly well, you add the title of the article, links etc. and then it spits it out in Metro tile format.
Take a look: http://briandempsey.org.uk/Newstool/index.php
When the user submits, it uses the information provided to create the post. Now, I need to somehow use PHP or some other language to display the code that it generated underneath it so users can just copy and paste it. I’m not sure how to do this.
Since you’re passing your form data using the method GET, you could instead pass it to a page that creates a url to pull the html from…
index.php will have the form as you’ve shown above and will post to urlCreator.php.
form.php can be deleted as it is not needed anymore, the magic will happen in the urlCreator.php file.
urlCreator.php (NEW) will have code in it like so:
Now that you have the html in a variable you can clean it using str_replace or manipulate it however you’d like.