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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:28:31+00:00 2026-06-12T03:28:31+00:00

I am getting tired trying to see what is wrong. I have two php.

  • 0

I am getting tired trying to see what is wrong. I have two php. From the first I am sending a variable ‘select1’ (basically the id) to the second and than I want to update that record uploading a pdf file.

$id = "-1";
if (isset($_GET['select1'])) {
  $id = mysql_real_escape_string($_GET['select1']);
}



if(isset($_POST['Submit'])) {
    $my_upload->the_temp_file = $_FILES['upload']['tmp_name'];
    $my_upload->the_file = $_FILES['upload']['name'];
    $my_upload->http_error = $_FILES['upload']['error'];
    if ($my_upload->upload()) { // new name is an additional filename information, use this to rename the uploaded file
        mysql_query(sprintf("UPDATE sarcini1 SET file_name = '%s' WHERE id_sarcina = '%s'", $my_upload->file_copy, $id));
    }
}

If I put a line with a valid id, like:

$id = 14;

it is working. What I am doing wrong? Thank you!

  • 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-12T03:28:33+00:00Added an answer on June 12, 2026 at 3:28 am

    If you need to accept both post & get, then you should try something like the code below to retrieve the variable.

    $var = 'select1';
    if( isset( $_POST[$var] ) ) {
        $id = $_POST[$var];
    } else if( isset( $_GET[$var] ) ) {
        $id = $_GET[$var];
    } else {
        $id = -1;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make two Kinects getting along under the same application. I've tried
Problem: I'm getting a thrown error from javax.net.ssl.SSLHandshakeException (see attached picture) Is it possible
I'm just barely getting into NodeJS a bit and have hit a snag trying
I am getting tired of manually installing javax jar files in Maven and would
I'm getting a little tired of building web applications. Feels like same thing over
I've tried getting the launch link from the start menu and using Process.Start() But
I have tried just about everything for getting the Kinect for Windows to actually
I have been trying to get a basic reorderlist working following this guide ->
I have a web app with a form that I am trying to pass
I'm trying to get into the IMAP server with OAuth, using the PHP Sample

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.