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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:36:28+00:00 2026-05-14T03:36:28+00:00

I am trying to get some form data from POST method. Here’s the code

  • 0

I am trying to get some form data from POST method.

Here’s the code of form –

<form action="" method="post" name="form1" id="form1">

<input type="hidden" value="15" name="ad_id"> 

  <table width="100%" cellspacing="0" cellpadding="0" border="0" class="block">

    <tbody><tr>

      <td valign="top">&nbsp;</td>

      <td align="right">all fields are required</td>

    </tr>

    <tr>

      <td valign="top">&nbsp;</td>

      <td align="center"></td>

    </tr>

    <tr>

      <td valign="top" width="150"><label for="name">Advertisement Name</label>

      *</td>

      <td><input type="text" size="45" value="Banner" id="name" name="name">

        e.g Home Banner</td>

    </tr>

    <tr>

      <td valign="top"><label for="placement">Advertisement Placement</label></td>

      <td><select id="placement" name="placement">      

Wide Skyscrapper 160 x 600

    </tr>

    <tr>

      <td valign="top"><label for="code">Advertisement Code</label></td>

      <td><textarea rows="5" cols="45" id="code" name="code"></textarea></td>

    </tr>

    <tr>

      <td>Status</td>

      <td><label>

        <input type="radio" checked="checked" value="1" name="status">

        Active</label>

        <label>

          <input type="radio" value="0" name="status">

        Inactive</label></td>

    </tr>        
    <input type="hidden" value="1" name="banner_uploaded" id="banner_uploaded">
    <tr>
     <td>For Country - </td>
     <td>
      <select id="country" name="country">         
 <option>Not posting all the names of country</option>
        </select>
     </td>
    </tr>
    <tr>
                              <td><label for="Scheduling">Valid From </label></td>
     <td><input type="text" value="" id="date-from" name="date-from"> Format : dd/mm/yyyy:hh/mm</td>
    </tr>
    <tr>
                              <td><label for="Scheduling">Valid Till </label></td>
     <td><input type="text" value="" id="date-to" name="date-to"> Format : dd/mm/yyyy:hh/mm</td>
    </tr>

    <tr>

      <td>&nbsp;</td>

      <td align="right"><input type="submit" onclick="return validate_ad_form(add_adv)" value="Update Advertisement" class="button" name="update"></td>

    </tr>

  </tbody></table>

</form>

But I am getting $_POST[‘code’] empty when I am passing HTML code through it.

When I pass plain text, it works fine.

When I printed $_POST [i.e. used – print_r($_POST) ], I got the following output –

Array ( [ad_id] => 15 [name] => Banner [placement] => ad_468x60 [code] => [status] => 1 [banner_uploaded] => 1 [country] => IN [date-from] => [date-to] => [update] => Update Advertisement )

Please be known, I haven’t entered the ‘date-from’,’date-to’ fields.

I have entered on purpose as StackOverflow don’t allow me to post images!

People,any help will be highly appreciated.

  • 1 1 Answer
  • 2 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-14T03:36:28+00:00Added an answer on May 14, 2026 at 3:36 am

    The problem is you’re print_r() is being displayed in a brower. If you’ve got HTML in your POST data, those tags will be interested as HTML when you dump the data back out. You’ll have to force the output into plaintext mode (header('Content-type: text/plain);), or run the fields which can have HTML in them through htmlspecialchars() to escape the < and > characters.

    If you view the source of the page you’re doing the print_r() on, I suspect you’ll see the HTML tags there. If you’ve only tested with that example.jpg image, you wouldn’t see anything, because that image most likely doesn’t exist, so it won’t render, and then the <a> tag has nothing to underline and won’t show up either.

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

Sidebar

Ask A Question

Stats

  • Questions 513k
  • Answers 513k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Are you running on a 64-bit version of Windows? Look… May 16, 2026 at 5:50 pm
  • Editorial Team
    Editorial Team added an answer Don't know of anything pre-built, but you can write one… May 16, 2026 at 5:50 pm
  • Editorial Team
    Editorial Team added an answer I think this MDC tutorial is what you're looking for:… May 16, 2026 at 5:50 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I am trying to post back some data using a viewmodel i have created
Im trying to submit a specific form programatically, but I allways get the initial
I'm trying to send email with some images attached in django. Code used is
I am trying to get this form to: if any $_POST vars equals any
I am trying to write some kind of raw html to mimic what spring
Trying to get a section on my site working when it basically acts in
I'm trying build my application using REST and Spring MVC. For some entities I
I'm currently trying to get a small brick-breaker game I made to effectively use
im trying to get familiar with the new JBoss 6 and having a really
I'm trying to load up XML/SWF Charts with Yii and having some troubles. 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.