Jump to content

manix

Members
  • Posts

    219
  • Joined

  • Last visited

    Never

Everything posted by manix

  1. Hello, What I have is a simple registration form where in the username field I have a onkeypress event (onkeyup actually) which sends an ajax request to check if the name is already taken, but my problem is that from the external script I can only like display a text below or sth saying it's already taken, what I want to do is paint the field red and I can't figure out how to do it...
  2. Indeed is. Thank you!
  3. wow the error was that I am using single quotes in the anchor tag.. but even if a user uses single quotes in his comment this is still going to return the error.. how do I allow single quotes in the record O.o
  4. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'viewprofile.php?user=Manix'>Manix: TEST ' WHERE `username`='Manix'' at line 1 still can't find it >.< I guess it's something wrong with this tho: $wall = "<p><a href='viewprofile.php?user=$username'>$username</a>: $comment</p>".$wall;
  5. I have this update syntax that doesn't wanna run and I'm getting pretty mad over it... the field "wall" is of type LONGTEXT if it makes any difference mysql_query("INSERT INTO users (`username`) VALUES ('dgd')"); // I added this line to check if the problem was with the db connection or something and it runs just fine, inserts the data and all .. mysql_query("UPDATE `users` SET `wall`= '$wall' WHERE `username`='Manix'"); // This is the mf troubling me >.< echo "<blockquote>$wall</blockquote>"; // this is where I echo the result from the ajax request which is also working perfectly fine ...
  6. manix

    Encoding ..

    that was useful to know, thank you requinix!
  7. manix

    Classes

    Those were exactly the answers I needed, thank you.
  8. manix

    Classes

    Erm.. Okay but what's the point of grouping objects when you can simply not ? It's getting so complicated I don't get the point of classes O.o
  9. manix

    Encoding ..

    Hey.. I want to have this specific character in my website ▼which is from the Unicode charset, in my editor (notepad++) I'm using ANSI encoding and I can not paste the character, if I change the encoding to UTF-8 my site ruins because I'm also using <meta http-equiv="content-type" content="text/html; charset=windows-1251" /> I guess... SO my question is how can I have this >> ▼ << character in my website :?
  10. manix

    Classes

    Hey, Since I haven't been practicing any other programming languages before (except pascal but there I used no classes and VB where the classes were automatically declared) now I've come across classes in PHP and I am not really aware of their purpose and what they're supposed to do.. I tried googling it but I couldn't find any good article about it, if someone could provide me one I'd be really greatful, thanks!
  11. omg are you kidding me ? it was that easy ?? O.O no comment....................... Thank you !
  12. Okay, that's a little confusing - say there's a user input commenting on some stuff and I need it to be displayed exactly the way the user input it, but I also need to be able to run some tags I'm adding/modifying later on to the same string Let me give you a simple example: let's say a user's comment contains "some text and <some tags> AND some of my encoding tags like *b*this*/b*" Okay so this string is supposed to output "some text and <some tags> AND some of my encoding tags like this" You get my point? if I decode the *b*'s into <strong></strong> then using htmlspecialchars() will display my tag too instead of running it - what I am aiming to do ... and using strip_tags() allowing <strong> will allow the user to input it too I hope someone can help me out with this one cuz I've been struggling with it for 2 days >.< Thank you in advance!
  13. manix

    LIMIT

    yeah it's Limit(start,number of records) I thought it was LIMIT(start,end) .... >.<
  14. manix

    LIMIT

    I'm creating a simple pagination where it's supposed to show me 10 records per page from the database and in order to do that I'm using the LIMIT function but it's not working right It's working for the fist page tho, here's the code: // FIRST PAGE $query = "SELECT id, header, story, datetime, author, reported, comments FROM stories WHERE `type`='1' ORDER BY id DESC"; $result = mysql_query($query." LIMIT 0,10"); while($row = mysql_fetch_assoc($result)) { ... $pages=2; // just for temp testing for ($i=1; $i<=$pages; $i++){ $result = mysql_query($query." LIMIT ".($i*10).",".($i*10+10)); while($row = mysql_fetch_assoc($result)) { and it's working but it's showing me 12 or 13 or even more records on the second page ... why ? omg I just checked the syntax and realized what input 2 is ... >.< sorry for the spam
  15. I didn't really know where to post this so I'm posting it here cuz this section has the most readers... I was talking to a buddy of mine a couple of days ago about how my website is looking perfectly good in CHROME and MOZILLA but is ruined in IE safari and others I suppose (haven't quite tested further) and he told me about some program that I didn't quite understand him but I guess it converts the code so all browsers can read it or something like that... Or if there's another way of achieving my goal, all help will be appreciated.
  16. manix

    site width

    I'm guessing this is a CSS related problem.. I have a 22" monitor and I'm using 1680x1050 resolution and I can see how all websites have the same width which is around 1024 and everything the site holds is within this width, I wanna ask how do I achieve it ?
  17. Ermm Okay.. What I now have is this <script type="javascript"> fsearch(){ if (event.keyCode==13){ window.location = "blank.php?search="+document.getElementById('search').value; } } </script> <input id="search" type="text" value=" Search .." onkeydown="fsearch()"/> but it's still not redirecting me, it's just reloading the current page :s
  18. sheesh ... thank you !
  19. Hey, I first thought that was an HTML issue so I posted in the HTML section but now when I actually think about it, it's a PHP one and I tried to move the thread but didn't find a way how so if a moderator could just delete the other thread So what's really bothering me is that for example I have a certain number of comments of something (say a photo) in my database and when I retrieve them I am echo-ing them in a table, but if a comment contains some html tags they are being ran by the browser. How can I have them displayed as they are in the string ?
  20. Heya, I'm trying to create an input field that's supposed to redirect me to a page, with a variable the value of the input, when I press enter, but I'm failing.. <input id="search" type="text" value=" search .." onkeypress="if(window.event && window.event.keyCode == 13) {window.location = 'blank.php?search='+document.getElementById('search').value;}" />
  21. Hey, I just made my first attempt to use AJAX to post comments and return them immediately but I failed as expected. So I'm posting the codes if someone can tell me where I did wrong? <script language="javascript" type="text/javascript"> <!-- function ajaxFunction(){ var ajaxRequest; try{ // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser broke!"); return false; } } } // Create a function that will receive data sent from the server ajaxRequest.onreadystatechange = function(){ if(ajaxRequest.readyState == 4){ var ajaxDisplay = document.getElementById('newcomment'); ajaxDisplay.innerHTML = ajaxRequest.responseText; document.addcomment.time.value = ajaxRequest.responseText; } } var comment = document.getElementById('comment').value; var id = document.getElementById('id').value; var queryString = "?id=" + id + "comment=" + comment; ajaxRequest.open("GET", "addcomment.php" + queryString, true); ajaxRequest.send(); } //--> </script> addcomment.php <?php $id = $_GET['id']; $comment = $_GET['comment']; $datetime = date('H:i:s ')." ".date('d / F / Y'); $id = mysql_real_escape_string($id); $comment = mysql_real_escape_string($comment); include 'condb.php'; mysql_query("INSERT INTO comments (commentid, comment, datetime) VALUES('$id', '$comment', '$datetime')") or die(mysql_error()); mysql_close(); $display_string = $comment; echo $display_string; ?> and here's the div in the main file: echo "<div id='newcomment'>Da</div>"; echo "<br><br><br><table><tr><td> <form id='b' name='addcomment'> <div align='center'>Cpodeli swoeTo mHeHue<br> <textarea id='comment' rows='5' cols='60' maxlength='255' onKeyPress='check_length(this.form)'; onKeyDown='check_length(this.form)'></textarea><br></div> <input value='$id' id='id' type='hidden'/> <input size='1' value='255' id='chars' readonly='readonly' style='float:left'/> <input id='dobavi' type='button' value='Dobawi Mnenie' onclick='ajaxFunction()' style='float:right'/> </form></td></tr></table>"; EDIT: I somehow managed to fix it... Didn't even understand what I did but it worked lol..
  22. manix

    #

    call me stupid but I didn't really get it.. What ID? like in <div id='blabla'> ? EDIT: Oh I think I get it, if I have an element with the id mentioned in the link after the # the page will scroll down to that element, is that it? EDIT2: Great I just tested it, thanks for the reply!
  23. manix

    #

    I've seen this "#" in php links and I wondered what does it do. Is it the same as "&" :? I tried googling it first but I couldn't find an answer.
  24. manix

    Custom Font

    @font-face { font-family: "Fonta"; src: url(Fonta.ttf); } a.navmenu:link,a.navmenu:visited { font-family: Fonta; ... } <li><a class="navmenu" href="home.php">Начало</a></li> and it worked perfectly with the first font I used (placed the 'Fonta.ttf' in the htdocs) and then I downloaded another one and just replaced the old one and it's not working anymore.. ps. the font has cyrillic characters if that's what you're thinking the problem is
×
×
  • 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.