Jump to content

Starringstars

Member
  • Posts

    5
  • Joined

  • Last visited

Profile Information

  • Location
    Netherlands

Contact Methods

  • Other
    starringstars@hotmail.com

Starringstars's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Okay I've fixed that. Now how know how to give access to a secure page in php? Thanx
  2. OKay I fixed that validation problem:) My only problem now is with the micro payment script which I have. Can someone help with a small thing?
  3. Thank you for the reply! I setup my one local SQLserver with xamp. Now the script is working and it puts the record in the database. I also have another script which easily shows my sql records. My problem is that the form validation is working but I want the respond from the validation on the same page. Now the respond is coming on page 2 because of the post action. How to fix this? So the form validation respond will be on the same page. I also implemented a micropayment system and I want to use it as validation before it sends out the form input to database. Maybe you can help with that? Thanx
  4. OKay Benjamin I have also put some comments in english. The only thing I want for now is to insert formdata into database. First I made an page with the form: I comment out the mail function. I will do this with swift mailer. For now I want to printout the database tables which users put into the database successfully, to a webpage. Let me know if you also need the 1 html page with the form Here is the script vewerk.php which is called from the action on index.php: <?php // this are the variables for the users input of the form $Naam = $_POST['naam']; print $Naam; $Cat = $_POST['cat']; print $Cat; $Onderwerp = $_POST['onderwerp'].' '; print $Onderwerp; $Email = $_POST['email'].' '; print $Email.' '; $Vraag = $_POST['vraag'].' '; print $Vraag.' '; $Merk = $_POST['merk'].' '; print $Merk.' '; $All = $Naam.$Onderwerp.$Cat.$Vraag.$Merk; // mijn mail $Mail = "mymailadres"; //mail($Mail, $Cat, $All, "From: $Email"); // Controle of een formulier gepost is if($_SERVER['REQUEST_METHOD'] == 'POST') { // Arrays declareren voor opslag van fouten en data $aErrors = array(); $aData = array(); // Velden die in het formulier aanwezig moeten zijn // array of form $aFormulierVelden = array('$Naam', '$Email', '$Cat', '$Vraag'); // Alle formuliervelden doorlopen foreach($aFormulierVelden as $sVeld) { // Controleren of er een waarde voor het formulierveld bestaat if(isset($_POST[$sVeld])) { // Spaties aan begin en eind weghalen $sValue = trim($_POST[$sVeld]); // Controle of variabele gevuld is if($sValue == '') { // Foutmelding toevoegen $aErrors[] = 'Je bent vergeten om je '.$sVeld.' in te vullen'; } // Ingevulde waarden aan data array toevoegen $aData[$sVeld] = $sValue; } else { $aErrors[] = 'Het veld '.$sVeld.' is niet gepost!'; } } } // Controleren of er geen fouten opgetreden zijn if(empty($aErrors)) { // Formulier succes! // form succes echo ' Je hebt het formulier succesvol ingevuld '.$Naam.'! De volgende gegevens zijn bekend:'; echo ' Naam: '.$aData['naam'].' '; echo 'Categorie: '.$aData['cat'].''; // inserts users input into db require 'db_config.php'; $sql = "INSERT INTO gegevens(naam, cat) VALUES('" . mysql_real_escape_string($aData['naam']) . "', '" . mysql_real_escape_string($aData['cat']) . "')"; $result = mysql_query($sql); } if(!$result) { trigger_error('Het is niet gelukt de gegevens in de database te plaatsen!'); } else { echo 'Uw gegevens zijn succesvol toegevoegd!'; } ?>
  5. Who can help me with a php code I wrote? It's just a simple form and I want to put the input into mysql database. The script is working in pieces but now I want the whole script to run. I'm a newby and the script has also dutch. Ore where can i post this? And why do I get an blank page when I ran the script on the server of my provider? :/ Thanx
×
×
  • Create New...