Visualizzazione 1 filone di risposte
Visualizzazione 1 filone di risposte
- Devi essere connesso per rispondere a questo topic.
Email: info@wpitaly.it
Home › Forum › Problemi Vari con WP › $_SERVER[‘PHP_SELF’]
Grazie a quanti vorranno rispondermi.
Mi sembra di capire che il problema che espongo sia noto; eppure non ho trovato soluzione – ammesso che esista…
Ho creato un template ad hoc del mio tema per una categoria, poniamo per comodità la categoria 1.
Dunque il nome del file da me creato é semplicemente category-1.php.
Questo file contiene una form il cui target é $_SERVER.
Nel momento in cui premo invio nella form il risultato che desidero é: http://www.miosito.com/?cat=1&variabile=a
Ciò che ottengo é invece: http://www.miosito.com/?variabile=a e dunque vengo indirizzato a index.php…
Qualche suggerimento?
PS: ho provato anche a caricare il plugin “Correct PHP_SELF”, ma non ha funzionato; ho sempre lo stesso risultato. Sigh!
Dopo aver googlato in lungo e in largo, sto per arrendermi.
Ho provato a creare un due pagine distinte in modo da eliminare l’uso di $_SERVER (prima ne avevo una sola con doppio scopo grazie ad un IF/ELSE: se nella URL era valorizzata una variabile avrebbe dovuto essere caricata una parte di codice; altrimenti sarebbe stata caricata la form che quella variabile doveva generare).
Questo lo schema:
pagina1.php (form action=”www.miosito.com/?cat=123″)
category-123.php (echo $_GET[$var__generata_da_form_pagina1.php])
Il problema è che pur puntando espressamente action a category-123.php, all’invio della form viene sempre caricata index.php…
WPItaly - Copyright Creative Commons: CC BY-NC-SA 4.0