Witam, znowu mam problem:
Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /dota/generate.php on line 4
Generate.php
<?php
$id = 0;
$id = $id + 1;
$1lvl = $_POST['1lvl'];
$2lvl = $_POST['2lvl'];
$3lvl = $_POST['3lvl'];
$4lvl = $_POST['4lvl'];
$5lvl = $_POST['5lvl'];
$6lvl = $_POST['6lvl'];
$7lvl = $_POST['7lvl'];
$8lvl = $_POST['8lvl'];
$9lvl = $_POST['9lvl'];
$10lvl = $_POST['10lvl'];
$11lvl = $_POST['11lvl'];
$12lvl = $_POST['12lvl'];
$13lvl = $_POST['13lvl'];
$14lvl = $_POST['14lvl'];
$15lvl = $_POST['15lvl'];
$16lvl = $_POST['16lvl'];
$17lvl = $_POST['17lvl'];
$18lvl = $_POST['18lvl'];
$txt = $_POST['txt'];
include 'includes/config.php';
include 'includes/opendphp';
$ins = @mysql_query("INSERT INTO admiral SET id='$id', 1lvl='$1lvl', 2lvl='$2lvl', 3lvl='$3lvl', 4lvl='$4lvl', 5lvl='$5lvl', 6lvl='$6lvl', 7lvl='$7lvl', 8lvl='$8lvl', 9lvl='$9lvl', 10lvl='$10lvl', 11lvl='$11lvl', 12lvl='$12lvl', 13lvl='$13lvl', 14lvl='$14lvl', 15lvl='$15lvl', 16lvl='$16lvl', 17lvl='$17lvl', 18lvl='$18lvl', txt='$txt'");
if($ins)
echo "Rekord został dodany poprawnie"; else
echo "Błąd nie udało się dodać nowego rekordu"; ?>
opendb.php
<?php
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or
die ('Error connecting to mysql'); ?>
W config.php mam dane do bazy.
EDIT: Aha jeszcze formularz.
index.php
<link rel="stylesheet" href="style.css" type="text/css"> <script language="javascript" type="text/javascript" src="/js/jquery-1.4.4.min.js"></script> $(document).ready(function() {
$("#accordion").accordion();
});
<img src="images/header.jpg"/> <h3><a href="#">Skills
</a></h3> <form action="generate.php" method="post"> <img src="images/skill-1-mini.jpg" width="20" height="20" /><br> <img src="images/skill-2-mini.jpg" width="20" height="20" /><br> <img src="images/skill-3-mini.jpg" width="20" height="20" /><br> <img src="images/skill-4-mini.jpg" width="20" height="20" /><br> <input type=radio name=1lvl value="1"/><br> <input type=radio name=1lvl value="2"/><br> <input type=radio name=1lvl value="3"/><br> <input type=radio name=1lvl value="4"/> <input type=radio name=2lvl value="1"/><br> <input type=radio name=2lvl value="2"/><br> <input type=radio name=2lvl value="3"/><br> <input type=radio name=2lvl value="4"/> <input type=radio name=3lvl value="1"/><br> <input type=radio name=3lvl value="2"/><br> <input type=radio name=3lvl value="3"/><br> <input type=radio name=3lvl value="4"/> <input type=radio name=4lvl value="1"/><br> <input type=radio name=4lvl value="2"/><br> <input type=radio name=4lvl value="3"/><br> <input type=radio name=4lvl value="4"/> <input type=radio name=5lvl value="1"/><br> <input type=radio name=5lvl value="2"/><br> <input type=radio name=5lvl value="3"/><br> <input type=radio name=5lvl value="4"/> <input type=radio name=6lvl value="1"/><br> <input type=radio name=6lvl value="2"/><br> <input type=radio name=6lvl value="3"/><br> <input type=radio name=6lvl value="4"/> <input type=radio name=7lvl value="1"/><br> <input type=radio name=7lvl value="2"/><br> <input type=radio name=7lvl value="3"/><br> <input type=radio name=7lvl value="4"/> <input type=radio name=8lvl value="1"/><br> <input type=radio name=8lvl value="2"/><br> <input type=radio name=8lvl value="3"/><br> <input type=radio name=8lvl value="4"/> <input type=radio name=9lvl value="1"/><br> <input type=radio name=9lvl value="2"/><br> <input type=radio name=9lvl value="3"/><br> <input type=radio name=9lvl value="4"/> <input type=radio name=10lvl value="1"/><br> <input type=radio name=10lvl value="2"/><br> <input type=radio name=10lvl value="3"/><br> <input type=radio name=10lvl value="4"/> <input type=radio name=11lvl value="1"/><br> <input type=radio name=11lvl value="2"/><br> <input type=radio name=11lvl value="3"/><br> <input type=radio name=11lvl value="4"/> <input type=radio name=12lvl value="1"/><br> <input type=radio name=12lvl value="2"/><br> <input type=radio name=12lvl value="3"/><br> <input type=radio name=12lvl value="4"/> <input type=radio name=13lvl value="1"/><br> <input type=radio name=13lvl value="2"/><br> <input type=radio name=13lvl value="3"/><br> <input type=radio name=13lvl value="4"/> <input type=radio name=14lvl value="1"/><br> <input type=radio name=14lvl value="2"/><br> <input type=radio name=14lvl value="3"/><br> <input type=radio name=14lvl value="4"/> <input type=radio name=15lvl value="1"/><br> <input type=radio name=15lvl value="2"/><br> <input type=radio name=15lvl value="3"/><br> <input type=radio name=15lvl value="4"/> <input type=radio name=16lvl value="1"/><br> <input type=radio name=16lvl value="2"/><br> <input type=radio name=16lvl value="3"/><br> <input type=radio name=16lvl value="4"/> <input type=radio name=17lvl value="1"/><br> <input type=radio name=17lvl value="2"/><br> <input type=radio name=17lvl value="3"/><br> <input type=radio name=17lvl value="4"/> <input type=radio name=18lvl value="1"/><br> <input type=radio name=18lvl value="2"/><br> <input type=radio name=18lvl value="3"/><br> <input type=radio name=18lvl value="4"/> <h3><a href="#">Additional Tips
</a></h3> <textarea style="font-size: small;" name="txt" rows="10" cols="100"> Write there additional hints. You can use html for
<b>bold
</b>,
<i>italic
</i> or
<u>underlined
</u> text
<input type=submit value="Submit"/>
Ten post edytował $_GET['Kuba'] 20.02.2011, 14:40:51