Jump to content

Mudsaf

Members
  • Posts

    462
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Mudsaf

  1. Hello, i'm wondering do i need to escape $_SERVER['REMOTE_ADDR'] when selecting from MySQL database (Prevent SQL injections)? So can client modify his ip-address to attack the server?
  2. Well there is nothing @Warning or issue. So basically chrome tells that there is 14 warnings but the warning information area is empty.
  3. I'm just wondering does my website have bad code or chrome bugging.
  4. Alright, so when i tested W3schools javascript disabled i got html code coded with html_specialchars for example < > it looked like this. <div class='message error'> <strong>Javascript Disabled Detected</strong> <p>You currently have javascript disabled. Several functions may not work. Please re-enable javascript to access full functionality.</p> </div> <br />Toggle W3Schools With tags displaying.
  5. Hello, i'm wondering if there is reversed code for <noscript></noscript>, example if JavaScript is enabled add code there?
  6. Thanks for info, could you show me example of prepared mysqli_query with couple of $_POST elements?
  7. Hello, I've learned MySQL mostly and lately I've tried to change to MySQLi. I'm wondering how to insert data to database with preventing SQL injections? On MySQL i used stipslashes + mysql_real_escape_string Lets say if i have $_POST['uname'] and $_POST['upass'], which is best method to prevent SQL injections?mysqli_real_escape_string or prepared query? If prepared query could somebody show me example?
  8. Well as you know there is jQuery form plugin. If i don't have JavaScript enabled the page would display "Success" instead of whole website style. So i'm wondering is there possible to return a "small success" variable from the posted page to the page where its sent. No JavaScriptForm > Submit > Whole style & MessageJavaScriptForm > Submit > Message only atm = at the moment So basically what i'm searching here is i want to receive small variable or something from submit page so i can check what happened there without receiving full html code.
  9. Hello, i'm wondering which method i need to use tho get these values below working. 1 //This should return 11.2 //This should return 21.00001 //This should return 12.5 //This should return 33 //This should return 3 and so on, i guess you'll get my point. I've see that Math.round(); fixes it like decimal should work, but i want the number to go rounded to next higher number.
  10. Hello, i'm wondering atm if there is possibility to receive data from ajax or jQuery method without receiving full HTML page. Example if i use jQuery form plugin and submit data, i want to see if the post goes through correctly without any errors. Also i wan't to be user friendly if guest doesn't have JavaScript enabled the page works normally with all styles and other stuffs. Currently I've made blank PHP pages that writes data example "Success" and i check at JavaScript if the received html is "Success". Now i realized its very bad method to do that.jQuery form plugin http://malsup.com/jquery/form/
  11. Hello, I've graduated as programmer and i'd like to try making professional web-page. I want to know more about things listed below. How i can copyright my website legally. (Without company)Currently I've done this like here, i think its poor mans copyright tho.Copyright <published year>-<current year> by <myname>. All rights reserved (This is because i've used alot of libraries and i don't own them, but i have rights to use them).
  12. Mudsaf

    Shoutbox

    1) Well it seems like W3schools header is around same size as this topic header. (The logo is large tho, but its under developement atm)2) Well i know pure ajax would be better but i think php is way more secured and i know php and love to learn it more by developing shoutbox. I've tried to decrease the network usage much as possible per load so atm it uses 1/3 KB per refresh time if there is no new shouts. Also i need to reduce my code and make it lightweight as possible.3) I know there is no index.php or any other files, but its developement release, but i agree displaying website folders looks bad.
  13. I'm not quite following, so basically if i receive $_POST what was posted at INPUT form and lets say the input form name = test //Does it work like this & what ist he question mark at SQL sentence. Is it the first binded parameter?. if ($stmt = $mysqli->prepare("SELECT District FROM City WHERE Name=?")) {$stmt->bind_param("s", $_POST['test']);$stmt->execute();
  14. Hello, i'm wondering does MySQLi function.. mysqli_prepare() ..prevent SQL injections (check link) http://stackoverflow.com/questions/14011899/mysqli-real-escape-string-should-i-use-it
  15. Well another question, do you really see difference between PDO queries & MySQLi queries?
  16. So do you think that MySQLi might get removed in future because of PDO?
  17. Hello, i'm wondering that is there possibility to MySQLi extension get removed since there is PDO with way more Database supporting and only a little slower. Is the PDO new future of Database coding? If not why should i learn MySQLi instead of PDO straight away? MySQLi: http://php.net/manual/en/book.mysqli.php PDO: http://php.net/manual/en/book.pdo.php Reply what you think about this topic.
  18. Mudsaf

    PDO error reporting

    Hello, i've tried to learn bit PDO connections but i'm wondering how the error checking works. Example my code. $con->exec("INSERT INTO first_example (value) VALUES ('2')") or die("LOL"); So basically the code above works? Anyone have good tutorials for PDO & is it that hard to learn PDO if i can do MySQL?
  19. So PDO shall it be, thanks for reply.
  20. Hello, i'm just wondering is MySQLi much different than MySQL? I have basic knowledge of MySQL and it seemed pretty similar & easy. Example this <?php$con = mysqli_connect("<hostserver>","<user>","<pass>","<database>") or die("<error>");$result = $con->query("SELECT userName FROM <users>") or die("<query_failed>");while ($row = mysqli_fetch_array($result)) {echo $row['<username>'] . "<br>";}if (isset($con)) {mysqli_close($con) or die("<some random closing problems>");}?> PS: I know its improved extension of MySQL, but i wan't to know if there is major changes in code. Ah i even might consider PDO since alot of databases supports it, would you suggest that? http://net.tutsplus.com/tutorials/php/pdo-vs-mysqli-which-should-you-use/
  21. Your php.ini file prob have magic_quotes enabled. Edit your php.ini and disable it. magic_quotes_gpc = Off
  22. The right answer is plenty, below is alot listed but i'm 100% sure there is plenty of more. http://en.wikipedia.org/wiki/List_of_programming_languages
  23. I found tutorial for style, but didin't find method to remove ID and CLASS attributes. preg_replace('/style=(["'])[^1]*?1/i', '', $item, -1);
×
×
  • Create New...