Hallo wahsaga
ich bin einfach etwas durcheinander, habe x-post's darüber gelesen
und checks einfach imma noch ned, da kommen dann schon mal zweifel an mir selbst auf.
hier der code für das einfüge formular
----------------------------------------------------------------
<?php require_once('../Connections/arena.php'); ?>
<?php
mysql_select_db($database_arena, $arena);
$query_Recordset1 = "SELECT * FROM aktuell ORDER BY datum ASC";
$Recordset1 = mysql_query($query_Recordset1, $arena) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<html>
<head>
<title>start</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="css/main-style.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="30" topmargin="0">
<tr>
<td width="670" height="520" valign="top"><table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="18" height="20"> </td>
<td height="20"> </td>
<td height="20" class="aktualisiert"> </td>
</tr>
<tr>
<td width="18" height="500" rowspan="2"> </td>
<td height="395" colspan="2" valign="top"><font size="3" face="Verdana, Arial, Helvetica, sans-serif"><strong>Beitrag in Aktuell hinzufügen</strong></font>
<hr align="left" width="580" size="1" noshade>
<span class="text"><img src="img/blind.gif" width="2" height="5"><br>
</span>
<table width="100%" height="20" border="0" cellpadding="0" cellspacing="1" bgcolor="#00CC00">
<tr>
<td bgcolor="#E4F7E1"> <span class="text"><font color="#0000FF">Neuen Beitrag in Aktuell erstellen</font></span></td></tr></table>
<br>
<br>
<table width="560" height="20" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="93"> </td>
<td width="467"><?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
$editFormAction = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];
}
if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO aktuell (datum) VALUES (%s,%s,%s)",
GetSQLValueString($HTTP_POST_VARS['titel'], "text"),
GetSQLValueString($HTTP_POST_VARS['text'], "text"),
GetSQLValueString($HTTP_POST_VARS['datum'], "date"));
$error = "Fehler : Beide Felder dürfen nicht leer sein!";
$error2 = "Sie sind in unserem Newsletter schon eingetragen.";
$ok = "Eintrag erfolgreich. Hier geht es weiter";
mysql_select_db($database_arena, $arena);
$Result1 = mysql_query($insertSQL, $arena);
if (!$Result1)
{
echo "<table lenght=500 height=20 class=newstable><td><center>$error</center></td></table>";
}
else
{
echo "<table lenght=500 height=20 class=newstableok><td><center><a href=aktuell_show.php a.class=inputlink>$ok</a></center></td></table>";
}
}
?>
</td>
</tr>
</table>
<span class="text">
<form method="post" name="form1" action="<?php echo $editFormAction; ?>">
<table width="561" align="left">
<tr valign="baseline">
<td width="86" align="right" valign="middle" nowrap class="form"><div align="left">Titel:</div></td>
<td width="463" height="40" valign="middle"><input type="text" name="titel" value="" size="32" class="addnews1">
</td>
</tr>
<tr valign="baseline">
<td align="right" valign="top" nowrap class="form"><div align="left">Text:</div></td>
<td height="40" valign="middle"><textarea name="text" cols="32" rows="4" class="addnews2"></textarea>
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td height="40" valign="middle"><input type="submit" value="Datensatz einfügen" class="newsbutton1">
</td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1">
</form>
<p> </p>
</span> </td>
</tr>
<tr>
<td width="558" height="20" valign="top"><br>
<br>
</td>
<td width="24" valign="middle" class="aktualisiert"> </td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>
---------------------------------------------------------------------------
viel gruss, rony
ich bin einfach etwas durcheinander, habe x-post's darüber gelesen
und checks einfach imma noch ned, da kommen dann schon mal zweifel an mir selbst auf.
hier der code für das einfüge formular
----------------------------------------------------------------
<?php require_once('../Connections/arena.php'); ?>
<?php
mysql_select_db($database_arena, $arena);
$query_Recordset1 = "SELECT * FROM aktuell ORDER BY datum ASC";
$Recordset1 = mysql_query($query_Recordset1, $arena) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<html>
<head>
<title>start</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="css/main-style.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="30" topmargin="0">
<tr>
<td width="670" height="520" valign="top"><table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="18" height="20"> </td>
<td height="20"> </td>
<td height="20" class="aktualisiert"> </td>
</tr>
<tr>
<td width="18" height="500" rowspan="2"> </td>
<td height="395" colspan="2" valign="top"><font size="3" face="Verdana, Arial, Helvetica, sans-serif"><strong>Beitrag in Aktuell hinzufügen</strong></font>
<hr align="left" width="580" size="1" noshade>
<span class="text"><img src="img/blind.gif" width="2" height="5"><br>
</span>
<table width="100%" height="20" border="0" cellpadding="0" cellspacing="1" bgcolor="#00CC00">
<tr>
<td bgcolor="#E4F7E1"> <span class="text"><font color="#0000FF">Neuen Beitrag in Aktuell erstellen</font></span></td></tr></table>
<br>
<br>
<table width="560" height="20" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="93"> </td>
<td width="467"><?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
$editFormAction = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];
}
if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO aktuell (datum) VALUES (%s,%s,%s)",
GetSQLValueString($HTTP_POST_VARS['titel'], "text"),
GetSQLValueString($HTTP_POST_VARS['text'], "text"),
GetSQLValueString($HTTP_POST_VARS['datum'], "date"));
$error = "Fehler : Beide Felder dürfen nicht leer sein!";
$error2 = "Sie sind in unserem Newsletter schon eingetragen.";
$ok = "Eintrag erfolgreich. Hier geht es weiter";
mysql_select_db($database_arena, $arena);
$Result1 = mysql_query($insertSQL, $arena);
if (!$Result1)
{
echo "<table lenght=500 height=20 class=newstable><td><center>$error</center></td></table>";
}
else
{
echo "<table lenght=500 height=20 class=newstableok><td><center><a href=aktuell_show.php a.class=inputlink>$ok</a></center></td></table>";
}
}
?>
</td>
</tr>
</table>
<span class="text">
<form method="post" name="form1" action="<?php echo $editFormAction; ?>">
<table width="561" align="left">
<tr valign="baseline">
<td width="86" align="right" valign="middle" nowrap class="form"><div align="left">Titel:</div></td>
<td width="463" height="40" valign="middle"><input type="text" name="titel" value="" size="32" class="addnews1">
</td>
</tr>
<tr valign="baseline">
<td align="right" valign="top" nowrap class="form"><div align="left">Text:</div></td>
<td height="40" valign="middle"><textarea name="text" cols="32" rows="4" class="addnews2"></textarea>
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td height="40" valign="middle"><input type="submit" value="Datensatz einfügen" class="newsbutton1">
</td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1">
</form>
<p> </p>
</span> </td>
</tr>
<tr>
<td width="558" height="20" valign="top"><br>
<br>
</td>
<td width="24" valign="middle" class="aktualisiert"> </td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>
---------------------------------------------------------------------------
viel gruss, rony
Kommentar