Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
php, molim malo objasnjenje

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side
View previous topic :: View next topic  
Author Message
Pekx



Joined: 09 Sep 2004
Posts: 559

PostPosted: 04.05.2005 11:12    Post subject: php, molim malo objasnjenje Add user to your forum ignore list Reply with quote

molim vas da mi kažete kako dobiti da mi linkovi ispadaju ovako npr : http://nekilink.com/pokreni.php/kat=25 umijesto npr: nekilink.com/kategorija25.php

u cem je stvar?

hvala, glupo pitanje, isn`t it? Wink

_________________
mp3hr.com
Back to top
View user's profile Send private message Send e-mail
smasher



Joined: 10 Jan 2004
Posts: 229
Location: Zaprešić

PostPosted: 04.05.2005 11:17    Post subject: Add user to your forum ignore list Reply with quote

kaj nije to mod rewrite?

_________________
http://3DHR.net - Srce hrvatskih 3d artista
http://www.Rhino3DHelp.com
Back to top
View user's profile Send private message Visit poster's website
Gale



Joined: 04 Apr 2005
Posts: 120

PostPosted: 04.05.2005 13:01    Post subject: Add user to your forum ignore list Reply with quote

Je
Back to top
View user's profile Send private message Visit poster's website
mile



Joined: 10 Sep 2003
Posts: 1327
Location: Jeruzalem

PostPosted: 04.05.2005 15:42    Post subject: Add user to your forum ignore list Reply with quote

baš ste mu fino pomogli. sad znam koga ću zvati ako budem trebao pomicati kauč Smile
dobro, nisam ni ja puno bolji:

evo Pekx, ako ti engleski nije problem
http://www.hotscripts.com/PHP/Tips_and_Tutorials/Introduction_to_PHP/index.html
Back to top
View user's profile Send private message Visit poster's website
Ilija Studen



Joined: 17 Apr 2005
Posts: 27
Location: 127.0.0.1

PostPosted: 04.05.2005 16:03    Post subject: Add user to your forum ignore list Reply with quote

Celih 3.260.000 odgovora Smile

http://www.google.com/search?hl=en&q=mod_rewrite&btnG=Google+Search

_________________
Blog: Web dizajn, web razvoj, programiranje, random
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 04.05.2005 16:58    Post subject: Re: php, molim malo objasnjenje Add user to your forum ignore list Reply with quote

Pekx wrote:
molim vas da mi kažete kako dobiti da mi linkovi ispadaju ovako npr : http://nekilink.com/pokreni.php/kat=25 umijesto npr: nekilink.com/kategorija25.php

u cem je stvar?

hvala, glupo pitanje, isn`t it? Wink

ti si u svom pitanju iskombinirao nesto, to u biti je mod rewrite, doduse bez ovog nastavka .php, ali mislim da ti je lakse poceti s ovim: (ako ti vec nastavak .php ne smeta)
http://inobscuro.com/read.php?cat=tutorials&id=16
(vidis kako ovaj link izgleda? to ti pise u tom tutorialu)

_________________
art & design portfoliofree Photoshop brushes stuffsketchblogfacebook
Back to top
View user's profile Send private message Visit poster's website Twitter profile
smasher



Joined: 10 Jan 2004
Posts: 229
Location: Zaprešić

PostPosted: 04.05.2005 17:28    Post subject: Add user to your forum ignore list Reply with quote

e, a mene zanima taj mod rewrite. Jel to u potpunosti definirano (taj rule) u htaccess-u ili kaj? Mislim, kolko sam nešt malo pročitao izgleda mi kao da to nema veze sa php-om?Vrlo vjerojatno sam u krivu.
I još jedno pitanjce ak mi itko zna odgovoriti. Ako ja na serveru imam poddomene, i imam taj rule za jedan sajt (u rootu) a za ovaj drugi to ne želim, recimo u direktoriju TEST (pa je domena: test.nekisajt.biz)
Jel postoji na sajtu sam taj jedan htaccess ili za svaku poddomenu poseban.

