Jump to content

Snip

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Everything posted by Snip

  1. Stringconcatenation is done by using '.' <? $next_page="pages/page".$id.".php"; include "$next_page"; ?>
  2. I don't want to see an other page, I want it to be the same page, with the updated data. I had seen the "header"-solution on many webpages, but the warning I always get with that solution is [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Warning: Cannot modify header information - headers already sent by ...[/quote] So my guess is that there should be kind of a solution where you have your form-page, witch after validation, forwards to a "control-page of some sort" witch inserts the data and redirects to the page where you inserted the data, but with the new data and the same form showing.
  3. Here is what I've come up with. [code] //$user = $_POST['user']              $url = $_SERVER["PHP_SELF"];                                  echo "<form method=\"get\" name=\"userselection\" action=\"$url\">";                 echo '<select size="1" name="user" onchange="forms[\'userselection\'].submit()"> ';                 while($i<$num){                       /* Output combo box */                       $value=mysql_result($result,$i);                     echo("<option value=");                     echo( $value );                          if(strtolower($user)==strtolower($value)){                            echo " selected=true";                     }                     echo(">");                     echo( $value );                     echo("</option>");                     $i++;                 }                 echo("</select>");                 echo '</form>';[/code] When you select a different item in the combobox, the page gets reloaded and you get the new value from the $_POST on witch you can readjust the data on your page (and reput the combobox on the selected item)
  4. I have a php-webpage with a form on it. When I submit the form I check the submitted data with a self-written php-validator-class. When the validator-class says that there are no errors I insert the data in the database using a self-written php-DBFactory-class and the datatable on the webpage is updated with the new data. When the validator-class says that there are errors, the page does not write to the database, but instead showes the errors. This all workes fine. [b]But my problem now is that when I submit the data and the data gets written to the database, and I than click refresh on the webbrowser, the data gets written a second time to the database and the datatable on the webpage also gets reloaded with the new data (the new data is inserted twice). So the data from the POST is re-used when I refresh the webbrowser.[/b] How can I solve this refresh-problem? I heard about something like having a processing-step in between pages that makes sure that when you submit your form, a "new" page gets shown so that on refresh, the POST-data is not there anymore. But I wouldn't know how to do this. Does anybody have an idea?
×
×
  • 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.