Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[PHP] Simple change catalogus in housekeeping [PHX]

Newbie Spellweaver
Joined
Oct 21, 2013
Messages
7
Reaction score
3
Housekeeping tool for change catalogus and automic update in client if you wont use phpmyadmin
You can use it to any database if you change the catalog_pages table to you'r one settings
Save as catalog.php and include you config
Code:
 <script type="text/javascript">        
        function change_url(val) {
        window.location=val;
    }
    </script>
            <select name="dynamic_select" onchange="change_url(this.value);">
                <option value="select_page">Select a page</option>
                    <?php 
                    $sql = mysql_query("SELECT * FROM catalog_pages ORDER BY caption ASC");
                    while($row = mysql_fetch_array($sql)) 
                        {    
                            echo'<option value="catalog.php?show='.$row['id'].'">'.$row['caption'].'</option>';
                        }
                    ?>
        
            </select>
    </p>    
<?php 
    $cataID = htmlspecialchars($_GET['show']);
    $sql = mysql_query("SELECT * FROM catalog_pages WHERE id = '".$cataID."' LIMIT 1");
    while($row = mysql_fetch_array($sql))
        {
?>
You want to change this table? Click change</br>
<form action="catalog.php?edit=<?php echo $row['id']; ?>" method="post" >
Name:</br>
<input type="text" value="<?php echo $row['caption']; ?>" readonly></br>
VIP:</br>
<input type="text" value="<?php echo $row['vip_only']; ?>"  readonly></br>
Rank:</br>
<input type="text" value="<?php echo $row['min_rank']; ?>"  readonly></br>
Text:</br>
<textarea name="text" cols="35" rows="5" readonly><?php echo $row['page_text1']; ?></textarea></br>
Action:</br>
<input type="submit" value="Change" />
</form>
<?php 
}




$cataID = htmlspecialchars($_GET['edit']);
$sql = mysql_query("SELECT * FROM catalog_pages WHERE id = '".$cataID."' LIMIT 1");
while($row = mysql_fetch_array($sql))
    {
    if(isset($_POST['submit']))
        { 
            $catalog_name = mysql_real_escape_string($_POST['caption']);
            $catalog_vip = mysql_real_escape_string($_POST['vip']);
            $catalog_rank = mysql_real_escape_string($_POST['rank']);
            $catalog_text = mysql_real_escape_string($_POST['text']);
            mysql_query("UPDATE catalog_pages SET caption='".$catalog_name."', vip_only='".$catalog_vip."', min_rank='".$catalog_rank."', page_text1='".$catalog_text."' WHERE id= '".$cataID."'") or die(mysql_error());
            echo "<meta http-equiv='refresh' content='0' >";
            function Mus($header, $data = '')
                {
                    $port = 30001;
                    $ip = "127.0.0.1";
                    $musData = $header . chr(1) . $data;
                    $sock = @[I][B][URL="http://forum.ragezone.com/members/1333431411.html"]Socket[/URL][/B][/I]_create(AF_INET, SOCK_STREAM, getprotobyname('tcp'));
                    @[I][B][URL="http://forum.ragezone.com/members/1333431411.html"]Socket[/URL][/B][/I]_connect($sock, $ip, intval($port));
                    @[I][B][URL="http://forum.ragezone.com/members/1333431411.html"]Socket[/URL][/B][/I]_send($sock, $musData, strlen($musData), MSG_DONTROUTE);
                    @[I][B][URL="http://forum.ragezone.com/members/1333431411.html"]Socket[/URL][/B][/I]_close($sock);
                    Mus("update_catalogue",""); 
            }
        }
?>
<form method="post" >
Name:</br>
<input type="text" value="<?php echo $row['caption']; ?>" name="caption"></br>
VIP:</br>
<input type="text" value="<?php echo $row['vip_only']; ?>"  name="vip"></br>
Rank:</br>
<input type="text" value="<?php echo $row['min_rank']; ?>"  name="rank"></br>
Text:</br>
<textarea name="text" cols="35" rows="5"><?php echo $row['page_text1']; ?></textarea></br>
Action:</br>
<input type="submit" value="Save" name="submit" />
</form>
<?php } ?>

Sorry for bad english im dutch
Credits
MertPHP
Aaron (For phoenix databse & emulator)
 
Skilled Illusionist
Joined
Jul 30, 2008
Messages
340
Reaction score
50
Thanks for the share. I don't need it myself, because i use coldfusion and not PHP. But other's will use it, and are so pathetic that they won't even put down a comment. So thanks for this!
 
Newbie Spellweaver
Joined
Oct 21, 2013
Messages
7
Reaction score
3
Thanks for the share. I don't need it myself, because i use coldfusion and not PHP. But other's will use it, and are so pathetic that they won't even put down a comment. So thanks for this!

:) Thankyou this motivate me to release good things
 
Skilled Illusionist
Joined
Jul 30, 2008
Messages
340
Reaction score
50
:) Thankyou this motivate me to release good things


You're welcome bro! Keep up the good work! If you keep it up, one day you will maybe be a famous person. Like meth0d or something.
 
Newbie Spellweaver
Joined
Mar 26, 2014
Messages
50
Reaction score
5
Nice to see some releases, keep up the good work! :)
 
Initiate Mage
Joined
Feb 22, 2013
Messages
1
Reaction score
0
Hey guy,
when i click on one page from the catalogue, the script send me to the startpage of the housekeeping.
need help, thanks.
 
Back
Top