_________________
http://3DHR.net - Srce hrvatskih 3d artista
http://www.Rhino3DHelp.com
Back to top
View user's profile Send private message Visit poster's website
Ilija Studen



Joined: 17 Apr 2005
Posts: 27
Location: 127.0.0.1

PostPosted: 04.05.2005 18:55    Post subject: Add user to your forum ignore list Reply with quote

mod_rewrite nema direktne veze sa PHPom. mod_rewrite je Apache modul koji služi za prepisivanje URLova (kao što mu ime i govori).

Drugo pitanje: zavisi od konfiguracije Apachea. U najvećem borju slučajeva poddomen koristi sopstveni .htaccess

_________________
Blog: Web dizajn, web razvoj, programiranje, random
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
t3r0



Joined: 08 Jun 2004
Posts: 107

PostPosted: 04.05.2005 19:48    Post subject: Add user to your forum ignore list Reply with quote

svaki direktorij moze imati svoj .htaccess a mozes i u root .htaccess fajlu podesiti na koje direktorije/fajlove ce .htaccess "djelovati"
Back to top
View user's profile Send private message
smasher



Joined: 10 Jan 2004
Posts: 229
Location: Zaprešić

PostPosted: 04.05.2005 19:58    Post subject: Add user to your forum ignore list Reply with quote

kul. još samo moram skužit kak radi taj mod_rewrite.
negdje sam pročitao da dolazi do problema ako želiš imat url tipa: www.nekisajt.com/galerija/332/

di je 332 normalno id slike. Jer on 'galerija' i '332' razumije kao direktorij???
kak bi izgledao jedan jednosatvniji mod_rewrite rule?

_________________
http://3DHR.net - Srce hrvatskih 3d artista
http://www.Rhino3DHelp.com
Back to top
View user's profile Send private message Visit poster's website
Pekx



Joined: 09 Sep 2004
Posts: 559

PostPosted: 04.05.2005 21:35    Post subject: Add user to your forum ignore list Reply with quote

Ilija Studen wrote:
Celih 3.260.000 odgovora Smile

http://www.google.com/search?hl=en&q=mod_rewrite&btnG=Google+Search


eh da sam znao kako se to zove Very Happy
tnx svima!! jea, mod rewrite rulz! Cool

_________________
mp3hr.com
Back to top
View user's profile Send private message Send e-mail
Ilija Studen



Joined: 17 Apr 2005
Posts: 27
Location: 127.0.0.1

PostPosted: 06.05.2005 15:32    Post subject: Add user to your forum ignore list Reply with quote

t3r0 wrote:
svaki direktorij moze imati svoj .htaccess a mozes i u root .htaccess fajlu podesiti na koje direktorije/fajlove ce .htaccess "djelovati"


Upravo tako. Nisam rekao da može svugde jer je na nekim serverima isključeno AllowOverride Wink

PS: Ne kažu džaba u dokumentaciji da je mod_rewrite cool voodoo Very Happy

_________________
Blog: Web dizajn, web razvoj, programiranje, random
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
DrkaN



Joined: 06 May 2005
Posts: 3
Location: Hvar

PostPosted: 07.05.2005 00:22    Post subject: Add user to your forum ignore list Reply with quote

ja ti to kuzim ali ako hoces pomoc predugo je da ti ja sad tu objasnjavam jer neces nikad skuzit pa mi se javi na ICQ pa ako me jednom ulovis objasnit cu ti
Back to top
View user's profile Send private message Send e-mail
Pekx



Joined: 09 Sep 2004
Posts: 559

PostPosted: 14.10.2005 19:05    Post subject: Add user to your forum ignore list Reply with quote

evo jucer sam malo proucavao mod_rewrite i nekako sam sklepao ovo:


