Jump to content

UnknownPlayer

Members
  • Posts

    269
  • Joined

  • Last visited

    Never

Everything posted by UnknownPlayer

  1. <?php include("includes/header.php"); if (empty($_GET['q'])) redirect_to(SITE_URL."usluge/vez"); ?> <div id="sadrzaj"> <ul class="meni2"> <?php if (!empty($_GET['q'])) { $url_data = explode("/",$_GET['q']); } ?> <li<?php if (!empty($_GET['q']) && ($url_data[0] == "vez")) echo ' id="aktivan"'; ?>><a href="<?php echo SITE_URL; ?>usluge/vez"><?php echo get_kategorija_naziv(1, $pod_jezik) ?></a></li> <li<?php if (!empty($_GET['q']) && ($url_data[0] == "čenil")) echo ' id="aktivan"'; ?>><a href="<?php echo SITE_URL; ?>usluge/čenil"><?php echo get_kategorija_naziv(2, $pod_jezik) ?></a></li> <li<?php if (!empty($_GET['q']) && ($url_data[0] == "cirkoni")) echo ' id="aktivan"'; ?>><a href="<?php echo SITE_URL; ?>usluge/cirkoni"><?php echo get_kategorija_naziv(3, $pod_jezik) ?></a></li> <li<?php if (!empty($_GET['q']) && ($url_data[0] == "šljokice")) echo ' id="aktivan"'; ?>><a href="<?php echo SITE_URL; ?>usluge/šljokice"><?php echo get_kategorija_naziv(4, $pod_jezik) ?></a></li> </ul> <hr> <div id="proizvodi"> <?php if (!empty($url_data)) { if (count($url_data) == 1) { prikazi_usluge($_GET['q']); } elseif (count($url_data) == 2) { if (!empty($url_data[1])) prikazi_proizvod($url_data[1], "usluge"); } } ?> </div> </div> <?php include("includes/footer.php"); ?> That is code.. This code: if (count($url_data) == 1) { prikazi_usluge($_GET['q']); } is to show all articles for that categorie that is in $_GET['q'] (example: vez) And this code: elseif (count($url_data) == 2) { if (!empty($url_data[1])) prikazi_proizvod($url_data[1], "usluge"); } is to show that article, $url_data[1] is seo name for that article and $url_data[0] is categorie name.. example vez/article-1
  2. I have problem, on my localhost, this website works fine: http://des-kom.com/usluge/vez but on this hosting, it doesn't show articles in that link, i dont know why, but on this link: http://des-kom.com/masine it works.. so i think that problem is with htaccess code: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(usluge|masine|o-nama|kontakt|admin)$ ./$1.php [L,QSA] RewriteRule ^usluge/(.*)$ usluge.php?q=$1 [L,QSA] RewriteRule ^masine/(.*)$ masine.php?q=$1 [L,QSA] In usluge.php file, i explode all queries with "/"(explode("/",$_GET['q']) so it explode this categorie vez, but it cant read, i dont know why ? In masine.php is without explode, just showing items, no categories.. Can anyone help me? btw php version is 5.2.17 and on my localhost is 5.3.0..
  3. Fixed, and this too: public __construct($id) to public function __construct($id).. Thanks..
  4. Got this error: Fatal error: Call to undefined function get_user_data() in C:\wamp\www\ttt.php on line 12 but i have class declared like this: class get_user_data { ... } What is problem?
  5. Can i remove this mail limit on hosting in cPanle or php.ini file, but without customer support ?
  6. How can i use this class to get users data but i need to call it like this: These is class code: class get_user_data { $query = "SELECT * FROM users WHERE id = {I DONT KNOW HOW TO DO THIS} LIMIT 1"; $result = mysql_query($query); $var = mysql_fetch_object($result); function get_id(){ return $var->ID; } function get_un(){ return $var->username; } }
  7. I have this code in .htaccess: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(usluge|masine|o-nama|kontakt)?$ ./$1.php [L,QSA] RewriteRule ^usluge/(.*)$ usluge.php?q=$1 [L,QSA] It works fine for addresses /usluge, /masine, /o-nama, /kontakt, but now i wonna go to www.example.com i got this error: Not Found The requested URL /des-com/.php was not found on this server. How to fix that? Thanks..
  8. Should i save this string in mysql and when url is with that string to read from mysql if exist that string like in url ? btw thanks
  9. And if there is some other example, can you please give me link ?
  10. This is nice, but how can i avoid special chars in article name, i mean in url ?
  11. How can i make url with www.domain.com/article/name-of-article ? If someone can give me example ?
  12. Broken? On grey field to put uploaded image, text 1 on text 1 field and text 2 on text 2 field. You dont see image?
  13. How can i do this thing like in image: I wonna put uploaded image in place where is text "Image here" and 2 text fields when submit to put them in their place, after that that picture with all that to be saved ?
  14. And there is no way that he can contain values 0 and 1, i mean in this example ?
  15. I have this code: $query = "SELECT * FROM boje"; $result = mysql_query($query, $connection); while ($boja = mysql_fetch_array($result)) { echo '<input type="checkbox" name="boja[]" value="'.$boja['id'].'" />' } Now problem is when i click submit, and when go through this code: foreach ($_POST['boja'] as $boja_id) { if (isset($boja_id)) { echo "isset"; } else { echo "not isset"; } } this works for checkboxes which are checked, but it doesn't show echo message for checkboxes which are not checked(not isset, else code..), what is the problem, and how can i make solution for this? Thanks..
  16. I solved this with: mysql_query("SET NAMES 'utf8'", $connection); and now everything works..
  17. I fond difference when you add something in mysql qith mysql INSERT command from php, and when you add from phpmyadmin. Resilts are: This is inserted from phpmyadmin, with this characters, and this does not work when i read them from mysql. But this is when i insert some text in mysql with php/mysql comman INSERT: This option works.. But how can i read items from first image, and echo them but to work ?
  18. In mysql, it is correct and db is utf8_general_ci, but when i read it does not show good. Can you give me right solution please ?
  19. I didnt, i thought there is some other solution. When i need to use that when inserting in db that field, or when read and echo ?
  20. utf8_general_ci is in base, i just put meta tag, and nothing else ? In source is same like in picture. What is solution now? How to check if php file is utf8 ?
  21. I have problem with latin characters čćšđž, when i read from mysql and echo them in table, it show me like this: Pe�kiri is im mysql Peškiri... btw i put in my header.php, which i include, this line: <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> What is problem?
×
×
  • 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.