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 6200087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:18:15+00:00 2026-05-24T04:18:15+00:00

Ok, so I have made a form on a .html page and a .php

  • 0

Ok, so I have made a form on a .html page and a .php page to upload an image and then save som data from the form along with the filepath for the image. The problem is when I move it from the root folder to root/backweb it wont work. I have created a new uploads folder in the backweb folder and also copied the conn.inc.php file over to the backweb folder for simplicity.

When I run it from the root foler it says “Releasen sparades!” (Release saved) but when I run it from the backweb server it says “Ogiltig filtyp!…” (Invalid filetype). Any ideas?

Here’s the code:

<?
require_once 'conn.inc.php';

if (($_FILES["cover"]["type"] == "image/gif")
|| ($_FILES["cover"]["type"] == "image/png")
|| ($_FILES["cover"]["type"] == "image/jpeg")
|| ($_FILES["cover"]["type"] == "image/pjpeg"))
  {
  if ($_FILES["cover"]["error"] > 0)
    {
    echo "Return Code: " . $_FILES["cover"]["error"] . "<br />";
    }
  else
    {

    if (file_exists("uploads/" . $_FILES["cover"]["name"]))
      {
      echo $_FILES["cover"]["name"] . " finns redan på servern. ";
      }
    else
      {
      move_uploaded_file($_FILES["cover"]["tmp_name"],
      "uploads/" . $_FILES["cover"]["name"]);
      $cover = "uploads/" . $_FILES["cover"]["name"];
      }
    }
  }
else
  {
  echo "Ogiltig filtyp! Endast bilder &auml;r till&aring;tna (.jpg, .png och .gif)</br>
  <a href=\"uploadform.html\">F&ouml;rs&ouml;k igen</a>";
  }


$band = $_REQUEST["band"];
$title = $_REQUEST["title"];
$catnum = $_REQUEST["catnum"];
$format = $_REQUEST["format"];

$query = "INSERT INTO releases (band,title,catnum,format,cover) VALUES ('$band','$title','$catnum','$format','$cover')";

$result = mysql_query($query);
    if ($result == NULL)
    {
        echo "N&aring;got gick fel, releasen sparades ej!";
        ?>
        <br/>
        <br/>
        <a href="editreleases.php">Försök igen!</a>
        <?
    }
    else
    {
        echo "Releasen sparades!";
    }
?>
  • 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-05-24T04:18:16+00:00Added an answer on May 24, 2026 at 4:18 am

    sound like folder permissions are not set for PHP to access files in the non-root folder

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

Sidebar

Related Questions

I have made a form with the php code right under the html form
I have made a class which a form can inherit from and it handles
I made a script to post comments on a page. I have used PHP
I'm using php,html,javascript,mysql. My functionality goes like this. I have a division made in
I have a php file as given below. The page generates html content which
I'm working on a web page where I have some data visualized in html
Ok, i have made a contact form. i need a php script to email
I have a php page that has a few HTML questions on it, each
I have started using jQuery and rails. I have made a simple form that
I have a form made up of multiple, optional subparts - each of which

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.