Jump to content

php hidden form ???


plodos

Recommended Posts

<?php
$title = $_REQUEST['title'];
$date = $_REQUEST['date'];
$notices = $_REQUEST['notices'];


echo " <br >outout is <br><br> 
$title      $date <br><br>
$notices<br>
";
echo "<td><a href=\"addnotices.php?title=$title&date=$date&notices=$notices\"> edit! </a> <br>";

<form action="sendnotices.php" method="post">
<INPUT TYPE=hidden NAME="title" VALUE='.$_GET['title'].'>
<INPUT TYPE=hidden NAME="date" VALUE= '. $_GET['date'].' >
<INPUT TYPE=hidden NAME="notices" VALUE='.$_GET['notices'].' >
<input name="Submit" type="submit" value="SEND to list and SAVE to the Dbase"/>
</form>
?>

at first, i used $title = $_REQUEST['title']; this for show the output!!!

 

and if the outpus is tru user will click to button for SEND and SAVE to database...

 

anyway

 

i want to use one more time these variables $title,$date,$notice inside of the hidden form like

 

<INPUT TYPE=hidden NAME="title" VALUE='.$_GET['title'].'> ......

 

but this from is not sending the values to another page..

 

could you check it please? maybe I didnt see the errors?

 

thnx for everything!...

Link to comment
https://forums.phpfreaks.com/topic/93892-php-hidden-form/
Share on other sites

try using...

 

<?php
$title = $_REQUEST['title'];
$date = $_REQUEST['date'];
$notices = $_REQUEST['notices'];


echo " <br >outout is <br><br> 
$title      $date <br><br>
$notices<br>
";
echo "<td><a href=\"addnotices.php?title=$title&date=$date&notices=$notices\"> edit! </a> <br>";
?>

<form action="sendnotices.php" method="post">
<INPUT TYPE=hidden NAME="title" VALUE='<?= $title ?>'>
<INPUT TYPE=hidden NAME="date" VALUE= '<?= $date ?>' >
<INPUT TYPE=hidden NAME="notices" VALUE='<?= $notices ?>' >
<input name="Submit" type="submit" value="SEND to list and SAVE to the Dbase"/>
</form>

Link to comment
https://forums.phpfreaks.com/topic/93892-php-hidden-form/#findComment-481104
Share on other sites

<INPUT TYPE=hidden NAME="title" VALUE='<?= $title ?>'>

 

Stuff like that is poor html and may result in failures. It will definitely fail when short_tags are not enabled. The example below is a much better approach:

 

<input type="hidden" name="title" value="<?php echo $title;?>">

 

Link to comment
https://forums.phpfreaks.com/topic/93892-php-hidden-form/#findComment-481131
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.