[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] <form action="<?php echo $PHP_SELF?>" method="POST">



Jørgen Heesche wrote:
Selvom jeg erstatter
<form action="<?php echo $PHP_SELF?>" method="POST">
med
<form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="POST">
bliver scriptet ikke kaldt igen ved 'submit',
måske er $submit ikke true efter submit?
Nej, $submit er ikke true (eler noget andet, for den sags skyld) efter klik på submit. Det du kan gøre er noget i retning af:
<?php echo $_SERVER['PHP_SELF'] ?> indsat lige før >form action ... > viser at PHP_SELF er /~jph/test/test-self.php

<?php
$submit = $_POST['submit']; //Fetch 'submit' from form
if ($submit)
{
  // process form
.
.
.
}
else
{
 // display form
?>
.
.
.
<?php echo $_SERVER['PHP_SELF'] ?>
<form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="POST">
.
.
.
<input type="submit" name = "submit" VALUE = "SUBMIT"/>
</form>
<?php
} // end if
?>

Så vidt jeg kan læse, ud fra det du skriver, vil det kræve at REGISTER GLOBALS er slået til i PHP før du kan gøre som du ønsker. REGISTER GLOBALS gør det, at den søger efter variabler med post, get og cookie-metoderne. Finder den disse variabler, tildeler den værdierne af dem, til deres navn.
--
anders


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-11-01, 02:01 CET [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *