Geachte,

Sorry dat ik alweer een berichtje plaats, maar ik heb het vorige afgerond en net iets gemaakt waar ik niet uit kom... Misschien hoort het beter thuis onder SQL?

<?php

// Gemaakt door Harm Wesselink
// Copyright © Harm Wesselink

if($_POST['opslaan_tegenstander']){

header('Location: ../cms/?id='.$_GET['id'].'&ga=matches&action=modify&matchid='.$_GET['wedstrijd_id'].'');

if($_GET['team'] == 1){

include("selectie/user.php");

$connection = mysql_connect($host, $user, $password)
or die(mysql_error());
mysql_select_db($txt_db_name, $connection)
or die(mysql_error());

mysql_query("INSERT INTO
tplss_goals
SET
GoalID = '',
GoalPlayerID = '324329',
GoalMatchId = '".$_GET['wedstrijd_id']."',
GoalSeasonID = '".$_GET['seizoen_id']."',
GoalMinute = '".$_POST['goal_minuut']."',
GoalOwn = '".$_POST['goal_eigen']."',
GoalPenalty = '".$_POST['goal_penalty']."',
") or die(mysql_error());
}

if($_GET['team'] == 2){

include("selectie_2/user.php");

$connection = mysql_connect($host, $user, $password)
or die(mysql_error());
mysql_select_db($txt_db_name, $connection)
or die(mysql_error());

mysql_query("INSERT INTO
tplss_goals
SET
GoalID = '',
GoalPlayerID = '324329',
GoalMatchId = '".$_GET['wedstrijd_id']."',
GoalSeasonID = '".$_GET['seizoen_id']."',
GoalMinute = '".$_POST['goal_minuut']."',
GoalOwn = '".$_POST['goal_eigen']."',
GoalPenalty = '".$_POST['goal_penalty']."',
") or die(mysql_error());
}
} else {
echo '<b>Helaas, via deze weg kom je er niet!</b>';
}
?>

De file waar alles wordt opgeslagen, en hier komen de posts etc. vandaan:

	<tr>
	<td>
		<form name="opslaan_tegenstander" method="post" action="tegenstander_scoort_opslaan.php?wedstrijd_id=<?php echo $matchid ?>&seizoen_id=<?php echo $seasonid ?>&id=<?php echo $_GET['id']; ?>&team=1">
		Minuut: 
		<input type="text" name="goal_minuut" size="2"> 
		(0 invullen bij onbekend)<br>
		Elfmeter? 
		<input type="checkbox" value="1" name="goal_penalty"><br>
		Eigen doelpunt?
		<input type="checkbox" value="1" name="goal_eigen"><br>
		<br><input type="submit" name="opslaan_tegenstander" value="Toevoegen"><br>
		</form>	
	</td>
	</tr>


Maar nu snap ik niet waarom hij niks opslaat?
Je INSERT syntax is fout. Verder is je script gevoelig voor sql-injection.

Reageren