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

  • Home
  • SEARCH
  • 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 8140981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:20:41+00:00 2026-06-06T12:20:41+00:00

need a small basic help, I am creating a XML file on the fly

  • 0

need a small basic help, I am creating a XML file on the fly using the parameters submitted in the form by the user. Once the form is submitted, I am jumping into PHP code and there I wanted to give a href link to Download/Display the created XML file.

This is my example code:

<?php

$outputForm = 1;   

if(isset($_POST['submit'])){
$outputForm = 0

//Function to generate XML file which works as expected, so that XML file is there
createXML($folderPath, $albumName, $dateOfEntry);

//My XML file is named as albumName.xml and stored in the folderPath as specified
echo '<a href = "' .  $folderPath . $albumName. '.xml' . '">XML FILE</a>';
}
 else{
            $outputForm = 1;
        }
        if($outputForm == 1)
        {     
       //Here follows my input form
     <?php
       }
     ?>

FYI: 
$folderPath = 'c:/htdocs/output/';
Therefore:
$folderPath . $albumName = 'c:/htdocs/output/jessi';
In this example xml file name:
jessi.xml

I can see the href link in the output but it does nothing when I click on it. I can also see the fullpath to the xml file when I move my cursor over the ‘XML FILE’ link.

Any ideas how I can embed a href link in the php script to either Download/Display the XML file.

Thanks

  • 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-06T12:20:42+00:00Added an answer on June 6, 2026 at 12:20 pm

    Issue is, you are running your code by accessing to it using http protocol (whether on your local server or remote) and the file you are trying to access is local and you are accessing your local xml file using File URI Scheme So, browser is restricting you to access that file, maybe for some security reason.
    If you try to access a file by opening a html file directly in browser (not by running it from your localhost) you will be able to access that file location using that link, browser won’t restrict you. But you won’t be able to execute the php code.

    So, You can use relative path or reference to file from your
    localhost’s relative path, use http URI scheme for this and browser won’t restrict you from opening a local file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need small help. I have 2 lists( say A and B) which have
I am using SDL Tridion 2011 SP1. I need small clarification regarding multimedia schema
I need to read small sequences of data from a 3.7 GB file. The
I need to write a small application to read a configuration file and generate
I need to edit XML files on a small Linux box that we have
I need to allow multiple downloading of small documents in Rails, preferably using Paperclip
I need to build a OS, a very small and basic one, with actually
I am using LibGDX for a small app project, and I need to somehow
I often need relatively small (<10000 entries <1kb) caches for speeding up calculations. My
I need to develop small AIR extension for iOS. here's the question: is it

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.