witte pagina bij query
IceCold - 03/10/2004 21:34
|
Nieuw lid |
|
<?
isempty($_GET['catid']);
isempty($_POST['topic']);
isempty($_POST['bericht']);
// Checking Var's
$catid = $_GET['catid'];
$topic = htmlspecialchars($_POST['topic']);
$bericht = htmlspecialchars($_POST['bericht']);
$datum = date('d - m - y');
$posterid = 1;
$sticky = "nee";
$gesloten = "nee";
$query="INSERT INTO underscored_topics (catid, titel, bericht, datum, posterid, sticky, gesloten) VALUES ('$catid', '$topic', '$bericht', '$datum', '$datum', '$posterid', '$sticky', '$gesloten')";
mysql_query($query) or die(mysql_error());
?>
<?
function isempty()
function isempty($value) {
if(!isset($value)) {
echo "ERROR!";
}
elseif($value == "") {
echo "ERROR!";
}
}
?>
|
5 antwoorden
Gesponsorde links |
|
MothZone - 03/10/2004 21:44
|
PHP ver gevorderde |
|
zet je functie bovenaan de code ipv onderaan |
IceCold - 03/10/2004 21:46 (laatste wijziging 03/10/2004 21:46)
|
Nieuw lid |
|
de functie zit in configfile
heel de code
<? include('config.php'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?=$pagina_titel; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
<!--
a:link {
color: #000000;
}
a:visited {
color: #000000;
}
a:hover {
color: #000000;
}
a:active {
color: #000000;
}
body,td,th {
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #000000;
font-size: x-small;
}
body {
background-color: #FFFFFF;
}
.titels {
color: #FFFFFF;
font-weight: bold;
}
.style5 {
font-size: small;
font-weight: bold;
}
-->
</style></head>
<body>
<div align="center">
<table width="650" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<?
isempty($_GET['catid']);
isempty($_POST['topic']);
isempty($_POST['bericht']);
// Checking Var's
$catid = $_GET['catid'];
$topic = htmlspecialchars($_POST['topic']);
$bericht = htmlspecialchars($_POST['bericht']);
$datum = date('d - m - y');
$posterid = 1;
$sticky = "nee";
$gesloten = "nee";
$query="INSERT INTO underscored_topics (catid, titel, bericht, datum, posterid, sticky, gesloten) VALUES ('$catid', '$topic', '$bericht', '$datum', '$datum', '$posterid', '$sticky', '$gesloten')";
mysql_query($query) or die(mysql_error());
?>
test
</td>
</tr>
</table>
<br />
<br />
<? include('copyright.php'); ?>
</div>
</body>
</html>
<? include('config.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title><?=$pagina_titel; ?></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <style type="text/css"> <!-- a:link { color: #000000; } a:visited { color: #000000; } a:hover { color: #000000; } a:active { color: #000000; } body,td,th { font-family: Verdana, Arial, Helvetica, sans-serif; color: #000000; font-size: x-small; } body { background-color: #FFFFFF; } .titels { color: #FFFFFF; font-weight: bold; } .style5 { font-size: small; font-weight: bold; } --> </style></head> <body> <div align="center"> <table width="650" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <? isempty($_GET['catid']); isempty($_POST['topic']); isempty($_POST['bericht']); // Checking Var's $catid = $_GET['catid']; $datum = date('d - m - y'); $posterid = 1; $sticky = "nee"; $gesloten = "nee"; $query="INSERT INTO underscored_topics (catid, titel, bericht, datum, posterid, sticky, gesloten) VALUES ('$catid', '$topic', '$bericht', '$datum', '$datum', '$posterid', '$sticky', '$gesloten')"; ?> test </td> </tr> </table> <br /> <br /> <? include('copyright.php'); ?> </div> </body> </html>
|
SickBoy - 03/10/2004 21:54
|
MySQL beginner |
|
wat zegt de broncode ?? |
IceCold - 03/10/2004 22:07
|
Nieuw lid |
|
error ==>
ERROR!
Column count doesn't match value count at row 1 |
DRUNK - 03/10/2004 23:26 (laatste wijziging 03/10/2004 23:26)
|
PHP gevorderde |
|
<?php
$query="INSERT INTO underscored_topics (catid, titel, bericht, datum, posterid, sticky, gesloten) VALUES ('$catid', '$topic', '$bericht', '$datum', '$datum', '$posterid', '$sticky', '$gesloten')";
?>
<?php $query="INSERT INTO underscored_topics (catid, titel, bericht, datum, posterid, sticky, gesloten) VALUES ('$catid', '$topic', '$bericht', '$datum', '$datum', '$posterid', '$sticky', '$gesloten')"; ?>
bekijk dat stukje eens? Je hebt 7 (zeven) velden, en je wilt er 8 (acht) gegevens in stoppen. Lees nu de foutmelding opnieuw.......En wat is er fout? |
Gesponsorde links |
|
Dit onderwerp is gesloten. |
|