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

Link to comment
Share on other sites

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

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.