Ja jeg har et problem når jeg skal poste et reply på min side:
her er koden for hele siden:
- <?php
- session_start();
- ?>
-
-
-
- <html>
-
- <body>
-
-
-
- <link rel="stylesheet" type="text/css" href="http://www.jkay.dk/Layout.css">
-
- <?php
- if(isset($_SESSION['myusername'], $_SESSION['mypassword'])) {
- ?>
-
- <?php
- $bsername = $_SESSION['myusername'];
- ?>
-
- <div class="loginas">
- Logget ind som:
- <?php
- echo "$bsername";
- ?>
-
- <div class="logout"><a href="http://www.jkay.dk/logout.php">Log ud</a></div></div><br><br><br>
-
-
-
-
-
-
-
- <?php
-
- }else{
-
- ?>
-
- <div class =logint>
- <form name="form1" method="post" action="http://www.jkay.dk/checklogin.php">
-
-
- <strong>Member Login </strong><br>
-
- Brugernavn: <input name="myusername" type="text"><br>
- Brugerkode: <input name="mypassword" type="password"><br>
-
-
-
- <input type="submit" name="Submit" value="Login"><br>
- <a href="http://www.jkay.dk/opret.html">Create an account</a>
-
- </form>
- </div>
-
-
-
- <?php
- }
-
- ?>
- <div class="menu">
-
- <div class="menutekst">
- <a href="http://www.jkay.dk/">Forside</a> <a href="#">Andet</a> <a href="http://www.jkay.dk/forum/index.php">Forum</a> <a href="#####">Kontakt</a>
- </div>
- </div>
- <br><br>
- <?php
-
- if(isset($_SESSION['myusername'], $_SESSION['mypassword'])){
-
- include ".php"; //connection string
-
-
- print "<table class='maintables'>";
-
-
- print "<tr class='maintables'><td>";
-
- if(isset($_POST['submit']))
-
- {
-
- $name=$bsername;
-
- $yourpost=$_POST['yourpost'];
-
- $subject=$_POST['subject'];
-
- $id=$_POST['id'];
-
- if(strlen($yourpost)<1)
-
- {
-
- print "Du skrev ingen ting"; //no post entered
-
- }
-
- else
-
- {
-
-
- $iid = $_SESSION['usid'];
- mysql_query("UPDATE members SET userpoint = userpoint+1 WHERE usid = " . $iid . "");
-
- $thedate=date("U"); //get unix timestamp
-
- $displaytime=date("F j, Y, g:i ");
-
- //we now strip HTML injections
-
- $subject=strip_tags($subject);
-
-
- $yourpost=strip_tags($yourpost);
-
- $insertpost="INSERT INTO forumtutorial_posts(author,title,post,showtime,realtime,lastposter,parentid) values('$name','$subject','$yourpost','$displaytime','$thedate','$name','$id')";
-
- mysql_query($insertpost) or die("Could not insert post"); //insert post
-
- $updatepost="Update forumtutorial_posts set numreplies=numreplies+'1', lastposter='$name',showtime='$displaytime', lastrepliedto='$thedate' where postid='$id'";
-
- mysql_query($updatepost) or die("Could not update post");
-
-
-
-
-
-
-
- print "Message posted, go back to <A href='message.php?id=$id'>Message</a>.";
-
- }
-
-
-
- }
-
- else
-
- {
-
-
- $id=$_GET['id'];
-
- print "<form action='reply.php' method='post'>";
-
- print "<input type='hidden' name='id' value='$id'>";
-
-
-
- print "Dit svar:<br>";
-
- print "<textarea name='yourpost' rows='5' cols='40'></textarea><br>";
-
- print "<input type='submit' name='submit' value='submit'></form>";
-
-
-
- }
-
- print "</td></tr></table>";
-
- }
- else {
- print "<center><h3>Du skal være Logget ind for at bruge forummet</h3></center>";
- }
- ?>
-
- </body>
-
-
-
- </html>
jeg ved simpelthen ikke hvor fejlen er i det, har prøvet ca. 40 forskellige ting, men ingen virkede
håber nogen kan hjælpe..
PS: fejlen er i linje 126/127 der omkring
1000 tak på forhånd
Indlæg senest redigeret d. 20.07.2009 18:34 af Bruger #14510