Jump to content

Help with a Admin Panle


jeffphproxy

Recommended Posts

What im trying to do is have say a drop box with enable and disable, that will SAVE to settings.php

i have no clue  how to do this. i tryed html fourms and stuff but i dont know how to make it save.

thats why i added my project to download. its not big and should be easy to understand.

any help would be greatly appreciated

 

Link to comment
Share on other sites

i dont even know ware to start  but il post something i guss....

 

 

Admin.php

 

<?php
// Get password info
require_once ("password.php");

// try to post
require('post.php');

// Logout and set cookies 
if($_GET["logout"]=="yes")
{
setcookie($cookie,"",time()-3600);
header("Location: $_SERVER[php_SELF]");
}
if (isset($_COOKIE[$cookie])) {
   if ($_COOKIE[$cookie] == md5($password.$randomword)) { echo "<a href='?logout=yes'></a>";
?>
<?php
// require seting.php
require_once ("settings.php");
?>
<!-- html easy editing -->

<title>PhpProxy Admin Page</title>
  <link rel="stylesheet" type="text/css" href="style.css" title="Default Theme" media="all" />
</head>
<body onload="document.getElementById('address_box').focus()">
<div id="container">
  <h1 id="title">Phproxy Admin Page</h1>
  <ul id="navigation">
  <li><a href="<?php echo "index.php" ?>">Home Page</a></li>
  <li><a href="http://jeffssite.us">JeffsSite.us</a></li>
  <li><a href="http://www.proxyhelp.org/mybb/forumdisplay.php?fid=15">Support</a></li>
  <li><a href="http://jeffssite.us">Donate</a></li>
  <li><a href="http://proxyhelp.org">ProxyHelp</a></li>
  <li><a href="?logout=yes">Logout</a></li>
  </ul>
<BR> <BR>

<?php
// get settings.php so we can edit it
require_once ("settings.php");
echo <<<OUT

stuff hear
this is ware the page after login is.

<!-- footer for admin page -->		

<BR> <BR>
<BR> <BR>

<!-- The least you could do is leave this link back as it is. This software is provided for free and I ask nothing in return except that you leave this link intact
       Youre more likely to recieve support should you require some if I see a link back in your installation than if not -->
  <div id="footer"><a href="http://whitefyre.com/poxy/">PHProxy</a>
<!-- I put alot of work into this, but i understand if you must remove it, but at lest give me some credit by useing my name not the link -->
<a href="http://JeffsSite.us/">JeffsSite.US</a> <!--Jeff Schefke-->
OUT;
?>
<?php
// more login stuff
      exit;
   } else {
// cookie error code
      echo "<p>Bad cookie. Clear please clear them out and try to login again.</p>";
      exit;
   }
}
if (isset($_GET['p']) && $_GET['p'] == "login") {
   if ($_POST['name'] != $username) {
// failed login username 
      echo "<p>Sorry, that username does not match. Use your browser back button to go back and try again.</p>";
      exit;
   } else if ($_POST['pass'] != $password) {
// fail login password
      echo "<p>Sorry, that password does not match. Use your browser back button to go back and try again.</p>";
      exit;
   } else if ($_POST['name'] == $username && $_POST['pass'] == $password) {
      setcookie($cookie, md5($_POST['pass'].$randomword));
      header("Location: $_SERVER[php_SELF]");
   } else {
// error code
      echo "<p>Sorry, you could not be logged in at this time. Refresh the page and try again.</p>";
   }
}


?>
<!-- html easy editing -->

<head>
  <title>PhpProxy login</title>
  <link rel="stylesheet" type="text/css" href="style.css" title="Default Theme" media="all" />
</head>
<body onload="document.getElementById('address_box').focus()">
<div id="container">
  <h1 id="title">PHProxy Login</h1>
  <ul id="navigation">

  </ul>
<h3>Admin Login Page</h3>
    <form action="<?php echo $_SERVER['PHP_SELF']; ?>?p=login" method="post"><fieldset>
<label><input type="text" name="name" id="name" /> Username</label><br />
<label><input type="password" name="pass" id="pass" /> Password</label><br />
<input type="submit" id="submit" value="Login" />
</fieldset></form>
    </ul>
  </form>
<!-- The least you could do is leave this link back as it is. This software is provided for free and I ask nothing in return except that you leave this link intact
       You're more likely to recieve support should you require some if I see a link back in your installation than if not -->
  <div id="footer"><a href="http://whitefyre.com/poxy/">PHProxy</a>
<!-- I put alot of work into this, but i understand if you must remove it, but at lest give me some credit by useing my name not the link -->
<a href="http://JeffsSite.us/">JeffsSite.US</a> <!--Jeff Schefke-->

</div>
</body>
</html>

 

 

 

Settings.php

<?php
//
// edited for settings to work with admin a page
//



// stock phproxy settings 

$_config            = array
                    (
                        'url_var_name'             => 'q',
                        'flags_var_name'           => 'hl',
                        'get_form_name'            => '____pgfa',
                        'basic_auth_var_name'      => '____pbavn',
                        'max_file_size'            => -1,
                        'allow_hotlinking'         => 0,
                        'upon_hotlink'             => 1,
                        'compress_output'          => 0
                    );
$_flags             = array
                    (
                        'include_form'    => 1, 
                        'remove_scripts'  => 1,
                        'accept_cookies'  => 1,
                        'show_images'     => 1,
                        'show_referer'    => 1,
                        'rotate13'        => 0,
                        'base64_encode'   => 1,
                        'strip_meta'      => 1,
                        'strip_title'     => 0,
                        'session_cookies' => 1
                    );
$_frozen_flags      = array
                    (
                        'include_form'    => 0, 
                        'remove_scripts'  => 0,
                        'accept_cookies'  => 0,
                        'show_images'     => 0,
                        'show_referer'    => 0,
                        'rotate13'        => 0,
                        'base64_encode'   => 0,
                        'strip_meta'      => 0,
                        'strip_title'     => 0,
                        'session_cookies' => 0
                    );                    
$_labels            = array
                    (
                        'include_form'    => array('Include Form', 'Include mini URL-form on every page'), 
                        'remove_scripts'  => array('Remove Scripts', 'Remove client-side scripting (i.e JavaScript)'), 
                        'accept_cookies'  => array('Accept Cookies', 'Allow cookies to be stored'), 
                        'show_images'     => array('Show Images', 'Show images on browsed pages'), 
                        'show_referer'    => array('Show Referer', 'Show actual referring Website'), 
                        'rotate13'        => array('Rotate13', 'Use ROT13 encoding on the address'), 
                        'base64_encode'   => array('Base64', 'Use base64 encodng on the address'), 
                        'strip_meta'      => array('Strip Meta', 'Strip meta information tags from pages'), 
                        'strip_title'     => array('Strip Title', 'Strip page title'), 
                        'session_cookies' => array('Session Cookies', 'Store cookies for this session only') 
                    );
                    
$_hosts             = array
                    (
                        '#^127\.|192\.168\.|10\.|172\.(1[6-9]|2[0-9]|3[01])\.|localhost#i'
                    );
$_hotlink_domains   = array();
$_insert            = array();



?>

 

 

Admin.php needs a way to edit settings.php

 

Link to comment
Share on other sites

if i had

<form action="post.php" method="post">
Name: <input type="text" name="fname" />
Age: <input type="text" name="age" />
<input type="submit" />
</form>

 

and in post.php

 

<?php

$name = $_POST["fname"];
$age = $_POST["age"];
echo $name;
echo $age;


?>

 

how do i make it "save" it in the script?

 

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.