Jump to content

Recommended Posts

Hi,

  I'm getting weird result for below code & someone told me to post the question in Web server admini part...

a.php

====

<form name="aa" method="post">

  <input type="text" name="xx" value="77">

  <input type="image" name="delete" value="Delete" src="images/1.gif" alt="Delete">

</form>

<?php

    print_r($_POST);

?>

 

When I clicked the delete button, this is what I get:

 

Array ( [xx] => 77 [deleteasn_x] => 49 [deleteasn_y] => 10 )

 

instead of

 

Array ( [xx] => 77 [delete_x] => [delete_y] => [delete] => Delete )

 

Version info on Windows XP:

C:\>c:\php-5.2.3\php.exe -v

PHP 5.2.3 (cli) (built: May 31 2007 09:37:22)

Copyright © 1997-2007 The PHP Group

Zend Engine v2.2.0, Copyright © 1998-2007 Zend Technologies

 

Apache Version: Apache2.2.4

 

Any idea, why delete is missing from POST?

 

Thanks!!!

  • 6 months later...

Well i do not see any action="" in the <form>

 

<form method="post" name="aa" action="<? echo $_SERVER['PHP_SELF']; ?>">

</form>

 

The only value that should show up is $_POST['xx'] == "77" and $_POST['delete'] == "Delete"

 

I do not see where you are getting any other results

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.