Hulp bij maken foutmelding
ik heb een verzend script.
met foutmeldingen.
Alleen het werkt niet helemaal lekker.
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
session_start();
if(!isset($_SESSION["user"])){
$text = "U are not logged in, so you are not allowed to come here";
echo($text);
}
else{
include "config.php";
if (!isset($_GET['site'])) { $_GET['site']="home"; }
if (file_exists($_GET['site'].".php")) {
if(isset($_POST["verzend"])){
$err = "";
if (!$_POST["to"]) $err .= "<font color='red'><b>You forgot to fill in an receiver</b> <br>\n";
if (!$_POST["sub"]) $err .= "<font color='red'><b>You forgot to fill in an subject</b> <br>\n";
if (!$_POST["msg"]) $err .= "<font color='red'><b>You forgot to fill in an message</b> <br>\n";
$query = "SELECT * FROM Login WHERE Name='" . $_POST["to"] ."'";
$result = mysql_query($query);
if(mysql_num_rows($result) > 1) $err .= "<font color='red'><b>The receiver doesn't excists</b></font><br>\n";
}
else
{
if($err = ""){
echo "cool";
}
else
{
echo $err;
}
?>
<table cellpadding="0" cellspacing="0" width="368" height="34">
<form method="POST" action="index.php?site=newmsg">
<tr>
<td width="50" height="30">To:</td>
<td width="50" height="30"><input type="text" name="to"></td>
</tr>
<tr>
<td width="50" height="30">Subject:</td>
<td width="50" height="30"><input type="text" name="sub"></td>
</tr>
<tr valign="top">
<td width="50" height="100">Message:</td>
<td width="50" height="100"><textarea name="msg" rows="5" cols="45"></textarea></td>
</tr>
<tr valign="top">
<td width="50" height="100"></td>
<td width="50" height="100"><input type="submit" name="verzend" value="Send"></td>
</tr>
</form>
</table><br>
<a href="index.php?site=pm">Back</a>
<?
}
} else { echo ""; }
}
?>
session_start();
if(!isset($_SESSION["user"])){
$text = "U are not logged in, so you are not allowed to come here";
echo($text);
}
else{
include "config.php";
if (!isset($_GET['site'])) { $_GET['site']="home"; }
if (file_exists($_GET['site'].".php")) {
if(isset($_POST["verzend"])){
$err = "";
if (!$_POST["to"]) $err .= "<font color='red'><b>You forgot to fill in an receiver</b> <br>\n";
if (!$_POST["sub"]) $err .= "<font color='red'><b>You forgot to fill in an subject</b> <br>\n";
if (!$_POST["msg"]) $err .= "<font color='red'><b>You forgot to fill in an message</b> <br>\n";
$query = "SELECT * FROM Login WHERE Name='" . $_POST["to"] ."'";
$result = mysql_query($query);
if(mysql_num_rows($result) > 1) $err .= "<font color='red'><b>The receiver doesn't excists</b></font><br>\n";
}
else
{
if($err = ""){
echo "cool";
}
else
{
echo $err;
}
?>
<table cellpadding="0" cellspacing="0" width="368" height="34">
<form method="POST" action="index.php?site=newmsg">
<tr>
<td width="50" height="30">To:</td>
<td width="50" height="30"><input type="text" name="to"></td>
</tr>
<tr>
<td width="50" height="30">Subject:</td>
<td width="50" height="30"><input type="text" name="sub"></td>
</tr>
<tr valign="top">
<td width="50" height="100">Message:</td>
<td width="50" height="100"><textarea name="msg" rows="5" cols="45"></textarea></td>
</tr>
<tr valign="top">
<td width="50" height="100"></td>
<td width="50" height="100"><input type="submit" name="verzend" value="Send"></td>
</tr>
</form>
</table><br>
<a href="index.php?site=pm">Back</a>
<?
}
} else { echo ""; }
}
?>
Ik zie het formulier wel maar zodra ik op send druk zie ik niks meer.
Kan iemand mij vertellen wat ik fout doe?
dus jij doet zo $_GET['site'] moet leeg zijn
en gebruik &&
GR. mebus
edit: zoals je al ziet in je script word er van de functie isset geen link gemaakt dus op die regel zit al een fout denk ik
gebruik daarom bovenaan je script:
error_reporting(E_ALL);
Gewijzigd op 01/01/1970 01:00:00 door Mebus Hackintosh
Notice: Undefined index: accpass1 in C:\Program Files\xampp\htdocs\test\config.php on line 19
welke isset bedoel je die geen link maakt?
if($err == ""){
maar hij is dus nu weg maar die accpass1 zit er nog ik snap niet waar die vandaan komt.
die stond in me config.
maar ik snap niet warom hij hem pakt:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function passConvert($password)
{
$encar = array('!'=>'95', '"'=>'88', '#'=>'9D', '$'=>'4C', '%'=>'F2', '&'=>'3E', '\''=>'BB', '('=>'C0', ')'=>'7F', '*'=>'18', '+'=>'70', ','=>'A6', '-'=>'E2', '.'=>'EC', '/'=>'77',
'0'=>'2C', '1'=>'3A', '2'=>'4A', '3'=>'91', '4'=>'5D', '5'=>'7A', '6'=>'29', '7'=>'BC', '8'=>'6E', '9'=>'D4', ':'=>'40', ';'=>'17', '<'=>'2E', '='=>'CB', '>'=>'72', '?'=>'9C',
'@'=>'A1', 'A'=>'FF', 'B'=>'F3', 'C'=>'F8', 'D'=>'9B', 'E'=>'50', 'F'=>'51', 'G'=>'6D', 'H'=>'E9', 'I'=>'9A', 'J'=>'B8', 'K'=>'84', 'L'=>'A8', 'M'=>'14', 'N'=>'38', 'O'=>'CE',
'P'=>'92', 'Q'=>'5C', 'R'=>'F5', 'S'=>'EE', 'T'=>'B3', 'U'=>'89', 'V'=>'7B', 'W'=>'A2', 'X'=>'AD', 'Y'=>'71', 'Z'=>'E3', '['=>'D5', '\\'=>'BF', ']'=>'53', '^'=>'28', '_'=>'44',
'`'=>'33', 'a'=>'48', 'b'=>'DB', 'c'=>'FC', 'd'=>'09', 'e'=>'1F', 'f'=>'94', 'g'=>'12', 'h'=>'73', 'i'=>'37', 'j'=>'82', 'k'=>'81', 'l'=>'39', 'm'=>'C2', 'n'=>'8D', 'o'=>'7D',
'p'=>'08', 'q'=>'4F', 'r'=>'B0', 's'=>'FE', 't'=>'79', 'u'=>'0B', 'v'=>'D6', 'w'=>'23', 'x'=>'7C', 'y'=>'4B', 'z'=>'8E', '{'=>'06', '|'=>'5A', '}'=>'CC', '~'=>'62');
$newpass = "0x";
for ($i = 0; $i < strlen($password); $i++)
{
$newpass .= $encar[$password[$i]];
}
return $newpass;
}
$cpass = passConvert($_POST["accpass1"]);
{
$encar = array('!'=>'95', '"'=>'88', '#'=>'9D', '$'=>'4C', '%'=>'F2', '&'=>'3E', '\''=>'BB', '('=>'C0', ')'=>'7F', '*'=>'18', '+'=>'70', ','=>'A6', '-'=>'E2', '.'=>'EC', '/'=>'77',
'0'=>'2C', '1'=>'3A', '2'=>'4A', '3'=>'91', '4'=>'5D', '5'=>'7A', '6'=>'29', '7'=>'BC', '8'=>'6E', '9'=>'D4', ':'=>'40', ';'=>'17', '<'=>'2E', '='=>'CB', '>'=>'72', '?'=>'9C',
'@'=>'A1', 'A'=>'FF', 'B'=>'F3', 'C'=>'F8', 'D'=>'9B', 'E'=>'50', 'F'=>'51', 'G'=>'6D', 'H'=>'E9', 'I'=>'9A', 'J'=>'B8', 'K'=>'84', 'L'=>'A8', 'M'=>'14', 'N'=>'38', 'O'=>'CE',
'P'=>'92', 'Q'=>'5C', 'R'=>'F5', 'S'=>'EE', 'T'=>'B3', 'U'=>'89', 'V'=>'7B', 'W'=>'A2', 'X'=>'AD', 'Y'=>'71', 'Z'=>'E3', '['=>'D5', '\\'=>'BF', ']'=>'53', '^'=>'28', '_'=>'44',
'`'=>'33', 'a'=>'48', 'b'=>'DB', 'c'=>'FC', 'd'=>'09', 'e'=>'1F', 'f'=>'94', 'g'=>'12', 'h'=>'73', 'i'=>'37', 'j'=>'82', 'k'=>'81', 'l'=>'39', 'm'=>'C2', 'n'=>'8D', 'o'=>'7D',
'p'=>'08', 'q'=>'4F', 'r'=>'B0', 's'=>'FE', 't'=>'79', 'u'=>'0B', 'v'=>'D6', 'w'=>'23', 'x'=>'7C', 'y'=>'4B', 'z'=>'8E', '{'=>'06', '|'=>'5A', '}'=>'CC', '~'=>'62');
$newpass = "0x";
for ($i = 0; $i < strlen($password); $i++)
{
$newpass .= $encar[$password[$i]];
}
return $newpass;
}
$cpass = passConvert($_POST["accpass1"]);
Gewijzigd op 01/01/1970 01:00:00 door Aoi
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
session_start();
if(empty($_SESSION["user"])){
$text = "U are not logged in, so you are not allowed to come here";
echo($text);
}
else{
include "config.php";
if (isset($_GET['site']) && $_GET['site'] = "home") {
if (file_exists($_GET['site'].".php")) {
if(isset($_POST["verzend"])){
$err = "";
if (!$_POST["to"]) $err .= "<font color='red'><b>You forgot to fill in an receiver</b> <br>\n";
if (!$_POST["sub"]) $err .= "<font color='red'><b>You forgot to fill in an subject</b> <br>\n";
if (!$_POST["msg"]) $err .= "<font color='red'><b>You forgot to fill in an message</b> <br>\n";
$query = "SELECT * FROM Login WHERE Name='" . $_POST["to"] ."'";
$result = mysql_query($query) or trigger_error(mysql_error());
if(mysql_num_rows($result) > 1) $err .= "<font color='red'><b>The receiver doesn't excists</b></font><br>\n";
}
else
{
if($err == ""){
echo "cool";
}
else
{
echo $err;
}
?>
session_start();
if(empty($_SESSION["user"])){
$text = "U are not logged in, so you are not allowed to come here";
echo($text);
}
else{
include "config.php";
if (isset($_GET['site']) && $_GET['site'] = "home") {
if (file_exists($_GET['site'].".php")) {
if(isset($_POST["verzend"])){
$err = "";
if (!$_POST["to"]) $err .= "<font color='red'><b>You forgot to fill in an receiver</b> <br>\n";
if (!$_POST["sub"]) $err .= "<font color='red'><b>You forgot to fill in an subject</b> <br>\n";
if (!$_POST["msg"]) $err .= "<font color='red'><b>You forgot to fill in an message</b> <br>\n";
$query = "SELECT * FROM Login WHERE Name='" . $_POST["to"] ."'";
$result = mysql_query($query) or trigger_error(mysql_error());
if(mysql_num_rows($result) > 1) $err .= "<font color='red'><b>The receiver doesn't excists</b></font><br>\n";
}
else
{
if($err == ""){
echo "cool";
}
else
{
echo $err;
}
?>
<table cellpadding="0" cellspacing="0" width="368" height="34">
<form method="POST" action="index.php?site=newmsg">
<tr>
<td width="50" height="30">To:</td>
<td width="50" height="30"><input type="text" name="to"></td>
</tr>
<tr>
<td width="50" height="30">Subject:</td>
<td width="50" height="30"><input type="text" name="sub"></td>
</tr>
<tr valign="top">
<td width="50" height="100">Message:</td>
<td width="50" height="100"><textarea name="msg" rows="5" cols="45"></textarea></td>
</tr>
<tr valign="top">
<td width="50" height="100"></td>
<td width="50" height="100"><input type="submit" name="verzend" value="Send"></td>
</tr>
</form>
</table><br>
<a href="index.php?site=pm">Back</a>
dit is al iets beter
edit: Pffff der zitten hier zoveel fouten in dat de php functie's niet eens links worden in je script
Gewijzigd op 01/01/1970 01:00:00 door Mebus Hackintosh