installation easy, no problems ;]
but, i copied backuped code i used in debian and put to xampp
i got errors, thought no idea why, cause in debian no problem ;\
Notice: Undefined index: id in /home/conta/web/admin/add.php on line 16
Notice: Undefined index: comments in /home/conta/web/admin/add.php on line 17
i put numbers in code so you can see which ones they are
- Code: Select all
<?php
include("menu.php");
?>
<p>Be patient, please, Adding might be slowly. It's not fault of your keyboard, we all know ...
<form action="<?php echo $PHP_SELF;?>" method="post">
<p>ID: <input type="text" name="id" /></p>
<p>Your comments:<br />
<textarea name="comments" rows="4" cols="26"></textarea></p>
<p><input type="submit" value="OK"></p>
</form>
<?php
16>> $id=$_POST['id'];
17>> $comments=$_POST['comments'];
if ($id<>0) {
$xml = simplexml_load_file("http://api.erepublik.com/v2/feeds/citizens/$id");
$name = $xml->name;
mysql_query("INSERT INTO legionar (id, name, comment)
VALUES (\"$id\",\"$name\",\"$comments\")")
or die('<b>Data Insert Error:</b> ' . mysql_error());
?>
<p>I added ID <b><?php echo $_POST['id']; ?></b> with Comment <b><?php echo $_POST['comments']; ?></b>.
Let's go back to <a href="index.php" target="_self">Main menu</a>!
<?php }
mysql_close($con1);
?>
i dont know why is that, but after I write something and push OK, i get 404 error...
adress bar of my browser looks like this after pushing OK:
- Code: Select all
http://localhost/web/admin/%3Cbr%20/%3E%3Cb%3ENotice%3C/b%3E:%20%20Undefined%20variable:%20PHP_SELF%20in%20%3Cb%3E/home/conta/web/admin/add.php%3C/b%3E%20on%20line%20%3Cb%3E5%3C/b%3E%3Cbr%20/%3E
with debian [some debian lamp, not xampp] i never get such a stuff, everything was working well
thanks for any ideas, i use latest xampp