Code:
Options +FollowSymLinks
RewriteEngine On

Rewrite Rule ^members/[(A-Za-z0-9-)]/?$  member.php?memberID=$1


htio bih kad mi netko upise u brauzer npr nekisajt.com/member/5 da mi izvrsi isto stoi kad bi netko upisao nekisajt.com/member.php?userID=5
e,sad ovaj broj pet je varijabla koji sam oznacio (nisam ja nego sulien Smile ) sa $UID

evo i ovoga sto imam u members.php file-u

Code:
$UID = (int) $_GET['memberID'];
$result = mysql_query("SELECT * FROM members WHERE userID=$UID");
$r = mysql_fetch_array($result);
echo $r['name'];


jeste me skuzili, kako sam samo nespretan i neinformiran, a gledajuci i ovaj text nepismen i nenačitan Very Happy

jel ovo ikako izvedivo, malo sam citao thread u kojem je 1one napisao svoj kod nest sam s tim kodom pokusavao pa mi bas i neide. ako ima tko voljan pomoći, puno hvala!!

ewo, upravo nabavio mod rewrite cheat sheet Smile

_________________
mp3hr.com
Back to top
View user's profile Send private message Send e-mail
Sulien



Joined: 04 Jan 2004
Posts: 2905
Location: Zagreb

PostPosted: 14.10.2005 19:32    Post subject: Add user to your forum ignore list Reply with quote

Code:
Rewrite Rule ^members/[(A-Za-z0-9-)]/?$  member.php?memberID=$1

ovo nije dobar regexp... pomakni zagrade van uglatih
Code:
Rewrite Rule ^members/([A-Za-z0-9-])/?$  member.php?memberID=$1

inače mislio sam da je memberID samo broj... a ti dozvoljavaš i velika i mala slova... ako ta varijabla može biti i string, onda makni onaj (int) cast u PHP kodu, a ako nisi htio da bude string nego samo broj onda promijeni regexp u
Code:
Rewrite Rule ^members/([0-9])/?$  member.php?memberID=$1
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Pekx



Joined: 09 Sep 2004
Posts: 559

PostPosted: 15.10.2005 00:05    Post subject: Add user to your forum ignore list Reply with quote

hvala Sulien!!!

jel mi možeš samo malo pomoći još kod ovoga, malo sam modificitao kod o 1one-a i htio bih ubaciti members izmecu site.com/1/

kod ide ovako:

Code:
RewriteEngine on

RewriteCond %{REQUEST_FILENAME}  -d
RewriteRule  ^.*$  -  [L]

RewriteRule ^([^/]+)/$   member.php?memberID=$1 [L]


znaci htio bih da mi izgleda ovako: site.com/members/1/, a trenutno mi izgleda ovako site.com/1/

gdje u ovom ubaciti /members/ (ovdje ^([^/]+)/$ ).

hvala, zakon ste!!!

_________________
mp3hr.com
Back to top
View user's profile Send private message Send e-mail
Sulien



Joined: 04 Jan 2004
Posts: 2905
Location: Zagreb

PostPosted: 15.10.2005 00:16    Post subject: Add user to your forum ignore list Reply with quote

Code:
^members/([0-9])/$

ako je member ID broj, naravno

BTW nauči regular expressions Smile topla preporuka
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Pekx



Joined: 09 Sep 2004
Posts: 559

PostPosted: 15.10.2005 14:15    Post subject: Add user to your forum ignore list Reply with quote

hvalaaa

_________________
mp3hr.com
Back to top
View user's profile Send private message Send e-mail
Sulien



Joined: 04 Jan 2004
Posts: 2905
Location: Zagreb

PostPosted: 17.10.2005 17:01    Post subject: Add user to your forum ignore list Reply with quote

Sorry, Pekx Sad regexp kojeg sam ti napisao će prihvatiti samo jednu znamenku... evo ispravke
Code:
^members/([0-9]+)/$
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group