Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8328063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:19:30+00:00 2026-06-09T01:19:30+00:00

I created a few PHP files for users of a popular hardware site to

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T01:19:32+00:00Added an answer on June 9, 2026 at 1:19 am

    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:

    <?php
        // urlCreator.php will get variables passed to it from index.php
    
        // Now create the url using the passed variables
        $url = "http://briandempsey.org.uk/Newstool/form.php?title=" . $_GET['title'] . "&color=" . $_GET['color'] . "&Articlecontent=" . $_GET['Articlecontent'] //and so on to build the whole url
    
        //Now get the pages html
        $html = file_get_contents($url);
    ?>
    

    Now that you have the html in a variable you can clean it using str_replace or manipulate it however you’d like.

    <?php
        // Still in urlCreator.php
    
        // With the html in a variable you could now edit out the divs and echo the results
        $html = str_replace("<div style=\"background-color: #008299; height: auto; width: 100%; margin-left: 10px;\">", "", $html); //removes the intro div
        $html = str_replace("</div>", "", $html); //removes the closing div
    
        //Finally echo out the html to the page for copy+paste purposes
        echo $html;
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've inherited a site with hundreds of scattered HTML and non-framework PHP files, which
I am using Flex 4, Zend & PHP. I created a few php dataservices
hi i created a simple php/mysql/Ajax chat application and I have a few questions.
I'm having problems with the PHP site I run at work where users are
I created a few files in app/Lib folder and would like to access one
I have seen a few .NET apps use .db files. I am not new
I created few user defined types in my database as below CREATE TYPE [dbo].[StringID]
I've tested so many times and get strange behavior.Lwuit version 1.5. I've created few
I've created a few input fields, that I am cleaning up as the user
I've created a few actions and object types for my application. For this question's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.