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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:58:35+00:00 2026-05-31T20:58:35+00:00

I used the following php code to get the file extension of an uploaded

  • 0

I used the following php code to get the file extension of an uploaded file:

$ext = substr($filename, strpos($filename,'.'), strlen($filename)-1); // Get the extension from the filename.

But now I want to post this variable to an other php file which saves all the data in a database.

if (isset($_POST["submit"])) {
  $insertSQL = sprintf("INSERT INTO sounds (id, title, artist, category, subcategory, keywords, upload, format, size, download, rating, ip, date) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                       GetSQLValueString($_POST['id'], "text"),
                       GetSQLValueString($_POST['title'], "text"),
                       GetSQLValueString($_POST['artist'], "text"),
                       GetSQLValueString($_POST['categoryID'], "text"),
                       GetSQLValueString($_POST['subcategoryID'], "text"),
                       GetSQLValueString($_POST['keywords'], "text"),
                       GetSQLValueString($_FILES['upload']['name'], "text"),
                       GetSQLValueString($_FILES['upload']['name'], "text"),
                       GetSQLValueString($_FILES['upload']['size'], "text"),
                       GetSQLValueString($_POST['download'], "text"),
                       GetSQLValueString($_POST['rating'], "text"),
                       GetSQLValueString($_POST['ip'], "text"),
                       GetSQLValueString($_POST['date'], "text"));

I know it is probably a stupid question. But how can I post and get this variable?

  • 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-31T20:58:36+00:00Added an answer on May 31, 2026 at 8:58 pm
    $filename = $_FILES['upload']['name'];
    $ext = substr($filename, strpos($filename,'.'), strlen($filename)-1);
    

    //to insert value into DataBase

    GetSQLValueString($ext, "text")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used following code, but it displays only 2 digit of ISO country name.
I have used following code to create a simple PDF file. It executes fine
If I run the following PHP code: apc_compile_file(relative/path/to/file); will it invalidate the in-memory cache
I have writen the following code but when i execute him i get this
I used the following PHP code in shared hosting and it worked just fine:
I'm following a php video tutorial (it's not online sorry) from Lynda.com and used
I've created my own theme. In the template.php file, I have the following code:
I used google API to get address from given GPS coordinates. But this address
I have used the following code to get the document root. $path = get_file_dir();
i have used following code to repeat a process creation/close iteratively dim vProcessInfo as

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.