-
Help with Scritp...
Im making a DJ Emails List for Kristal Panel (I think its called that)
and heres the code:
PHP Code:
<?php
if(isset($_SESSION["EON_CNTPNL_USERNAME"]))
{ $check->login(); }
else{
session_start();
$check = new checklogin;
$check->login(); }
?>
<?php
echo("<b>DJ Emails</b><br/>Keep In contact with the DJ's<br/><br/>");
switch($_GET["act"])
$fetch = mysql_fetch_array(mysql_query("SELECT `username`, `email` FROM `users`");
echo("<b>{$fetch["username"]}</b> - {$fetch["email"]}");
break;
default:
}
?>
But I keep getting a message:
PHP Code:
Parse error: syntax error, unexpected T_VARIABLE, expecting ':' or '{' in /home/crazyhab/public_html/staff/emails.php on line 12
What do I need to do?
-
PHP Code:
<?php
if(isset($_SESSION["EON_CNTPNL_USERNAME"]))
{ $check->login(); }
else{
session_start();
$check = new checklogin;
$check->login(); }
?>
<?php
echo("<b>DJ Emails</b><br/>Keep In contact with the DJ's<br/><br/>");
switch($_GET["act"])
$fetch = mysql_fetch_array(mysql_query("SELECT `username` `email` FROM `users`");
echo("<b>{$fetch["username"]}</b> - {$fetch["email"]}");
break;
default:
}
?>
-
-
PHP Code:
<?php
if(isset($_SESSION["EON_CNTPNL_USERNAME"]))
{ $check->login(); }
else{
session_start();
$check = new checklogin;
$check->login(); }
?>
<?php
echo("<b>DJ Emails</b><br/>Keep In contact with the DJ's<br/><br/>");
switch($_GET["act"]);
$fetch = mysql_fetch_array(mysql_query("SELECT `username`, `email` FROM `users`");
echo("<b>{$fetch["username"]}</b> - {$fetch["email"]}");
break;
default:
}
?>
Try that.
-
Parse error: syntax error, unexpected ';', expecting ':' or '{' in /home/crazyhab/public_html/staff/emails.php on line 11
Nope :(
-
PHP Code:
<?php
if(isset($_SESSION["EON_CNTPNL_USERNAME"]))
{ $check->login(); }
else{
session_start();
$check = new checklogin;
$check->login(); }
?>
<?php
echo("<b>DJ Emails</b><br/>Keep In contact with the DJ's<br/><br/>");
switch($_GET["act"]){
$fetch = mysql_fetch_array(mysql_query("SELECT `username`, `email` FROM `users`");
echo("<b>{$fetch["username"]}</b> - {$fetch["email"]}");
break;
default:
}
?>
duh me :P
-
I got it working, but ill tell you if your script works :p
Im gona add a few more features to Kristal Panel :)
-
For future references, just use if / else statements if you don't know how to use case's D:
PHP Code:
<?php
if(isset($_SESSION["EON_CNTPNL_USERNAME"]))
{ $check->login(); }
else{
session_start();
$check = new checklogin;
$check->login(); }
?>
<?php
echo("<b>DJ Emails</b><br/>Keep In contact with the DJ's<br/><br/>");
$fetch = mysql_fetch_array("SELECT `username`, `email` FROM `users` ORDER BY `id` ASC");
while($zomfg = mysql_fetch_array($fetch))
{
echo("<b>{$zomfg["username"]}</b> - {$zomfg["email"]}");
}
?>