Tosho
Tosho

Reputation: 51

POST instead of GET parameter

Is there a way of producing POST instead of GET parameter by clicking on this link:

<?
   $dir="images/custom/";// putia do dir-a
   $handle = opendir($dir);
   if ($handle) {
   while (($file=readdir($handle))!==false) {
   echo '<center><a href="?cust='.$file.'"><img src="images/custom/'.$file.'  "title="Click to set it" "></a></center><br />'; } } 
?>

Upvotes: 1

Views: 111

Answers (2)

Tosho
Tosho

Reputation: 51

That did it:

 echo'<form action="" method="post">
<a href="javascript:;" onclick="parentNode.submit();"><center><img src=images/custom/'.$file.' title="Click to set it" /></center></a>
<input type="hidden" name="mess" value='.$file.' />
</form>';

thank you for your answers, Regards.

Upvotes: 0

iambriansreed
iambriansreed

Reputation: 22241

Convert the <a> to a form submit:

<?php

   $dir="images/custom/";// putia do dir-a
   $handle = opendir($dir);
   if ($handle) {
   while (($file=readdir($handle))!==false) {
       echo '<center><form method="post" action="?cust='.$file.'"><input id="test1" name="test1" type="image" src="images/custom/'.$file.'" title="Click to set it" /></form></center><br />';
   }
   }
?>

Upvotes: 1

Related Questions