PDA

View Full Version : Help with Scritp...



Moh
03-01-2007, 04:42 PM
Im making a DJ Emails List for Kristal Panel (I think its called that)
and heres the 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:

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?

Lysine
03-01-2007, 09:11 PM
<?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:
}
?>

Moh
03-01-2007, 10:44 PM
still get error :(

Dentafrice1
03-01-2007, 10:45 PM
<?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.

Moh
03-01-2007, 11:16 PM
Parse error: syntax error, unexpected ';', expecting ':' or '{' in /home/crazyhab/public_html/staff/emails.php on line 11

Nope :(

Dentafrice1
03-01-2007, 11:34 PM
<?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

Moh
04-01-2007, 12:18 PM
I got it working, but ill tell you if your script works :p
Im gona add a few more features to Kristal Panel :)

Agnostic Bear
31-01-2007, 12:18 PM
For future references, just use if / else statements if you don't know how to use case's D:



<?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"]}");
}
?>

Want to hide these adverts? Register an account for free!