ssurya Posted November 4, 2011 Share Posted November 4, 2011 <?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 Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted November 4, 2011 Share Posted November 4, 2011 Are you asking for someone to write the code for you? Quote Link to comment Share on other sites More sharing options...
ssurya Posted November 4, 2011 Author Share Posted November 4, 2011 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.