| | |
Simple Case Switching for Dynamic Content
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Case switching is a neat way to make your site a bit more dynamic. it gives you the ability to show blocks of information "on the fly".
By attaching the variable name "Content" to our link, we pass that condition in the query string. Note that on the last link, our Default content will show, since we have not passed the variable.
By attaching the variable name "Content" to our link, we pass that condition in the query string. Note that on the last link, our Default content will show, since we have not passed the variable.
< href="<?php echo $_SERVER['PHP_SELF']; ?>?Content=one">Case One</a><br /> < href="<?php echo $_SERVER['PHP_SELF']; ?>?Content=two">Case Two</a><br /> < href="<?php echo $_SERVER['PHP_SELF']; ?>?Content=two">Case Tthree</a><br /> < href="<?php echo $_SERVER['PHP_SELF']; ?>Main</a> <br /> <br /> <?php switch ($Content) { case one: echo "This is our First Case"; break; case two: echo "This is our Second Case"; break; case three: echo "This is our Third Case"; break; default: echo"This is our default Content in case nothing was selected!"; } ?> hope this helps a newbie! I
Similar Threads
- WebRequest Capture Dynamic Content (ASP.NET)
- display dynamic content using ajax (JavaScript / DHTML / AJAX)
- Css In Dynamic Content (HTML and CSS)
- dynamic content from database, How? (Database Design)
- New Case, Switching Parts, NO BOOT UP Help (Troubleshooting Dead Machines)
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array back beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic echo email error file files filter folder form forms function functions gc_maxlifetime google host href htaccess html image include insert integration ip java javascript joomla limit link login loop mail memmory memory menu mlm mod_rewrite multiple mysql navigation oop parse parsing paypal pdf php problem query radio random recursion regex remote script search server sessions sms snippet soap source space sql structure syntax system table thesishelp tutorial update upload url validation validator variable video web xml youtube



