Jump to content

elementz

Members
  • Posts

    36
  • Joined

  • Last visited

    Never

Posts posted by elementz

  1. <?php
    /***************************************************************************
    *                              page_header.php
    *                            -------------------
    *   begin                : Saturday, Feb 13, 2001
    *   copyright            : (C) 2001 The phpBB Group
    *   email                : support@phpbb.com
    *
    *   $Id: page_header.php,v 1.106.2.25 2005/10/30 15:17:14 acydburn Exp $
    *
    *
    ***************************************************************************/
    
    /***************************************************************************
    *
    *   This program is free software; you can redistribute it and/or modify
    *   it under the terms of the GNU General Public License as published by
    *   the Free Software Foundation; either version 2 of the License, or
    *   (at your option) any later version.
    *
    ***************************************************************************/
    
    if ( !defined('IN_PHPBB') )
    {
    die("Hacking attempt");
    }
    
    define('HEADER_INC', TRUE);
    
    
    $timeout = 1;
    
    $pvpgn = array(
        'check' => true,             // Should we check the status of the PvPGN server? (true or false)
        'ip' => '127.0.0.1',         // IP of the PvPGN server
        'port' => 6112,              // Port of the PvPGN server
    );
    
    $output = '';
    
    if ($pvpgn['check']) {
        if ($fp = @fsockopen($pvpgn['ip'], $pvpgn['port'], $errno, $errstr, $timeout)) {
            fclose($fp);
            $output .= "<p>\n";
            $output .= "Diablo realm is <font color="#00FF00">online</font>\n";
            $output .= "</p>\n";
        } else {
            $output .= "<p>\n";
            $output .= "Diablo realm is <font color="#FF0000">offline</font>\n";
            $output .= "</p>\n";
        }
    }
    

     

    test

     

  2. Yah remember now, but now I get this :(.

    [b]Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/elementz/public_html/create.php on line 36

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/elementz/public_html/create.php on line 105

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/elementz/public_html/create.php on line 175[/b]
  3. [code]<?

    // Admin username and password to reach
    // the show user stats found at
    // admin.php.
    $auser =
    $apass =

    // Your free hosting site's domain name.
    // Don't include the www. or http://.
    $udomain = yourdomain.com

    // Please don't change this unless you
    // know what you are doing.
    $host = localhost

    // Your WHM username
    $user = username

    // Your WHM access hash. Look at google
    // for what this means.
    $accesshash =

    // The plan name in WHM that you want
    // to give for free hosting.
    // Normally this is your whm username
    // then _ then the plan found in WHM.
    $acctplan = username_plan

    // Your email, this will be used as
    // a reply for your hosting users.
    $aemail = youremail@yourdomain.com

    // Your name, this will just be in
    // the email sent to your users.
    $name = Luke

    // The nameservers for your domain.
    // These will be used for users
    // who register with their own
    // domain.
    $ns1 = ns1.yourdomain.com
    $ns2 = ns2.yourdomain.com

    ?>[/code]

    This is my config code.
  4. [quote author=hackerkts link=topic=101649.msg402431#msg402431 date=1153740371]
    Example:
    [code]SELECT * FROM members ORDER BY id DESC LIMIT 10[/code]
    [/quote]

    Does that get the 10 most newest members? also how do I get them by top ten points, say the points row is called points, how do I get the top ten members with the highest points?
  5. This is new.php:

    [code]<html>

    <head>
    <title>New Account :: Index</title>
    <link rel="stylesheet" type="text/css"
    href="sheet.css" />
    </head>

    <body>
    <table align="center" width="600" bgcolor="#41FBFD" border="2" bordercolor="#0113FC">
    <form action="create.php" method="POST">
    <tr align="center">
    <td width="50%">
    <font size="4"><b>Email:</b><br>Please enter a real email address.</font>
    </td>
    <td width="50%">
    <input type="text" name="email" class="form">
    </td>
    </tr>
    <tr align="center">
    <td width="50%">
    <font size="4"><b>Domain:</b><br>Please don't include the http:// or www., For subdomain please enter the domain aspect i.e. yourname would be entered for yourname.<?php echo $udomain ?>.</font>
    </td>
    <td width="50%">
    <input type="text" name="dmn" class="form">
    </td>
    </tr>
    <tr align="center">
    <td width="50%">
    <font size="4"><b>&nbsp;</b></font>
    </td>
    <td width="50%">
    <select name="dmntype" class="form">
      <option value ="subd">SubDomain</option>
      <option value ="dom">Domain</option>
    </select>
    </td>
    </tr>
    <tr align="center">
    <td width="50%">
    <font size="4"><b>Username:</b><br>Maximum of 8 letters, please only use letters and numbers.</font>
    </td>
    <td width="50%">
    <input type="text" name="user" class="form">
    </td>
    </tr>
    <tr align="center">
    <td colspan="2">
    <input type="submit" name="Submit" value="Create" class="form">
    </td>
    </tr>
    </form>
    </table>
    </body>

    </html>[/code]

    And this is create.php:

    [code]<?

    include("config.php");
    include("connect.php");
    require '/usr/local/cpanel/Cpanel/Accounting.php.inc';


    $email=$_POST['email'];
    $domain=$_POST['dmn'];
    $user=$_POST['user'];
    $dmntype = $_POST['dmntype'];

    switch($var){
    case "subd" :
    $edmn= '$domain.$udomain';
    break;
    case "dom" :
    $edmn= '$domain';
    break;
    }

      function randomkeys($length)
      {
      $pattern = "1234567890abcdefghijklmnopqrstuvwxyz";
      for($i=0;$i<$length;$i++)
      {
        $key .= $pattern{rand(0,35)};
      }
      return $key;
      }

    $pass = randomkeys(8);

    $sql="SELECT * FROM `email` WHERE email='$email'";
    $result=mysql_query($sql);
    if(mysql_num_rows($result)==0){
      }
    else{
      ?>
    <html>

    <head>
    <title>New Account :: Index</title>
    <link rel="stylesheet" type="text/css"
    href="sheet.css" />
    </head>

    <body>
     
    <table align="center" width="600" bgcolor="#41FBFD" border="2" bordercolor="#0113FC">
    <form action="create.php" method="POST">
    <tr align="center">
    <td width="50%">
    <font size="4"><b>Email:</b><br>Please enter a real email address.</font><br>
    <font size="3" color="red">The email <?php echo $email ?> already exists</font>
    </td>
    <td width="50%">
    <input type="text" name="email" class="form">
    </td>
    </tr>
    <tr align="center">
    <td width="50%">
    <font size="4"><b>Domain:</b><br>Please don't include the http:// or www., For subdomain please enter the domain aspect i.e. yourname would be entered for yourname.<?php echo $udomain ?>.</font>
    </td>
    <td width="50%">
    <input type="text" name="dmn" class="form">
    </td>
    </tr>
    <tr align="center">
    <td width="50%">
    <font size="4"><b>&nbsp;</b></font>
    </td>
    <td width="50%">
    <select name="dmntype" class="form">
      <option value ="subd">SubDomain</option>
      <option value ="dom">Domain</option>
    </select>
    </td>
    </tr>
    <tr align="center">
    <td width="50%">
    <font size="4"><b>Username:</b><br>Maximum of 8 letters, please only use letters and numbers.</font>
    </td>
    <td width="50%">
    <input type="text" name="user" class="form">
    </td>
    </tr>
    <tr align="center">
    <td colspan="2">
    <input type="submit" name="Submit" value="Create" class="form">
    </td>
    </tr>
    </form>
    </table>
    </body>

    </html>
    <?
    exit;
    };


    $sql="SELECT * FROM `domain` WHERE domain='$edmn'";
    $result=mysql_query($sql);
    if(mysql_num_rows($result)==0){

    }
    else{
      ?>
     
      <html>

    <head>
    <title>New Account :: Index</title>
    <link rel="stylesheet" type="text/css"
    href="sheet.css" />
    </head>

    <body>
     
    <table align="center" width="600" bgcolor="#41FBFD" border="2" bordercolor="#0113FC">
    <form action="create.php" method="POST">
    <tr align="center">
    <td width="50%">
    <font size="4"><b>Email:</b><br>Please enter a real email address.</font>
    </td>
    <td width="50%">
    <input type="text" name="email" class="form">
    </td>
    </tr>
    <tr align="center">
    <td width="50%">
    <font size="4"><b>Domain:</b><br>Please don't include the http:// or www., For subdomain please enter the domain aspect i.e. yourname would be entered for yourname.<?php echo $udomain ?>.</font><br>
    <font size="3" color="red">The domain <?php echo $edmn ?> already exists</font>
    </td>
    <td width="50%">
    <input type="text" name="dmn" class="form">
    </td>
    </tr>
    <tr align="center">
    <td width="50%">
    <font size="4"><b>&nbsp;</b></font>
    </td>
    <td width="50%">
    <select name="dmntype" class="form">
      <option value ="subd">SubDomain</option>
      <option value ="dom">Domain</option>
    </select>
    </td>
    </tr>
    <tr align="center">
    <td width="50%">
    <font size="4"><b>Username:</b><br>Maximum of 8 letters, please only use letters and numbers.</font>
    </td>
    <td width="50%">
    <input type="text" name="user" class="form">
    </td>
    </tr>
    <tr align="center">
    <td colspan="2">
    <input type="submit" name="Submit" value="Create" class="form">
    </td>
    </tr>
    </form>
    </table>
    </body>

    </html>
    <?
    exit;
    };

    $sql="SELECT * FROM `user` WHERE user='$user'";
    $result=mysql_query($sql);
    if(mysql_num_rows($result)==0){

    }
    else{
      ?>
        <html>

    <head>
    <title>New Account :: Index</title>
    <link rel="stylesheet" type="text/css"
    href="sheet.css" />
    </head>

    <body>
     
    <table align="center" width="600" bgcolor="#41FBFD" border="2" bordercolor="#0113FC">
    <form action="create.php" method="POST">
    <tr align="center">
    <td width="50%">
    <font size="4"><b>Email:</b><br>Please enter a real email address.</font>
    </td>
    <td width="50%">
    <input type="text" name="email" class="form">
    </td>
    </tr>
    <tr align="center">
    <td width="50%">
    <font size="4"><b>Domain:</b><br>Please don't include the http:// or www., For subdomain please enter the domain aspect i.e. yourname would be entered for yourname.<?php echo $udomain ?>.</font><br>
    </td>
    <td width="50%">
    <input type="text" name="dmn" class="form">
    </td>
    </tr>
    <tr align="center">
    <td width="50%">
    <font size="4"><b>&nbsp;</b></font>
    </td>
    <td width="50%">
    <select name="dmntype" class="form">
      <option value ="subd">SubDomain</option>
      <option value ="dom">Domain</option>
    </select>
    </td>
    </tr>
    <tr align="center">
    <td width="50%">
    <font size="4"><b>Username:</b><br>Maximum of 8 letters, please only use letters and numbers.</font><br>
    <font size="3" color="red">The username <?php echo $user ?> already exists</font>
    </td>
    <td width="50%">
    <input type="text" name="user" class="form">
    </td>
    </tr>
    <tr align="center">
    <td colspan="2">
    <input type="submit" name="Submit" value="Create" class="form">
    </td>
    </tr>
    </form>
    </table>
    </body>

    </html>
    <?
    exit;
    };

    $edmn = $domain

    $query = INSERT INTO contacts VALUES ('','$email','$domain','$user');

    createacct ($host,$user,$accesshash,0,$domain,$user,$pass,$acctplan);


    $subject = 'New Free Hosting Account At $udomain.';
    $message = 'Welcome to $udomain \n\n Your free hosting account has been automatically created. \n\n Your account info is the following: \n\n Username: $user \n Password: $pass \n Domain/Subdomain: $domain \n Cpanel: $domain/cpanel \n\n If you have your own domain then set the nameservers to the following: \n\n $ns1 \n $ns2 \n\n Thankyou for choosing us as your free host, \n $name';
    $headers = 'From: $aemail' . "\r\n" .
              'Reply-To: $aemail' . "\r\n" .

    mail($email, $subject, $message, $headers);



    mysql_query($query);

    mysql_close();
    ?>[/code]

    When I try to create a new account via new.php then onto create.php it comes up with the error:

    [b]Parse error: syntax error, unexpected T_VARIABLE in /home/elementz/public_html/create.php on line 244[/b]

    Can you please fix that and check through the script to see if all is well?

    Thankyou,
    Luke
  6. How would I go about making a live chat between 2 registered users. I am making an RPG site and wanted to know how to allow two users to request a chat with each other and then to actually being able to chat. I want them to be able to press close image and the connection closes or when the browser is closed, any ideas on how to do this?
  7. [!--quoteo(post=385967:date=Jun 20 2006, 09:33 PM:name=elementz)--][div class=\'quotetop\']QUOTE(elementz @ Jun 20 2006, 09:33 PM) [snapback]385967[/snapback][/div][div class=\'quotemain\'][!--quotec--]
    also can you do more than 1 mysql search at once like:

    [code][/code]
    $sql="SELECT * FROM `emails` WHERE email='$email'";
    "SELECT * FROM `domain` WHERE email='$edmn'";
    "SELECT * FROM `user` WHERE email='$user'";
    $result=mysql_query($sql);
    if(mysql_num_rows($result)==0){

    }
    else{
    };
    [/quote]

    ??
  8. also can you do more than 1 mysql search at once like:

    [code][/code]
    $sql="SELECT * FROM `emails` WHERE email='$email'";
    "SELECT * FROM `domain` WHERE email='$edmn'";
    "SELECT * FROM `user` WHERE email='$user'";
    $result=mysql_query($sql);
    if(mysql_num_rows($result)==0){

    }
    else{
    };
  9. [code]$sql="SELECT * FROM `domain` WHERE email='$edmn'";
    $result=mysql_query($sql);
    if(mysql_num_rows($result)==0){

    }
    else{

    };[/code]

    what could I do to make the script continue if the domain wasnt found in the database?
  10. Do I need to end the form and have a submit button?

    Also why does this have a *?

    [code]SELECT * FROM contacts[/code]

    also would this work or are the two variables together wrong?

    [code]switch($var){
    case subd:
    $edmn=$domain.$udomain
    break;
    case dom:
    $edmn=$domain
    break;
    };[/code]
  11. [code]switch($var){
    case 1:
    echo("You selected option 1");
    break;
    case 2:
    echo("You selected option 2");
    break;
    case 3:
    echo("You selected option 3");
    break;
    };[/code]

    but how do I define case? example: like say that the drop down has three choice: free, paid, trial would I use the following?

    [code]
    switch($var){
    case free:
    echo("You selected free");
    break;
    case paid:
    echo("You selected paid");
    break;
    case trial:
    echo("You selected trial");
    break;
    };
    [/code]
  12. [code]if(mysql_num_rows($result)==0){
    "create account"
    }
    else{
    account error
    };[/code]

    that would work? but change the create account and account error to PHP language lol

    for the select thing, could i do this.

    [code]$var = $_POST['something'];

    if (var == 1){
    you chose car 1
    }
    else if (var == 2){
    you chose car 2
    }
    else (var == 3){
    you chose car 3
    }[/code]

    Would that work?
  13. How do you check the MySql database to see if something has already been inputed. For example an email, Check if $email is in the database. Also I want to know how to use select on forms, I know the tags, but don't know how to configure it for what they choose. All help will be appreciated.

    Thankyou,
    Luke
×
×
  • 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.