jefargrafx
Instructor
I'd like to create one php page that displays three different input forms.
I'm using the jump menu object and I'd like the php script to include a file depending on the user selection in the jump menu. I can do this on diffent pages, but I want to try and make it all happen on one page.
here's what i got so far:
<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"
;
if (restore) selObj.selectedIndex=0;
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"
)>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
if(!x && d.getElementById) x=d.getElementById
; return x;
}
function MM_jumpMenuGo(selName,targ,restore){ //v3.0
var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}
//-->
</script>
</head>
<body><form action="select_user_type" method="get" name="select_user_type" target="_self">
<p>
<select name="select" onchange="MM_jumpMenu('parent',this,0)">
<option selected="selected">Administrator</option>
<option>Reviewer</option>
<option>News and Articles Contributor</option>
</select>
<input type="button" name="Button1" value="Go" onclick="MM_jumpMenuGo('select_user_type','parent',0)" />
</p>
</form>
<p>
<?php
$select_user_type = $HTTP_GET_VARS["select_user_type"];
if ($HTTP_GET_VARS["select_user_type"] == "Administrator"
{
include('create_administrator.php');
}
if ($HTTP_GET_VARS["select_user_type"] == "Reviewer"
{
include('create_reviewer.php');
}
if ($HTTP_GET_VARS["select_user_type"] == "News and Articles Contributor"
{
include('create_contributor.php');
}
?>
</p>
</body>
</html>
: any ideas
thanks
jef
I'm using the jump menu object and I'd like the php script to include a file depending on the user selection in the jump menu. I can do this on diffent pages, but I want to try and make it all happen on one page.
here's what i got so far:
<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"

if (restore) selObj.selectedIndex=0;
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"

d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
if(!x && d.getElementById) x=d.getElementById

}
function MM_jumpMenuGo(selName,targ,restore){ //v3.0
var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}
//-->
</script>
</head>
<body><form action="select_user_type" method="get" name="select_user_type" target="_self">
<p>
<select name="select" onchange="MM_jumpMenu('parent',this,0)">
<option selected="selected">Administrator</option>
<option>Reviewer</option>
<option>News and Articles Contributor</option>
</select>
<input type="button" name="Button1" value="Go" onclick="MM_jumpMenuGo('select_user_type','parent',0)" />
</p>
</form>
<p>
<?php
$select_user_type = $HTTP_GET_VARS["select_user_type"];
if ($HTTP_GET_VARS["select_user_type"] == "Administrator"

include('create_administrator.php');
}
if ($HTTP_GET_VARS["select_user_type"] == "Reviewer"

include('create_reviewer.php');
}
if ($HTTP_GET_VARS["select_user_type"] == "News and Articles Contributor"

include('create_contributor.php');
}
?>
</p>
</body>
</html>
: any ideas
thanks
jef