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
neprimanje $_POST-a..

 
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
_butch



Joined: 10 Sep 2003
Posts: 870
Location: Maichno, Krlovc

PostPosted: 22.06.2004 12:01    Post subject: neprimanje $_POST-a.. Add user to your forum ignore list Reply with quote

Imam jako jako cudan feature.. .
Struktura je malo slozena, al ide ovako -
u .htaccess-u imam za error document gate.php u kojem je skripta za parsanje urlova (tnx to njava) i unutra se includa index.php.
Sada mi je problem kada submit iz forme, stavim za action "/admin/login/ " te u index fajle stavim ako je admin odabran da mi includa admin.php., te je u adminu stavljen switch i case 'login'.

Code:


switch ($url_2) {
case 'login':
$login = $_POST['login_attmpt'];

if (isset($login)) {
// login itd
}
break;
}


no problem je jer mi uopće neće echo-at value koja je "$login" pripisana. Ovo mi je naravno test da vidim dal radi il ne..

jos upotrebaljavam patTemplate za templating, ako to ima kakve veze, no sumanjam.

_________________
FRENCH GUARD: No chance, English bed-wetting types.
I burst my pimples at you and call your door-opening request a silly thing, you tiny-brained wipers of other people's bottoms!
Flikrac
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
maxy



Joined: 07 Sep 2003
Posts: 894
Location: Zagreb

PostPosted: 22.06.2004 12:15    Post subject: Add user to your forum ignore list Reply with quote

mozda ti treba pisat $_POST['login_attempt'] umjesto $_POST['login_attmpt']?
Back to top
View user's profile Send private message
_butch



Joined: 10 Sep 2003
Posts: 870
Location: Maichno, Krlovc

PostPosted: 22.06.2004 12:53    Post subject: Add user to your forum ignore list Reply with quote

probao sam print_r($_POST) i array mi je prazan ?! wtf

ovo mi je forma
Code:

<form action="/admin/login/" method="post" enctype="application/x-www-form-urlencoded" name="forma" id="forma">
  <table width="658" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td>korisničko ime </td>
      <td><input name="username" type="text" id="username" value=""></td>
    </tr>
    <tr>

      <td>lozinka</td>
      <td><input name="pass" type="password" id="pass" value=""></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><input name="login_attempt" type="hidden" id="login_attempt" value="0"></td>
    </tr>
    <tr>

      <td>&nbsp;</td>
      <td><input name="login" type="submit" id="login" value="login )&gt;"></td>
    </tr>
  </table>
</form>

_________________
FRENCH GUARD: No chance, English bed-wetting types.
I burst my pimples at you and call your door-opening request a silly thing, you tiny-brained wipers of other people's bottoms!
Flikrac
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
zytzagoo
mi3.crew


Joined: 25 Aug 2003
Posts: 1842
Location: Zagreb, Hrvatska

PostPosted: 22.06.2004 14:16    Post subject: Add user to your forum ignore list Reply with quote

Mozda cijela prica ne dodje uopce do gate.php, pa index.php, i dalje, jer se ne desi error?

Jesi probao u nekom ranijem fajlu napisati print_r($_POST);? Radis negdje location redirect prije mozda, pa popusis post? Iz uvodnog posta nism uspio skuzit kak ti tocno funkcionira sistem...

_________________
[+]I[+]am[+]my[+]own[+]religion[+]
Back to top
View user's profile Send private message Visit poster's website Twitter profile
maxy



Joined: 07 Sep 2003
Posts: 894
Location: Zagreb

PostPosted: 22.06.2004 14:27    Post subject: Add user to your forum ignore list Reply with quote

posalji rewriterule i file u kojem se obavlja login da poblize vidimo problem.
Back to top
View user's profile Send private message
_butch



Joined: 10 Sep 2003
Posts: 870
Location: Maichno, Krlovc

PostPosted: 22.06.2004 21:25    Post subject: Add user to your forum ignore list Reply with quote

