ok first i got "admin" site where events are generated:
CODE
<?php
/**
* @neeno
* @copyright 2008
*/
//database connecting
mysql_connect("xx, "xx", "xx") or die(mysql_error());
mysql_select_db("xx") or die(mysql_error());
//checking fields and running ze code
if (isset($_POST['submit'])) {
//This makes sure they did not leave any fields blank
if (!$_POST['type'] | !$_POST['date'] | !$_POST['time'] | !$_POST['link'] | !$_POST['details'] ) {
die('You did not complete all of the required fields');
}
//inserting the event
$insert = "INSERT INTO dogodki (type, date, time, link, details)
VALUES ('".$_POST['type']."', '".$_POST['date']."','".$_POST['time']."','".$_POST['link']."','".$_POST['details']."')";
$add_member = mysql_query($insert);
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<fieldset>
<legend>Data</legend>
<p>
<label>Type of event</label>
<select name= "type">
<option>GvG</option>
<option>TA</option>
<option>HA</option>
<option>AB</option>
<option>Guild meeting</option>
</select>
</p>
<p>
<label>Date of event</label>
<input type = "text" name="date"/>
</p>
<p>
<label>Time of event</label>
<input type = "text" name="time"/>
</p>
<p>
<label>Link to the build</label>
<input type = "text" name="link"/>
</p>
<p>
<label>Details</label>
<textarea name = "details" rows = "10" cols = "30"></textarea>
</p>
<p>
<input type="submit" name="submit" value="Add"/>
</p>
</fieldset>
</form>
</body>
</html>
Then i have the site where these generated events are shown:
CODE
<html>
<head>
</head>
<body>
<?php
/**
* @author
* @copyright 2008
*/
$conn = mysql_connect("xxx", "xxx", "xxx") or die (mysql_error());
mysql_select_db("xxx");
$sql = "SELECT type FROM dogodki";
$rezultat = mysql_query($sql, $conn) or die (mysql_error());
$sql1 = "SELECT date, time FROM dogodki";
$rezultat1 = mysql_query($sql1, $conn) or die (mysql_error());
while($row = mysql_fetch_assoc($rezultat)){
$row2 = mysql_fetch_assoc($rezultat1);
foreach ($row as $name => $value){
print "<a href = 'details.php'>$name: $value</a> ";}
foreach ($row2 as $name => $value){
print "$name: $value ";
}
print "<br/>";
}
?>
</body>
</html>
These shown events are clickable and takes you to the next site:
CODE
<html>
<head>
</head>
<body>
<?php
$conn = mysql_connect("xxx", "xxx", "xxx") or die (mysql_error());
mysql_select_db("xxx");
$sql = "SELECT details FROM dogodki";
$rezultat = mysql_query($sql, $conn) or die (mysql_error());
while($row = mysql_fetch_assoc($rezultat)){
foreach ($row as $name => $value){
print "$name: $value ";
}
print "<br/>";
}
?>
<form action="<?php echo $_SERVER['signup.php']; ?>" method="post">
<fieldset>
<legend>Sign up</legend>
<p>
<input type = "text" name="signup"/>
<label>Sign up</label>
</p>
<p>
<input type = "text" name= "late"/>
<label>Minutes Late</label>
</p>
<p>
<input type="submit" name="submit" value="Sign Up"/>
</p>
</fieldset>
</form>
</body>
Here the users are suppose to sign up to the event they clicked. And this is where i got stuck.. i need this form in details.php to be submited and saved into database and the data has to be somehow connected to the events.