T
TheJkWhoSaysNi
Guest
function name($variable) in php.
This works.
but putting it in a practical script, i cant get it to work at all.
My other functions work fine its just the content once wont. the script is at http://www.ud.barrysworld.net/indextest.php?page=Ranks and $page is from the URL.
if i comment out if ($type == '1') it works. and as you can see Type does echo as 1.
Any ideas why it wont work? Thanks.
This works.
Code:
<?
function content($what) {
echo "$what";
}
content("Test");
?>
but putting it in a practical script, i cant get it to work at all.
Code:
...snip....
function content($what) {
echo $what;
global $username, $db;
$sql="SELECT * FROM yabbse_members WHERE memberName = '$username'";
$result=mysql_query($sql,$db);
$row = mysql_fetch_array($result);
$membergroup = $row["memberGroup"];
echo("$what");
if ($membergroup == 'Administrator') echo "
<script language=\"JavaScript\">
<!--
function webed(content) {
window.open('edit.php?content=' + content,'editwin','resizable=yes,width=600,height=380');
}
-->
</script>
";
$contentfile = "content/" . $what . ".html";
if (is_file($contentfile)) {
include $contentfile;
}
else echo"Unable to load $what";
if ($membergroup == 'Administrator') {
echo " <a href=\"javascript:webed('$what')\" target=\"_self\"
onMouseOver=\"status='$mouseover_str';return true\" onMouseOut=\"status='';return true\">
<img src=\"images/edit.gif\" width=\"20\" height=\"15\" border=\"0\" alt=\"$mouseover_str\"></a>";
}
echo "";
}
...snip...
$sql="SELECT * FROM Pages WHERE Page = '$page'";
$result=mysql_query($sql,$db);
$row = mysql_fetch_array($result);
$type = $row["Type"];
$member = $row["Member"];
$admin = $row["Admin"];
$customhead = $row["head"];
echo("Type: $type");
$title = str_replace('_', ' ', $page);
if ($customhead != '')
$head = $customhead;
include("header.php");
echo("header.php....ok");
if ($member == '1')
member();
if ($admin == '1')
admin();
if ($type == '1')
content("$page");
include("footer.php");
?>
My other functions work fine its just the content once wont. the script is at http://www.ud.barrysworld.net/indextest.php?page=Ranks and $page is from the URL.
if i comment out if ($type == '1') it works. and as you can see Type does echo as 1.
Any ideas why it wont work? Thanks.