View Full Version : Show Div based on URL

04-29-2010, 02:00 PM
I would live to show a Div based on the URL.

I'm using PHP to update a database and the page just refreshes when it's done. I'd like to set the URL to something like http://www.whatever.com/update.php?id=5&ud=y

So if the URL had ud=y in it, it would show a div with a specific ID.

Thank you!

04-30-2010, 11:24 AM
No javascript required:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
#specific {
display: <?php
$theDisplay = isset($_GET['ud'])? $_GET['ud'] : '';
echo $theDisplay === 'y'? 'block' : 'none'; ?>;
<div id="specific">
I'm Specific.
Some other stuff.