You were looking for the POST 'album' but had named the select 'title'. I added a is_numeric() check to the POST title check for good measure too. It's not a bad idea to validate anything that comes form a user especially if it is used to call files.
In the head
PHP Code:
<?php
$number=(isset($_POST['title']) && is_numeric($_POST['title'])?$_POST['title']:1);
//a neater way to set the value or a default if there are only 2 options.
//If there are more things to consider then a switch() is the thing to use.
?>
var dsGallery = new Spry.Data.XMLDataSet("scripts/photos<?php print $number; ?>.xml", "/gallery/photos/photo");
var dsData = new Spry.Data.XMLDataSet("scripts/photos<?php print $number; ?>.xml", "/gallery");
In the body
PHP Code:
<form action="<?php echo $_SERVER['SCRIPT_NAME']?>" enctype="multipart/form-data" method="post" name="album">
<select name="title" id="title" >
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
<br />
<span class="fill">
<input name="send" type="submit" class="radio" value="Change"/>
</span>
</form>
use <?php echo $_SERVER['SCRIPT_NAME']?> as the action to post a form to itself for portability.
Bookmarks