u gate.php sam upiso, i nista.
funny, kada stavim u index.php formu i za action stavim "/" onda mi prihvaca, i ispisuje $_POST, a ako si stavim ('/admin/login/") ne dobivam nista.

Ne koristim mod_rewrite, nego onu tehniku sa ErrorDocumentom, a parsanje url-a je iz ovog posta.

_________________
FRENCH GUARD: No chance, English bed-wetting types.
I burst my pimples at you and call your door-opening request a silly thing, you tiny-brained wipers of other people's bottoms!
Flikrac
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
zytzagoo
mi3.crew


Joined: 25 Aug 2003
Posts: 1842
Location: Zagreb, Hrvatska

PostPosted: 22.06.2004 23:38    Post subject: Add user to your forum ignore list Reply with quote

Jesi probao pogledati headere koje ti vrati server nakon sto odes na /admin/login/?

Meni se cini da ti uopce onda ili ne dodjes do index.php-a ili i prodjes kroz njega i odes jos negdje, na neku novu stranicu ili sam potpuno krivo shvatio cijeli tvoj setup...

Jesi probao staviti die() nakon print_r() poziva? Ono, da bas tu stane svako daljnje izvrsavanje? Osnova kad debugging postane zajeban Smile

_________________
[+]I[+]am[+]my[+]own[+]religion[+]
Back to top
View user's profile Send private message Visit poster's website Twitter profile
_butch



Joined: 10 Sep 2003
Posts: 870
Location: Maichno, Krlovc

PostPosted: 23.06.2004 12:24    Post subject: Add user to your forum ignore list Reply with quote

u teoriji -
gate.php prima url i parsa ga, i onda automatski inkluda index.php.
Stavljam switch i ako je "/admin" odmah nakon inkluda mi admin.php i pod-foldera.

Sada sam probao i koristii mod_rewrite, ovo mi je setup za virtualac.

Code:

<VirtualHost 127.0.0.1>
   DocumentRoot C:/AppServ/www/pat
   ServerName cnns.w
   ErrorLog C:/AppServ/apache/logs/cnns-error
   LogLevel info
   RewriteLog c:/AppServ/apache/logs/cnns 
        RewriteLogLevel 4
   
   Options ExecCGI FollowSymLinks Includes MultiViews
   RewriteEngine On
       
   RewriteRule ^/([a-z])/$ ./index.php?action=$1 [L]
   </VirtualHost>


Sada mi odmah na index baca, no ako upisem bio sto, ono "/admin" izbacuje mi 404 error

imam u .htaccessu
Code:

LoadModule rewrite_module modules/mod_rewrite.so
AddModule mod_rewrite.c


mislim ovo me vec ubija, juce sam skinuo appserv i promijenio app za server, i opet ne radi.
A trebalo bi koliko mi se cini.

_________________
FRENCH GUARD: No chance, English bed-wetting types.
I burst my pimples at you and call your door-opening request a silly thing, you tiny-brained wipers of other people's bottoms!
Flikrac
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
zytzagoo
mi3.crew


Joined: 25 Aug 2003
Posts: 1842
Location: Zagreb, Hrvatska

PostPosted: 23.06.2004 14:40    Post subject: Add user to your forum ignore list Reply with quote

I dalje ne shvacam... Ajde probaj fino natjerati sve to da radi bez mod_rewrite-a, i ostalih djidjebaja i vidi jel radi... Nakon toga se kreni igrat sa ovim zajebanijim dijelovima...

Ako dobijas 404, znaci da ti taj rewrite rule valjda nije ulovio sto je trebao. I to vjerojatno jer si u rule stavio da mora biti trailing slash, a u actionu ga nema...

Probaj promjeniti rewrite rule u ovo (napamet pisem, nemam vremena testirat):
Code:
RewriteRule ^/(.*)$           /index.php?action=$1   [L]

Cini mi se da bi to trebalo loviti sve...

_________________
[+]I[+]am[+]my[+]own[+]religion[+]
Back to top
View user's profile Send private message Visit poster's website Twitter profile
_butch



Joined: 10 Sep 2003
Posts: 870
Location: Maichno, Krlovc

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

e bas je bilo to za "(.*) "
ali bas bi htio da mi tu hvata od a-z, no bolj eista nego nista.
Hvala na pomoci ! Very Happy

_________________
FRENCH GUARD: No chance, English bed-wetting types.
I burst my pimples at you and call your door-opening request a silly thing, you tiny-brained wipers of other people's bottoms!
Flikrac
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
zytzagoo
mi3.crew


Joined: 25 Aug 2003
Posts: 1842
Location: Zagreb, Hrvatska

PostPosted: 24.06.2004 09:57    Post subject: Add user to your forum ignore list Reply with quote

Onda stavi od a-z, ali bez trailing slasha, pa ce ti nadam se uloviti i kad ga ima i kad ga nema , ali ako forsiras kao u gornjem promjeru trailing slash, onda kad ga nema, nece uloviti... I mozda da procitas manual od mod_rewrite-a, imas unutra dosta primjera regexa, pa ces vec znati sloziti sto ti treba

_________________
[+]I[+]am[+]my[+]own[+]religion[+]
Back to top
View user's profile Send private message Visit poster's website Twitter profile
maxy



Joined: 07 Sep 2003
Posts: 894
Location: Zagreb

PostPosted: 24.06.2004 10:28    Post subject: Add user to your forum ignore list Reply with quote

/? znaci da se je znakic prije upitnika opcionalan pa mozes to stavit na kraj i bok.

dakle
Code:
RewriteRule ^/(.*)/?$           /index.php?action=$1   [L]
Back to top
View user's profile Send private message
PsychoPod



Joined: 05 Oct 2003
Posts: 166

PostPosted: 25.06.2004 13:45    Post subject: Add user to your forum ignore list Reply with quote

nisam prof kao ovo dvoje, ali si probao action bez pocetnog slasha?
action="admin/login/"?
Back to top
View user's profile Send private message
maxy



Joined: 07 Sep 2003
Posts: 894
Location: Zagreb

PostPosted: 25.06.2004 15:26    Post subject: Add user to your forum ignore list Reply with quote

PsychoPod wrote:
nisam prof kao ovo dvoje, ali si probao action bez pocetnog slasha?
action="admin/login/"?


ako nema pocetni slash onda dojde do zajeba ak se nalazi na adresi localhost/nesto i onda ce mu formular ici na localhost/nesto/admin/login.
stoga, treba pocetni slash.
Back to top
View user's profile Send private message
t3r0



Joined: 08 Jun 2004
Posts: 107

PostPosted: 26.06.2004 14:55    Post subject: Add user to your forum ignore list Reply with quote

il jos bolje tocka slash ./
tako bar ja radim Razz
Back to top
View user's profile Send private message
_butch



Joined: 10 Sep 2003
Posts: 870
Location: Maichno, Krlovc

PostPosted: 27.06.2004 02:09    Post subject: Add user to your forum ignore list Reply with quote

mali help za ljudekoji muce muku sa regexom -
dobar thread na sitepointu
za one koji su lijeni citati direkt na post

uglavno covjek 'vako kaze
Code:

RewriteRule ^[^.]*$ /index.php [L]

_________________
FRENCH GUARD: No chance, English bed-wetting types.
I burst my pimples at you and call your door-opening request a silly thing, you tiny-brained wipers of other people's bottoms!
Flikrac
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
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