Jump to content

SamohtVII

Members
  • Posts

    55
  • Joined

  • Last visited

Everything posted by SamohtVII

  1. Ah ok so at the top of the page. Works fine now thanks.
  2. Hi all, I have a problem when i try and use my login area. It works fine on my local machine but when i upload it to my website i get this error: Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/pol77704/public_html/HoN/index.php:9) in /home/pol77704/public_html/HoN/index.php on line 13Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/pol77704/public_html/HoN/index.php:9) in /home/pol77704/public_html/HoN/index.php on line 13 here are the first 20 or so lines of index.php. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>HoN</title><link href="styles.css" rel="stylesheet" type="text/css" /> <link rel="shortcut icon" href="images/favicon.ico" /></head> <div id="container"> <div id="topBar"> <div id="login"> <?php session_start(); if($_SESSION['username']) { ?> <div id="welcome"> <?php echo "Welcome, ".$_SESSION['username']."!"; ?> <a href="logout.php">logout</a> </div> <?php } else { ?> <form method="post" action="login.php" id="login"> <input id="username" type="text" name="username" placeholder="username"> <input id="password" type="password" name="password" placeholder="password"> <input type="submit" value="Log in" class="submitButton"> </form> <form method="post" action="register.php" id="register"> <input type="submit" value="Register" class="submitButton"> </form> <?php } ?> </div> anyway I have no idea whats the problem as i am quite new to this. Let me know if you need more info.Thanks
  3. I am embedding videos from youtube and making them small 100x100 on my page. They are too small to view as is so i want it to when you click in the iframe it lets just say takes you to video.html (for no reason). So things that i've tried are like <a href><iframe></iframe></a> clicks straight through and starts the video.Tried onclick in the div same result. maybe there is an easy way i don't know. Thanks Nevermind found this: http://www.jesseharding.com/blog/2010/12/29/use-a-youtube-video-thumbnail-image-in-your-html/
  4. I am looking to have text in my login forms like this page: http://www.hontour.com/index/ but I can't get it to say password it will just bring up the **** instead. I have got the username kind of working but I want it to clear whenever someone clicks into it as well. <i>Username: </i><input id="username" type="text" name="username" onfocus="if(this.value == '') { this.value = ''; }" value="Username"> <i>Password: </i><input id="password" type="password" name="password" value="password">
  5. I have a content area that has 'stuff' in it and a footer below that and it all aligns nicely. I want to add a second content bit next to an existing one so there are side by side columns in the content area. I can do this with float and they align next to each other but it brings the footer all the way up and overlays the two. Is there a way to keep the footer to appear after all the content. Thanks <div id="content"> <div id="news"> <p1>Latest Headlines</p1><br /> <h1>HON TOUR CYCLE 8 DIAMOND LBR3 - SG VS LION GAME 1</h1> </div> <div id="sidebar"> <p1>Latest Headlines</p1><br /> </div> </div> Thanks
  6. That is nice but I forgot to mention that the form submits to an sql table. And when I print the data out it gives me the <p> and <b> etc. Is there someone I can format when i SELECT the data from a database?Just asking so not drama if it requires a lot of effort.ty
  7. SamohtVII

    textarea format

    Is there an alternative to 'textarea' that will keep simple formatting like new lines?Also how can i make a text area have spell check? thanks
  8. I was wondering how timestamps are written to integers and how I can extract the date from it so I can compare it with a date of my own. Basically I have a INT field in my database and it gets a timestamp put into it. How can I compare that timestamp to say a week later.So I have the timestamp 1365409603 which somehow equals the 8th of april 2013. How can I add seven days to this number and store that ina variable then say (if timestamp is 7 seven days away from variableTime) etc. Hope it wasn't too confusing.Thanks
  9. Yeah all good now. Thanks heaps for all the help.
  10. Ok. All I want the script to do is refresh the page. Is there a way i can tell the form to send it to comments.php i.e. action="comment.php" then have the submit button refresh the page? So it doesn't go through the script to send the data to the comment.php page. If not I have little to no idea how I would go about doing what you described. Ok here's what i got baring it's all possible to do in html. Stop me if it's nonsense. is it possible to say id=idfunction() or better yet id=<?php echo htmlentities($row['ID']);?>;If i can set the id to just the ID number they will all be unique. Then i can start at 1 and go through numbers until I hit that ID number then process that id's form? Thanks for the help. I'm so close yet so far.
  11. Ok so it works fine without it going through to refresh the page so now I need to know how I can get it to refresh the page and not screw with my comments section. Thanks
  12. I also forgot to mention which might be important is this.... : <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script><script type="text/javascript" >$(function() {$(".submit").click(function() {var formid = $("#formid").val();var name = $("#name").val();var comment = $("#comment").val();var dataString = 'formid=' + formid + '&name=' + name + '&comment=' + comment;if(formid=='' || name=='' || comment==''){ $('.success').fadeOut(200).hide(); $('.error').fadeOut(200).show();}else{ $.ajax({ type: "POST", url: "comment.php", data: dataString, success: function(){ $('.success').fadeIn(200).show(); $('.error').fadeOut(200).hide(); location.reload(true);}});}return false;});});</script> Just so it refreshes the page on a post. So all the submit buttons have the same id etc.
  13. My form seems to be properly opened and closed and I do have an ID to link posts with comments: <textarea id="formid" name="formid" hidden="true"><?php echo htmlentities($row['ID']);?></textarea> That's how I found out about the problem. it will post just the ID to the table and no data. And it's always the last ID to be printed i.e. COMMENT AREA 1.I thought it might not be possible to loop a form with php but if you say it is then that's weird.
  14. Ok so I have a php script that gets all posts a user has created and prints them out. After each post is printed it has a form underneath to add a comment. This forms gets printed for all posts and it seems it can't differentiate between each. No matter what submit button i press it always wants to use the data, usually empty, that the last printed form has in it. Is there any way I can get a specific form to print out the data it has in it.Maybe there is a better way to do it but this is so close to working for me. so it would be [COMMENT AREA 1] [COMMENT AREA 2] <---comment: "this is a comment"------but would submit COMMENT AREA 1's data i.e. nothing [COMMENT AREA 3] <?php /*print postswhile more posts{ */ ?><div id="commentID"> <form method="post" name="form"> <i>Name: </i><input id="name" type="text" name="name"> <i>Comment: </i><input id="comment" type="text" name="comment" size="50"> <input type="submit" value="Submit" class="submit"> </form> <div id="commentArea"><?php /*Print comments*/ ?><?php}?> ps: I have being doing php and this kind of stuff for a few weeks now so speak slowly. THanks
  15. I am trying to get an ID from one table and use it to search another table.So I have one query traversing a table: $sql = "SELECT * FROM `posts` ORDER BY `date` DESC"; How can i set the ID of the posts table to a variable and then say: $sql2 = "SELECT * FROM `comments` WHERE ID = IDVARIABLE"; Thanks
  16. SamohtVII

    update sql table

    I have a form that I want to insert values to update a table but all it does is delete all the data in the field.Also while I'm here how do you make it so when you submit a post to say insert.php it doesn't open a new page it just updates and stays on the same page. Mine at the moment goes to a new page that says '1 record added' <?php$con=mysql_connect('localhost','root','Wqqgdvo1');// Check connectionif (!$con) { echo "Failed to connect to MySQL: " . mysql_error(); }mysql_select_db("tutorials_blog2", $con);$one=$_POST['one'];$sql="UPDATE ladderSET first=('$one')";if (!mysql_query($sql, $con)) { die('Error: ' . mysql_error()); }echo "1 record added";mysql_close($con);?> form: <form action="insertLadder.php" method="postLadder"><p><label class="field">1st:</label><input type="text" name="one"></p><p><input type="submit"></p></form>
  17. basically outside the website you all select who will win in the round and then add those scores up and input them intop the webpage and it sorts the players scores until the end of the season.Right now I am using a sql table which seems to be going alright so hopefully I can get it to work out for me.
  18. I have a form like any other and I want my last form box to be much bigger (height) then the others but whenever i change the css height it just makes it look bigger and has the text run in the middle along like the others. I want it to start at the top and work down each line until the box is full. Kinda like when you make a post here on the forums. The topic is one line, the topic tags field is one line then the body (here) is large and i can type along and fill it up. Thanks
  19. So me and some friends were looking to creating a tipping ladder for AFL (Australian Rules Football).What would i need to look into to create a ladder where we can input our weekly results and it will display the order from highest to lowest.Is this just javascript? A point in the right direction would be greatly appreciated. ty
  20. Thanks mate. Can't believe I missed such an easy mistake. Works fine now...
  21. Thanks for the correction but my problem still happens . Any other suggestions?
×
×
  • Create New...