| | |
$_GET['Array Values']
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
I want to use $_GET['error'] to fetch error messages from an array.
Heres my array:
So if I did
How can I do this?
Thanks
Heres my array:
php Syntax (Toggle Plain Text)
$errormessages = array( 'nosearch' => 'Your search returned no results - <a href="guide?t=search">Click Here For Search Tips</a>', 'captcha' => 'The captcha you entered was incorrect, please try again.',);
So if I did
echo $_GET['nosearch']; it would return Your search returned no results - <a href="guide?t=search">Click Here For Search Tips</a> How can I do this?
Thanks
Last edited by !Unreal; Mar 2nd, 2009 at 4:44 am.
you are right...
then why don't you use swith case in if loop...
then try like this...
then you have to pass your url like
then why don't you use swith case in if loop...
then try like this...
PHP Syntax (Toggle Plain Text)
if(!empty($_GET['err'])){ switch($_GET['err']){ case 'nosearch' : $msg="Your search returned no results - <a href="guide?t=search">Click Here For Search Tips</a> "; break; .......and so on } }
?err=nosearch [/icode] Last edited by Shanti Chepuru; Mar 2nd, 2009 at 5:24 am.
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
![]() |
Similar Threads
- passing info (PHP)
- JS variable in PHP (PHP)
- Where _GET[] array is formed? (PHP)
- post submitting values not working? (PHP)
- getting X, Y values of certain text in string on image (PHP)
- Code only inserts last value in array into the database (PHP)
- Open In New Window Php (PHP)
- how to pass a php array to a sql query (PHP)
- Help with Querystring error (PHP)
Other Threads in the PHP Forum
- Previous Thread: [function.fopen]: failed to open stream
- Next Thread: Creating a 6 digit number from letters
Views: 1239 | Replies: 7
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic ebooks echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla jquery js limit link login loop mail mediawiki menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search select server sessions sms soap source space speed sql stored structure subdomain syntax system table tutorial update updates upload url validation validator variable video web xml youtube






