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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:50:42+00:00 2026-06-14T22:50:42+00:00

On page test.php i send form with method post. Сode page test.php var_dump($_POST); error_reporting(E_ALL

  • 0

On page test.php i send form with method post.

Сode page test.php

var_dump($_POST);
error_reporting(E_ALL | E_STRICT);
require('UploadHandler.php');
$upload_handler = new UploadHandler();

When i use var_dump($_POST), i can see

array(1) {
  ["prod"]=>
  string(7) "4477535"
}

Part сode page UploadHandler.php

class UploadHandler
{
......
function add_img($img)
    {
    $prod=mysql_real_escape_string($_POST('prod'));
    $add_to_db = $this->query("INSERT INTO prods (`prod`, `image`, `main`) VALUES ('$prod','".$img."','')") or die(mysql_error());
    return $add_to_db;
    }
...
}

When i use this code i have 500 Internal Server Error

With firebug i see POST

-----------------------------20037128598723 
Content-Disposition: form-data; name="prod"

4477535

-----------------------------20037128598723
Content-Disposition: form-data; name="files[]";
filename="Penguins.jpg" Content-Type: image/jpeg
...
...
...
-----------------------------20037128598723--

Tell me please how add $_POST(‘prod’) to class?

  • 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-14T22:50:43+00:00Added an answer on June 14, 2026 at 10:50 pm

    You have syntax error in the php

     $prod=mysql_real_escape_string($_POST('prod'));
    

    use this instead

      $prod=mysql_real_escape_string($_POST['prod']);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a form with radio buttons. <form id=land name=input method=POST action=test.php> <input type=radio
I have this form into PHP pages: echo "<form action=\"xxx.php\" method=\"post\" id=\"test\" name=\"test\"> <input
I have a page, test.php, with the following code: <html> <body> <form> <script type=text/javascript>
I have a very simple test page for PHP session. <?php session_start(); if (isset($_SESSIONS['views']))
http://steph.net23.net/work.php here is my test link. This page has a jquery script in it
Usually when I get POST data it's send from a HTML form and the
I have a page that post data to another page once a form has
I have written a simple code in page test_cookie.php to work with cookies. if(isset($_GET['data']))
<?php /** hook_menu **/ function example_contact_form_menu() { return array( 'contact_form_test' => array( 'page callback'
My test page is processed if believe to trace in 46 ms, while 11

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.