I want user to enter his birthday from dropdown menu during registration.I searched for code and got this
<tr>
<td><label>Birthday:</label></td>
<td>
<div class="input-container">
<select name="month"><option value="0">Month:</option><?=generate_options(1,12,'callback_month')?></select>
<select name="day"><option value="0">Day:</option><?=generate_options(1,31)?></select>
<select name="year"><option value="0">Year:</option><?=generate_options(date('Y'),1900)?></select>
</div>
</td>
</tr>
But this code is not working.Please show some error or provide with better dropdown menu code.
It could be that short_open_tag is disabled on your PHP setup. instead of
<?= generate_options(
you might need to code as
<?php
echo generate_options(
then next step, We still need to know what error your page is showing. try this code on a new file called index2.php
<?php
error_reporting(E_ALL);
define('INCLUDE_CHECK',1);
require "functions.php";
?>
<html>
<body>
<?=generate_options(1,12,'callback_month')?>
below this are previous answers...
What error did you get? if its undefined function generate_options , then you'll need to add that function in your page.
Can you supply more detail so we can answer this? Can you also mention the page you took it from?
if you got it from here http://tutorialzine.com/2009/08/creating-a-facebook-like-registration-form-with-jquery/ You'll need to copy the PHP code from that page as well.
You'll need to add the php code either on top or at the bottom of the page.
<?php
function generate_options($from,$to,$callback=false)
{
$reverse=false;
if($from>$to)
{
$tmp=$from;
$from=$to;
$to=$tmp;
$reverse=true;
}
......
?>
generate_options is not internal PHP function. For fix this code you should find definition of this function and insert it to your code