Phorum.ro
Your Avatar Welcome to Phorum.ro!
If you haven't registered yet, click here!
Attention Visitor:
You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
Du-te înapoi   Phorum.ro > Web Design & Web Development > Programare > PHP > Discutii Generale

Discutii Generale Discutii generale despre PHP.

Răspunde
 
Thread Tools Moduri de afișare
Vechi 12.09.2010   #1
marianchucky
16-Bit Member
 
Data înregistrării: 16.07.2008
Mesaje: 18
Rep Power: 4
marianchucky is on a distinguished road
Implicit mod_rewrite..

Salut!

Am o mare problema cu mod_rewrite.
Eu am un site in care afisez cateva titluri de stiri sub forma de link ce ma trimit la o pagina articol.php unde este stirea completa.

Cod PHP:
while( $row mysql_fetch_assoc($result))
{
echo 
'<li><a href=\'articol.php?id='.$row['id'].'&titlu='.$row['url'].'\'><b>'.$row['titlu'].'</b></a></li>'; } 
$row['url'] = titlul prelucrat la introducerea stirii, avand in loc de spatii caracterul "-" (ex: titlu-prelucrat-la-introducere).

In pagina articol.php am urmatorul cod
Cod PHP:
if ( isset($_GET['id']) ) {
    
$id intval($_GET['id']);
} else {
    
$id 0;
    echo 
'Stirile nu au putut fi preluate din baza de date.';
}

$query 'SELECT * FROM stiri WHERE id='.$id.'';
$result mysql_query($query) or die(mysql_error()); 
while(
$row mysql_fetch_assoc($result)){
//pg web...

Afisarea stirilor in intregime si tot procesul merge bine, dar la pg unde este stirea completa am linkul: site/articol.php?id=**&titlu=titlul-stirii-respective .

Am incercat multe metode pt a rescrie url-ul cu rewrite rule in .htaccess. Am mai citit pe alte forumuri ca problema ar putea fi legata si de server.
Nu stiu ce sa cred..

Daca ma ajuta cineva i-as fi foarte recunoscator!

Multumesc anticipat!
__________________
Portal economic - http://www.ebancomat.ro
marianchucky is offline   Reply With Quote
Sponsored Links
Răspunde


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Moduri de afișare

Reguli de postare
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Pornit
emoticoanele sunt Pornit
Codul [IMG] este Pornit
Codul HTML este Pornit



Ora este GMT +3. Ora este acum 01:39:40.


Rulează cu: vBulletin Version 3.8.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Forum SEO by Zoints

XXXXXXXXXXXXXXXXXXX
Inactive Reminders By Icora Web Design