PDA

View Full Version : [PHP] Controllare la presenza di determinati parametri


vv1984
30-11-2008, 12:28
Ciao a tutti,
sono nella situazione in cui posso ricevere le
seguenti richieste:

www.miosito.com/script.php?param1=valore

www.miosito.com/script.php?param2=valore

www.miosito.com/script.php?param1=valore&param2=valore

Come faccio a controllare se è presente
o meno uno di questi parametri?

se faccio if($_GET[param1])
e poi il param1 non è presente mi ritorna errore anche
solo per il fatto che l'ho controllato,mm...non so se mi spiego..

grazie mille,
Blob

Torav
30-11-2008, 12:43
puoi usare la funzione isset($nomevariabile), che ti ritorna true se la var esiste, false altrimenti

vv1984
30-11-2008, 15:34
puoi usare la funzione isset($nomevariabile), che ti ritorna true se la var esiste, false altrimenti

Fantastico, grazie!
Si è capito che non ne so molto di php, eh? :stordita:

,Blob

malocchio
01-12-2008, 23:23
Fantastico, grazie!
Si è capito che non ne so molto di php, eh? :stordita:

,Blob

In php si usa talmente tante volte isset() che vien voglia di cambiar linguaggio.

Questa la devo postare su "YourLanguageSucks"....

Hardware Upgrade Forum Database Error
Database Error Database error
The Hardware Upgrade Forum database has encountered a problem.

Please try the following:
  • Load the page again by clicking the Refresh button in your web browser.
  • Open the www.hwupgrade.it home page, then try to open another page.
  • Click the Back button to try another link.
The www.hwupgrade.it forum technical staff have been notified of the error, though you may contact them if the problem persists.
 
We apologise for any inconvenience.