Jump to content

Need to make this code work it is a php news ticker


ssurya

Recommended Posts

<?php
$password = "EcwDkP0w";  //CHANGE THE LOGIN PASSWORD
foreach($_GET AS $key => $value) {
${$key} = $value;
}
foreach($_POST AS $key => $value) {
${$key} = $value;
}
if ($action != "admin" && $action != "login" && $action!= "temp3"){
?>
<?php
}
if ($action=="admin"){
?>
<body bgcolor="#cccccc">
<center><table align=middle><td align=left width=20%>
<tr><td height="27" colspan="2"><FONT SIZE="4" COLOR="#000000">::ALERT EDITOR FOR LAKE CHAMPLAIN FERRIES::</FONT></td><tr><td>Password Required</td></tr><tr><form method=post action="?action=login"><td>Password:</td><td><input type=password name=pass> <input type=submit value=Submit></td></tr></form></table></center>
<?php
}
if ($action=="login"){
if ($pass==$password){
echo"Login successful";
$fd = fopen ("news.txt", "r"); 
$stuff = fread ($fd, filesize ("news.txt")); 
fclose ($fd);
?>
<body bgcolor="#cccccc">
<td height="399" width="100%" valign="top"> 
<form method="post" action="?action=temp3&te=news.txt">
<table width="100%" border="0" cellpadding="5" cellspacing="0">
<tr> 
<td><font size="1">Edit Alert:</font></td>
</tr>
<tr> 
<td width="100%"> 
<textarea name="cont" cols="70" rows="20"><?php  echo $stuff ?></textarea>
</td>
</tr>
<tr> 
<td width="86%">  
<input type="submit" name="Submit" value="Save"><input type="button" name="Cancel" value="Cancel" onClick="javascript: history.back(1)">
</td>
</tr>
<tr> 
</tr>
</table>
</form>
<?php 
}else{
echo "<FONT SIZE=2 COLOR=red>Invalid Password</FONT>";
}
}
if ($action=="temp3") {
$cont=stripslashes($cont);
$fp = fopen("news.txt", "w");
fputs($fp, $cont);
fputs($fp, "\n");
fclose($fp);
?>
<body bgcolor="#cccccc">
<BR><BR><font size="2">News Edited Successfully<BR></font>
<?php 
}
?>

actually this is a part of news ticker  with a back end but this was not working so i need a code which will work and have a backend to modify the news

no actually i got this code but this has some problem which i cannot find out ( the above mentioned code is for updating a news ticker

with which we can add news through adminpanel ) the adminpanel was working but some how the ticker is not showing up

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.