Jump to content

Skewled

Members
  • Posts

    387
  • Joined

  • Last visited

Everything posted by Skewled

  1. Awesome work! It's working as intended a new line for each answer is inserted. You can then filter answers in a query to display the output... $query = "SELECT answer FROM answertable WHERE answer_id =....? ORDER BY answerdate ASC LIMIT 20"; Just use your table structures in the query, and you'd have to perform a join. Double check the ASC not sure if that's the ascending one lol
  2. add them back: <section> <article> </section> </article> It's a CSS issue, maybe post in the CSS help forum for some guru to see and give a quick fix to it.
  3. Your most welcome, that is certainly one odd situation.
  4. remove the <article> </article> <section> </section> tags completely. I want to see what it looks like without those..
  5. This is how I do it to keep my code structured and then I can globally change the links in 1 file rather then multiple page edits. As for the CSS, if your using firefox you can get the addon called firebug and visually inspect the elements. This is what I'm using to see your CSS...
  6. <?php include("../my_site/navigation.php"); ?> Give that a try.. windows or linux based server? They like to use different structures, it's been awhile since I messed with this....
  7. $query = mysql_query("INSERT INTO discussion `answer` VALUES ('".$answer."')"); Your only inserting the answer and nothing more.. what is your table layout for the question/answer setup. What keys are you using to tie them together? Example: QuestionTable | AnswerTable id - auto inc - primary index -- same question answer datesubmit datesubmit submit_by submit_by question_id_key answer_id_key Then question_id_key and answer_id_key could pair the tables together in a join to retrieve information.
  8. Just make sure you are validating it on the server side and not all in JavaScript and all sounds swell from what you posted.
  9. That's excellent, go to the main php help forum here and read the HEADERS post and you'll see what your doing wrong.. it's explained really well there in that post.
  10. That's why I wanted to see what the variable data was, it may not be sending the '/' properly or something along those lines.. I seen your aggravation and that's why I'm jumping in to see if we can brainstorm together. Since the scripts work if used independent of each other and the only difference is now they are combined, then the variable has to be part of the issue. Separate the scripts again and have the first script send the variable from a form to the 2nd script and see if that works.
  11. <article> <? /** * User has already logged in, so display relavent links, including * a link to the admin center if the user is an administrator. */ if($session->logged_in){ echo '<h1><img src="images/lock_unlocked.png" width="32" height="32">Logged In</h1>'; echo "<table width='600' cellpadding='5' cellspacing='5' border='1'>"; echo "<p>Welcome <b>$session->username</b></p> <br/><br/>" ."<tr><td>[<a href=\"userinfo.php?user=$session->username\">My Account</a>]</td></tr>" ."<tr><td>[<a href=\"useredit.php\">Edit Account</a>]</td></tr>"; if($session->isAdmin()){ echo "<tr><td>[<a href=\"admin/admin.php\">Admin Center</a>]</td></tr>"; echo "<tr><td>[<a href=\"../gastenboek/admin/index.php\">Gastenboek</a>]</td></tr>"; echo "<tr><td>[<a href=\"../livre d'or/admin/index.php\">livre d'or</a>]</td></tr>"; echo "<tr><td>[<a href=\"../upload/upload.form.php\">upload</a>]</td></tr>"; } echo "<tr><td>[<a href=\"process.php\">Logout</a>]</td></tr>"; } else{ ?> </article> Wrap that in <article> </article> so it will be considered an article as opposed to just sitting on the page. The reason it was an error before is because I did it within the <? ?> php tags... Shouldn't give you an error this time and should hopefully render the page properly.
  12. For the site at this moment it's a CSS issue and I have to run for now, but the <article> and <section> CSS are empty because the login form is no longer required when you log in so something has to fill the void to move the other elements back in place. I'll see what I can do when I get back home in a few hours, but I encourage you to tweak the CSS portion and possibly make sure the <section> and <article> areas have content, then it should all adjust properly and fit in place.
  13. The CSS is all that's left to work on, I need to look at the code again.. give me a minute..
  14. I don't have the script up anymore, but you can adjust the CSS for that and give it a different pointer.. See if a CSS novice in the CSS forum can give you info on that cheers mate!
  15. echo "<tr><td>[<a href=\"process.php\">Logout</a>]</td></tr>"; } </article> else{ ?> add </section> above article and give that a go. If you get the error then you have to remove both </section> and </article> that have been added. I know the issue is with the div for that content, just need to think it through to correct the layout now..
  16. $query="SELECT * FROM '" . $row['cat'] . "' WHERE user_id= '" . $row['user_id'] . "'"; $data = mysqli_query($dbc, $query) or die("Error: ".mysqli_error($dbc)); What values are getting passed to $row['cat'] and $row['user_id']? The quotes look fine to me.. Also, where is the query giving the values to the 2 $row statements?
  17. I didn't add any php tags, I noticed the } ending bracket for the if / else loop was not in the right place. The issue now is that the <article> tag is not ending where it needs to and causing the page to shift down, and those links to be displayed at the bottom of the page. So I added a </article> closing tag after those links to cut it off. Give this new one a go and hopefully it will resolve your issue... This is some very sloppy code and I'm glad you didn't buy it! HTML, CSS, and PHP should all be separated and written cleanly. That's what I mean when I say sloppy code, as you can see this isn't how this code is written. <? include("include/session.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>Mc Bevers home</title> <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen"/> <!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]--> <!--<link rel="stylesheet" type="text/css" href="css/styles.css" />--> <!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" src="script.js"></script>--> </head> <body> <div id="wrapper"> <nav> <ul class="lang"> <li><a href="../indexnl.html" class="nl">Nl</a></li> <li class="last"><a href="../indexfr.html" class="fr">Fr</a></li> </ul> <ul class="menu"> <li><a class="active" title="home" href="../indexnl.html">Home</a></li> <li><a title="Leden" href="../ledennlp1.html">Leden</a></li> <li><a title="Album" href="../albumnl.html">Album</a></li> <li><a title="Kalender" href="../kalendernl.html">Kalender</a></li> <li><a title="Contact" href="../contactnl.html">Contact</a></li> </ul> </nav> <header> <h1><a title="html5 template" href="../index.html">Mc Bevers</a></h1> </header> <section id="main" class="clearfix"> <section id="content"> <article> <? /** * User has already logged in, so display relavent links, including * a link to the admin center if the user is an administrator. */ if($session->logged_in){ echo '<h1><img src="images/lock_unlocked.png" width="32" height="32">Logged In</h1>'; echo "<table width='600' cellpadding='5' cellspacing='5' border='1'>"; echo "<p>Welcome <b>$session->username</b></p> <br/><br/>" ."<tr><td>[<a href=\"userinfo.php?user=$session->username\">My Account</a>]</td></tr>" ."<tr><td>[<a href=\"useredit.php\">Edit Account</a>]</td></tr>"; if($session->isAdmin()){ echo "<tr><td>[<a href=\"admin/admin.php\">Admin Center</a>]</td></tr>"; echo "<tr><td>[<a href=\"../gastenboek/admin/index.php\">Gastenboek</a>]</td></tr>"; echo "<tr><td>[<a href=\"../livre d'or/admin/index.php\">livre d'or</a>]</td></tr>"; echo "<tr><td>[<a href=\"../upload/upload.form.php\">upload</a>]</td></tr>"; } echo "<tr><td>[<a href=\"process.php\">Logout</a>]</td></tr>"; } </article> else{ ?> <? /** * User not logged in, display the login form. * If user has already tried to login, but errors were * found, display the total number of errors. * If errors occurred, they will be displayed. */ if($form->num_errors > 0){ echo "<p><font size=\"2\">".$form->num_errors." error(s) found</font></p>"; } ?> <section id="form1"> <h3>Login</h3> <form action="process.php" method="post"> <p><label>Gebruikers naam</label></p> <input type="text" name="user" maxlength="30" value="<? echo $form->value("user"); ?>"><? echo $form->error("user"); ?> <p><label>Wachtwoord</label></p> <input type="password" name="pass" maxlength="30" value="<? echo $form->value("pass"); ?>"><? echo $form->error("pass"); ?> <p><label>Onthoud mij </label><input type="checkbox" name="remember" <? if($form->value("remember") != ""){ echo "checked"; } ?>> <input type="hidden" name="sublogin" value="1"> <p><input type="submit" value="Login"></p> <!--<font size="2">[<a href="forgotpass.php">Wachtwoord vergeten?</a>]</font> <p>Nog niet geregistreerd? <a href="register.php">Aanmelden!</a></p>--> </form> </section> </article> </section> <? } ?> <aside id="sidebar"> <h3>Links</h3> <ul class="clearfix"> <li><a title="Home" href="../indexnl.html">Home</a></li> <li><a title="Leden" href="../ledennlp1.html">Leden</a></li> <li><a title="Album" href="../albumnl.html">Album</a></li> <li><a title="Kalender" href="../kalendernl.html">Kalender</a></li> <li><a title="Contact" href="../contactnl.html">Contact</a></li> </ul> <h3></h3> <ul class="clearfix"> <!--<li><a title="twitter" href="index.html">Twitter</a></li>--> <li><a title="Inschrijven" href="../inschrijvennl.html">Inschrijven</a></li> <li><a title="Gastenboek" href="gastenboek/guestbook.php">Gastenboek</a></li> <li><a title="Facebook" href="http://www.facebook.com/profile.php?id=100003840519242&ref=tn_tnmn#" class="new_window">Facebook</a></li> </ul> </aside> </section> <footer> <section id="footertop"> <aside class="footer-column"> <h4>Info</h4> Html5 en css3 beste resultaat in google chrome. </aside> <aside class="footer-column"> <h4>Mc bevers</h4> <address> <span>Postcode:</span>1547<br/> <span>Land:</span>Belgie<br/> <span>Plaats:</span>Bever<br/> <!--<span>Telefoon 1:</span>0<br/> <span>Telefoon 2:</span>0<br/> <span>Fax:</span>0<br/>--> <span>Email:</span><a href="mailto:[email protected]">[email protected]</a> </address> </aside> </section> <!--<section id="copyright"> <h4>Copyright</h4> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta.</p> </section>--> <section id="banners"> <ul class="banners"> <li><span><span><span><img src="../images/icon1.gif" alt="sponsor"><strong>Sponsor</strong>Sponsor worden?<a href="../contactnl.html" class="new_window"><br/>Klik hier</a></span></span></span></li> <li><span><span><span><img src="../images/icon2.gif" alt="sponsor"><strong>Sponsor</strong>Sponsor worden?<a href="../contactnl.html" class="new_window"><br/>Klik hier</a></span></span></span></li> <li class="last"><span><span><span><img src="../images/icon3.gif" alt="sponsor"><strong>Sponsor</strong>Sponsor worden?<a href="../contactnl.html" class="new_window"><br/>Klik hier</a></span></span></span></li> </ul> </section> <br> <section id="templatecopy"> <p>Edited by DeWezze</p> <p>Template design by <a title="derby web design" href="http://www.tristarwebdesign.co.uk">tristar web design</a></p> </section> <? /** * Just a little page footer, tells how many registered members * there are, how many users currently logged in and viewing site, * and how many guests viewing site. Active users are displayed, * with link to their user information. */ echo "<center><b>Member Total:</b>".$database->getNumMembers()."<br/></center>"; echo "<center>There are $database->num_active_users registered members and "; echo "$database->num_active_guests guests viewing the site.</center>"; include("login/include/view_active.php"); ?> </footer> </div> </body> </html>
  18. That is the only way I know to make sure no naughty pictures are uploaded for a profile, outside of that maybe some advanced image detector could be coded to analyze the image for those naughty parts.. but that's way beyond me lol!
  19. I sent him a PM, but yes that's what you'd have to do..
  20. Yes you could store them in a database and use php to display them. I also sent you a PM with your other issue...
  21. Yes you have to click accept mark as solved please... have a great day! Now you can further it by moving the div for that statement where you want in your CSS, but post that in the CSS help forum lol!
  22. You just need to write a conditional statement on the output to filter that... I'm not sure you can do that in the query itself.
  23. That's how it works! Just make sure no output is done before the redirect, and that pesky error will go away and you should be well on your way to sending registration e-mails. The script for the site is sensitive in nature? I understand that completely! Let me know if it works out!
  24. The first one will display every time a user comes to the website. The 2nd one will display only once and store a cookie with the user's choice. Neither of them that I see use a landing page. If you want to do that you'd just have to redirect to the page depending on what the user chooses. If you test the 2nd one you have to clear your browser cache to test again or you won't see a pop up again once the cookie is stored.
  25. Yes, headers have to be sent before any output is displayed to the browser!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.