PHP der fryser af en eller anden uforklarlig årsag

Tags:    php

Okay... hvad er der galt her. Nåe jeg trykker på submit knappen sker der INGEN ting... Keine... ZIP:
-----
<html>

<head>
<title>Add News</title>
</head>

<body>

<form>
<table width="868">
<tr>
<td width"50" width="91">Adminuser:</td>
<td width"100" width="765"><input type="text" name="adminuser" size="20"></td>
</tr>
<tr>
<td width"50" width="91">Adminpass:</td>
<td width"100" width="765"><input type="password" name="adminpass" size="20"></td>
</tr>
<tr>
<td width"50" width="91">Name:</td>
<td width"100" width="765"><input type="text" name="name" value"<? echo $name ?> size="20"></td>
</tr>
<tr>
<td width"50" width="91">Dato:</td>
<td width"100" width="765"><input type="text" name="date" value"<? echo $date ?> size="20"></td>
</tr>
<tr>
<td width"50" width="91">Head Line:</td>
<td width"100" width="765"><input type="text" name="headline" value"<? echo $headline ?> size="20"></td>
</tr>
<tr>
<td width"50" width="91">Text:</td>
<td width"100" width="765"><textarea rows="10" name="news" value"<? echo $text ?> cols="80"></textarea></td>
</tr>
</table>
<input type="button" value="submit" name="submit">
</form>
</body>
</html>
<?
if($submit)
{
if(!$name)
{
echo "Dummy - Write your freaking name";
}
else if(!$headline)
{
echo "Oops - Dont you think it would be easier if the news had a head line?!?";
}
else if(!$news)
{
echo "ehheem - A news with no text? Are you insane!?";
}
else
{
$db = mysql_connect("localhost","evil","fish1");
mysql_select_db("db", $db);
mysql_query("SELECT FROM admin user, pass WHERE user = '$adminuser'") or die(mysql_error());
if($adminpass == $pass)
{
$db = mysql_connect("localhost","evil","fish1");
mysql_select_db("db", $db);
mysql_query("INSERT INTO news (name, headline, news, date) VALUES('$name','$headline','$news','$date')") or die(mysql_error());
echo "The news is added to database \\"news\\"";
}
else if($adminpass != $pass)
{
echo "Password incorrect";
}
}
}
?>
------

Evilfish
Am I evil?!?! SAY MY NAME :)



1 svar postet i denne tråd vises herunder
1 indlæg har modtaget i alt 2 karma
Sorter efter stemmer Sorter efter dato
Okay... hvad er der galt her. Nåe jeg trykker på submit knappen sker der INGEN ting... Keine... ZIP:
-----
<html>

<head>
<title>Add News</title>
</head>

<body>

<form>
<table width="868">
<tr>
<td width"50" width="91">Adminuser:</td>
<td width"100" width="765"><input type="text" name="adminuser" size="20"></td>
</tr>
<tr>
<td width"50" width="91">Adminpass:</td>
<td width"100" width="765"><input type="password" name="adminpass" size="20"></td>
</tr>
<tr>
<td width"50" width="91">Name:</td>
<td width"100" width="765"><input type="text" name="name" value"<? echo $name ?> size="20"></td>
</tr>
<tr>
<td width"50" width="91">Dato:</td>
<td width"100" width="765"><input type="text" name="date" value"<? echo $date ?> size="20"></td>
</tr>
<tr>
<td width"50" width="91">Head Line:</td>
<td width"100" width="765"><input type="text" name="headline" value"<? echo $headline ?> size="20"></td>
</tr>
<tr>
<td width"50" width="91">Text:</td>
<td width"100" width="765"><textarea rows="10" name="news" value"<? echo $text ?> cols="80"></textarea></td>
</tr>
</table>
<input type="button" value="submit" name="submit">
</form>
</body>
</html>
<?
if($submit)
{
if(!$name)
{
echo "Dummy - Write your freaking name";
}
else if(!$headline)
{
echo "Oops - Dont you think it would be easier if the news had a head line?!?";
}
else if(!$news)
{
echo "ehheem - A news with no text? Are you insane!?";
}
else
{
$db = mysql_connect("localhost","evil","fish1");
mysql_select_db("db", $db);
mysql_query("SELECT FROM admin user, pass WHERE user = '$adminuser'") or die(mysql_error());
if($adminpass == $pass)
{
$db = mysql_connect("localhost","evil","fish1");
mysql_select_db("db", $db);
mysql_query("INSERT INTO news (name, headline, news, date) VALUES('$name','$headline','$news','$date')") or die(mysql_error());
echo "The news is added to database \\"news\\"";
}
else if($adminpass != $pass)
{
echo "Password incorrect";
}
}
}
?>
------

Evilfish
Am I evil?!?! SAY MY NAME :)


du skal bruge <form action=phpself metod=post>

kan ikke huske om der skal <??> om phpself det er noget i den stil og ikke bare

<form>

mvh.
Thomas Christensen




t