bubbles Posted May 4, 2013 Report Share Posted May 4, 2013 Am urmatoarele probleme :1.De exemplu la urmatorul link MOVIE daca mai adaug ceva dupa ultimul / imi arata practic index.php insa fara calea corecta a css-ului si pagina se deformeaza.Cum pot anula chestia asta ? Interogarea este urmatoarea $result = mysqli_query($mysqli,"select * from video where id='$movie_id' and category_embed='$movie_cat' and title_movie='$movie_title'");Iar in .htaccess am adaugat RewriteRule ^video/([^/]*)/([^/]*)/([^/]*)/$ /video.php?category=$1&title=$2&video=$3 [L]2. De ce daca mai adaug litere aici - /25xxxxxx/ tot se face interogarea ?PS : Continutul este ADULT Quote Link to comment Share on other sites More sharing options...
em Posted May 4, 2013 Report Share Posted May 4, 2013 (edited) Sa inteleg ca ai modificat corespunzator .htaccess pentru a avea 4 "/". Ai modificat scriptul php si tot nu merge?Asa merge?RewriteRule ^video/([^/]*)/([^/]*)/([^/]*)/([a-z0-9]*)$ /video.php?category=$1&title=$2&video=$3 [L] Edited May 4, 2013 by em Quote Link to comment Share on other sites More sharing options...
bubbles Posted May 4, 2013 Author Report Share Posted May 4, 2013 Nu merge. Ce am scris mai sus este exact ce am in script. Quote Link to comment Share on other sites More sharing options...
em Posted May 4, 2013 Report Share Posted May 4, 2013 Tu daca mai pui inca un "/" stringul tau nu va mai face match pe expresia regulata. Quote Link to comment Share on other sites More sharing options...
bubbles Posted May 4, 2013 Author Report Share Posted May 4, 2013 Tot la fel face. Quote Link to comment Share on other sites More sharing options...
em Posted May 4, 2013 Report Share Posted May 4, 2013 Uitasem cevaRewriteRule ^video/([^/]*)/([^/]*)/([^/]*)/([a-z0-9]*)/$ /video.php?category=$1&title=$2&video=$3 [L] Quote Link to comment Share on other sites More sharing options...
bubbles Posted May 4, 2013 Author Report Share Posted May 4, 2013 Nu e ok. Acum nu se mai face interogarea deloc si iar ma trimite pe index.php . Quote Link to comment Share on other sites More sharing options...
em Posted May 4, 2013 Report Share Posted May 4, 2013 Este OK.Doar ca trebuie sa pastrezi si regula originala (nemodificata). O sa ai 2 acum.Deci o sa ai asaRewriteRule ^video/([^/]*)/([^/]*)/([^/]*)/$ /video.php?category=$1&title=$2&video=$3 [L]RewriteRule ^video/([^/]*)/([^/]*)/([^/]*)/([a-z0-9]*)/$ /video.php?category=$1&title=$2&video=$3 [L] Quote Link to comment Share on other sites More sharing options...
bubbles Posted May 4, 2013 Author Report Share Posted May 4, 2013 (edited) Poate ca nu m-am exprimat bine. Ideea este ca nu vreau sa se mai faca interogarea daca mai adaug ceva aici /25/Practic interogarea se face la fel daca am /25/ sau /25adasdas/ Edited May 4, 2013 by bubbles Quote Link to comment Share on other sites More sharing options...
em Posted May 4, 2013 Report Share Posted May 4, 2013 OK. Am inteles ce doresti. Dar ce mi-ai aratat tu nu prea e util.Vezi in video.php parametrul $_GET['video']. Eu cred ca ii face cast la int (dac? exist? casturi in php, nu sunt sigur). Posteaza sursa paginii sau macar bucata de cod care se joaca cu parametrul ala. Quote Link to comment Share on other sites More sharing options...
bubbles Posted May 4, 2013 Author Report Share Posted May 4, 2013 $movie_id=$_GET['video'];$movie_cat=$_GET['category'];$movie_title=$_GET['title'];$result = mysqli_query($mysqli,"select * from video where id='$movie_id' and category_embed='$movie_cat' and title_movie='$movie_title'"); Quote Link to comment Share on other sites More sharing options...
em Posted May 4, 2013 Report Share Posted May 4, 2013 Ai vrea sa iti afiseze o eroare daca nu e numeric?if (!is_numeric($movie_id)) exit("Poftim pula hackere"); Quote Link to comment Share on other sites More sharing options...
xTremeSurfer Posted May 4, 2013 Report Share Posted May 4, 2013 )))))) "POFTIM PULA HACKERE" scz de off )) Quote Link to comment Share on other sites More sharing options...
bubbles Posted May 4, 2013 Author Report Share Posted May 4, 2013 @em m-am gandit si eu la asta, insa incercam sa si inteleg de ce se tot face interogarea, pentru ca logic trebuie sa returneze 0. Quote Link to comment Share on other sites More sharing options...
em Posted May 4, 2013 Report Share Posted May 4, 2013 Salut.Este vorba de type-conversion de la mysql. (O face automat ca sa iti fie tie mai bine).De exemplumysql> SELECT 1 > '6x'; -> 0mysql> SELECT 7 > '6x'; -> 1mysql> SELECT 0 > 'x6'; -> 0mysql> SELECT 0 = 'x6'; -> 1Dupa cum vezi, cand am un numeric cu alt gunoi dupa el, si el se asteapta la numeric, nu tine cont de ultimele caractere. 1 Quote Link to comment Share on other sites More sharing options...
bubbles Posted May 4, 2013 Author Report Share Posted May 4, 2013 Ok. Merci, am sa studiez mai bine problema. Merci si Christos a înviat. Quote Link to comment Share on other sites More sharing options...