Jump to content

UnknownPlayer

Members
  • Posts

    269
  • Joined

  • Last visited

    Never

Everything posted by UnknownPlayer

  1. In db is like: \" but on my localhost server this thing works fine, but on webserver it doesnt, it shows \". I tested, i put echo mysql_real_escape_string($_POST['opis']); on page that insert data, and it echo \r\n\\\" What is problem ?
  2. I removed tinymce, just left: - when insert mysql_real_escape_string() - when echo htmlentities but when there is char " it show like "\ how can i fix that?
  3. Hi, i insert in db with mysql_real_escape_string() function, but when i read i use this: - htmlentities(stripslashes($value), ENT_QUOTES, "UTF-8") - for all fields but no textarea - stripslashes($value) - for textarea, becouse when insert that textare, its tinymce, and have html tags Is this right way ?
  4. Example: i have these categories(table categories): - Cars (id = 1, sub_cat_id = 0) - IT (id = 2, sub_cat_id = 0) - Other (id = 3, sub_cat_id = 0) sub_cat_id is 0, becouse these are parent categories And in "Cars" category i have these sub cats(table categories): - Mercedes (id = 10, sub_cat_id = 1) - BMW (id = 11, sub_cat_id = 1) - VW (id = 12, sub_cat_id = 1) - BMW (id = 11, sub_cat_id = 1) sub_cat_id is 1, becouse these are child categories of category "Cars" (id = 1) And articles are(table articles): - c200 (id = 1, cat_id = 10) - e200 (id = 2, cat_id = 10) - s500 (id = 3, cat_id = 10) cat_id is 10, becouse "Mercedes" cat id is 10(child category) in table categories. Now i need to select all articles from parent category "Cars" (id = 1) Can someone help me ?
  5. I have categories and sub-categories, related with sub_cat 0(parent) or with cat id(sub-cat), now articles are in sub-cats, cant be in parent cat, now i need to select all articles from parent category,that means to select from all sub-cats of that parent categorie. And articles are related with sub-cats. Can someone help me ?
  6. Hi, i have 2 currencies in my mysql and when user add new article, he choose currency and price. Now i need search engine for searching articles, and i have problem in part when user choose to show only articles between 100 and 200 euros, so i need help to convert all currencies to euro(all in mysql query) and show from 100 to 200 dollars, so if article price is 100 euros, then to show it too. Can someone help me ? 1 euro = 0.70 $ (example for values)
  7. I have function for add or change parametre in utl(GET), but when i use seo url and mu url goes like this: www.example.com/article/2 and when i click on pagination button where is that function for add or change, i get this url: www.example.com/article.php?id=2&page=2 but i need to url be like this: www.example.com/article/2?page=2 What should i change in this function: function add_or_change_parameter($parameter, $value) { $params = array(); $output = "?"; $firproun = true; foreach ($_GET as $key=>$val) { if ($key != $parameter) { if (!$firproun) { $output .= "&"; } else { $firproun = false; } $output .= $key."=".urlencode($val); } } if (!$firproun) { $output .= "&"; } $output .= $parameter."=".urlencode($value); return htmlentities($output); } ? Thanks..
  8. I have this code: new AjaxUpload($('#upload-slike'), { action: SITE_URL+'sources/upload_sliku.php', name: 'uploadfile', maxlength: '2', onSubmit: function(file, ext){ if (! (ext && /^(jpg|png|jpeg|gif)$/.test(ext))){ $('#status').text('Only JPG, PNG or GIF files are allowed'); return false; } $('#status').html('<img src="'+SITE_URL+'images/loading.gif" />'); }, onComplete: function(file, response){ $('#status').text(''); if(response==="success"){ $('#slike').append('<li><a href="'+SITE_URL+'slike/'+file+'">'+file+'</a></li>'); } else{ $('#slike').append('Nije dodata').addClass('upozorenje'); } } }); Now i need to set limit only for 5 images tobe uploaded, how can i do that ? In attachment is js file.. [attachment deleted by admin]
  9. So, what would u suggest me with these fields: - name of article - description (tinymce) - date(numbers) - phone number this can insert any registred user.. What should i use for insert, select and output on page ?
  10. I can use strip_tags and mysql_real_escape_string for inserting, and for output i dont need to use any function ? It will be safe ?
  11. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> And in db is utf8_general_ci..
  12. Now i got problem with latin chars žšđčć, example: š is in browser Å¡. How can i fix that? Without htmlentities, it works fine..
  13. Do you mean when i wonna put something from db to input field or div to use htmlentities, only when read from db ? I should use that function always when echo data?
  14. I will use that 2 functions on every field, but i need to know when i need to use htmlspecialchars ? And how do u mean to use htmpentities only when not HTML ? If u can explain me pls ? And thanks..
  15. Hi, should i use htmlspecialchars() when i write in mysql or when i read from mysql, and should i use another function for safety ?
  16. Hi, how can i make to auctions be ordered by top field(it will have 0, 1 and 2 values) in mysql to order first by '2' then '1' then '0', and all that to be ordered by date DESC, can that be done ? Example(timestamp is not correct, but its example) id times text top ---------------------------------- 1 2 text1 0 2 10 text2 0 3 20 te32 0 4 15 te123 0 5 6 text1 0 6 7 text2 0 7 8 another 1 8 9 sadasd 2 9 10 hi 3 To be ordered like this: 9 10 hi 3 8 9 sadasd 2 7 8 another 1 3 20 te32 0 (time is 20 here, to order by highest..) 4 15 te123 0 2 10 text2 0 6 7 text2 0 5 6 text1 0 1 2 text1 0
  17. Hi, i need to make js code for this thing: - when page load to load on div id=articles-list 20 results now, on the bottom of that div will be previous and next links, so when click on next to show 20 next, but not with ajax i wonna to make that next 20 results to be loaded when page is loaded and to be hidden, can someone help me with that?
  18. I saw that, but i thought there is solution with jquery, or something else, but ok. Thanks..
  19. It doesnt work with number fields ? Like date str in 10 chars ?
  20. How can i made my row(tr) as link, like div with width=100% and height=100px? I saw the solution with onclick event and javascript, but when i mouseover i wonna to have link in status bar that is showing, could it be done ?
  21. I use this function on every field, number, text etc.. for safety..
  22. Is it correct to use mysql_real_escape_string() function on every query that i wonna insert or search ? I have fields like TEXT(dectription of article), VARCHAR(name of article) and more like that, and is there correct to use mysql_real_escape_string for all fields when query is INSERT ?
×
×
  • 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.