Jump to content

andrewq2

Members
  • Posts

    29
  • Joined

  • Last visited

Posts posted by andrewq2

  1. Hello^^

     

    I need help setting up my website and I need this information.

     

    1. I created a database and added a username to it.

    where I found them?

     

    $db_type

    $db_host

    $db_name

     

     

    2. My Installation requires:

    "Create a database, add a username to it, and >> import the installation SQL file."

     

    How do I do that?

     

    Waiting for your help,

     

    Thanks in advance^^

     

    Juliet

    The php vars are

    $db_type = "MyISAM"; most likely.

    $db_host = "localhost";

    $dbname = "the name of the mysql db";

    Here is a tut on how to use phpmyadmin to import a sql file

    http://www.dewahost.com/tutorials/cpanelx/importsqlfile.html

     

  2. Something like this should work.

     

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
    <script type="text/javascript">
    function hideElement(i) {
    var e = document.getElementById(i);
    if (e) {
    e.style.visibility = 'hidden';
    }
    }
    
    function showElement(i) {
    var e = document.getElementById(i);
    if (e) {
    e.style.visibility = 'visible';
    }
    } 
    </script>
    <title>Test Page</title>
    </head>
    <body>
    <div id="showhide">
    The Text<br/>
    <a href="java script:hideElement('showhide')">Hide</a><br/>
    </div>
    <p>
    <a href="java script:showElement('showhide')">Show</a><br/>
    </p>
    </body>
    </html>

  3. We had a ton of 500 errors a few weeks back on phpbb, so switched over to SMF. All in all, seems to be working much better then phpbb did, but we still get the occasional 500 error, for a couple minutes every few hours. Would this be something I broke, or something else? Server status seems to be good right now. Everything is up.

     

    Server Load 2.43 (4 cpus)

    Memory Used 56 %

    Swap Used 66.07 %

    Disk /dev/sda6 (/tmp) 58 %

    Disk /dev/sda7 (/home) 73 %

    Disk /dev/sda8 (/var/lib/mysql) 45 %

    Disk /dev/sda9 (/var/cpanel) 27 %

    Disk /dev/sda1 (/) 82 %

    Disk /dev/sda2 (/var) 67 %

    Disk /dev/sda3 (/usr) 93 %

    FYI This Category is for HelioNet errors not HeiloHost. But anyway a few other people including me have this error, for me it happens after uploading/ changing a server side file (php, perl, etc.)

  4. Hi. I have a game that's programmed in python, and I'm wondering how I would go about putting high scores for it on my domain here. It needs to be something that people can use without creating an account.

     

    EDIT: my domain name is zoneworlds.heliohost.org

     

    Is the game running on your website or a computer app? Also this is in the wrong section this should be in Website Management and Coding not Questions is for things like Server errors or a problem that has to do with HelioHost.

  5. This is pretty weird. Have you installed/done anything recently on your account?

    Made subdomain http://joad.aq-dev.co.cc nothing much else

     

    Update:

    It seams to be working now. Maybe it was the apache restart to add the sub domains that did it, What ever you did thank you. The customer service here is great for free hosting. Most free hosting places the errors don't get elevated to the server owner.

     

    Thanks,

     

    Andrew

     

    Update2:

     

    After i started uploading some files i went to test them but i am getting 500 error again..... This problem is going around in loops. Just a suggestion can you remake my account to see if that clears it up.

     

    Thanks,

     

    Andrew

     

    Update3:

     

    I just got my php scripts to work again what ever it is it happens randomly. I love this free hosting service but i might have to move to another host if this problem keeps happening.

     

    Thanks,

     

    Andrew

  6. Make sure you set ALL of your php pages and html pages to 644 as file permissions. Since you say you don't have an htaccess file, go to your cpanel and look for the link that says FrontPage Extensions and click uninstall.

    It said it was not installed so i cleaned up the extensions and it recreated a .htaccess file and chmod the files to 644.

  7. I was able to run that script without any errors. Check your file permissions for me and also try this piece of code for me:

     

    <?php phpinfo(); ?>

     

    just call it 'info.php'

     

     

     

    That's not a 500 Error, that's a 403 Forbidden. Check your htaccess.

    Ran it still 500 error, and i have no .htaccess also i changed the permissions to 755 same error.

  8. You need to post the url of your page and then post me the php script.

    url: http://aq-dev.co.cc/func.php

    code:

    <?PHP
    class SystemComponent {
       var $settings;
       function getSettings() {
           // System variables
           $settings['siteDir'] = '/home/andrewq2/public_html/';
           // Database variables
           $settings['dbhost'] = 'localhost';
           $settings['dbusername'] = 'andrewq2_aqdev';
           $settings['dbpassword'] = '************';
           $settings['dbname'] = 'andrewq2_aqdev';
           return $settings;
       }
    
    }
    class DbConnector extends SystemComponent {
    var $theQuery;
    var $link;
    //Function to connect to db
    function DbConnector(){
    	// load settings from the parrent class
    	$settings = SystemComponent::getSettings();
    	$host = $settings['dbhost'];
    	$db = $settings['dbname'];
    	$user = $settings['dbusername'];
    	$pass = $settings['dbpassword'];
    	//connect to mysql
    	$this->link = mysql_connect($host, $user, $pass);
    	mysql_select_db($db);
    	register_shutdown_function(array(&$this, 'close'));
    }
    //function to query the db
    function query($query){
    	$this->theQuery = $query;
    	return mysql_query($query, $this->link);
    }
    //function to fetch the querys results in a array
    function fetchArray($result){
    	return mysql_fetch_array($result);
    }
    //return last query for debugging
    function getQuery() {
    	return $this->theQuery;
    }
    //return the array as MYSQL_NUM
    function getNumRows($result){
    	return mysql_num_rows($result);
    }
    //function to close the connection
    function close(){
    	mysql_close($this->link);
    }
    }
    class Validator extends SystemComponent{
    var $errors;
    function validateNumber($theinput,$description = ''){
    	if(is_numeric($theinput)){
    		return true; //it is a number return true
    	}else{
    		$this->errors[]=$description;
    		return false;// value not numeric return false
    	}
    }
    function validateText($theinput,$description = ''){
    	if(is_string($theinput)){
    		return true; //it is a number return true
    	}else{
    		$this->errors[]=$description;
    		return false;// value not numeric return false
    	}
    }
    function validateDate($thedate,$description = ''){
    	if (strtotime($thedate) === -1 || $thedate == '') {
    		$this->errors[] = $description;
    		return false;
    	}else{
    		return true;
    	}
    }
    function validateEmail($theinput,$description = '') {
    	if(preg_match('/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+$/',$theinput)){
    		return true;
    	}else{
    		$this->errors[]=$description;
    		return false;
    	}
    }
    function foundErrors() {
    	if (count($this->errors) > 0){
    		return true;
    	}else{
    		return false;
    	}
    }
    function listErrors($delim = ' '){
    	return implode($delim,$this->errors);
    }
    function addError($description){
    	$this->errors[] = $description;
    }
    }
    class sentry {
    var $loggedin = false;	
    var $userdata;			
    function sentry(){
    	session_start();
    	header("Cache-control: private"); 
    }
    function logout(){
    	unset($this->userdata);
    	session_destroy();
    	return true;
    }
    function checkLogin($user = '',$pass = '',$goodRedirect = '',$badRedirect = ''){
    	$validate = new Validator();
    	$loginConnector = new DbConnector();
    	if ($_SESSION['user'] && $_SESSION['pass']){
    		if (!$validate->validateText($_SESSION['user'])){return false;}
    		if (!$validate->validateText($_SESSION['pass'])){return false;}
    		$getUser = $loginConnector->query("SELECT * FROM users WHERE user = '".$_SESSION['user']."' AND pass = '".$_SESSION['pass'].' AND enabled = 1');
    		if ($loginConnector->getNumRows($getUser) > 0){
    			if ($goodRedirect != '') { 
    				header("Location: ".$goodRedirect."?".strip_tags(session_id())) ;
    			}			
    			return true;
    		}else{
    			$this->logout();
    			return false;
    		}
    	}else{	
    		if (!$validate->validateTextOnly($user)){return false;}
    		if (!$validate->validateTextOnly($pass)){return false;}
    		$getUser = $loginConnector->query("SELECT * FROM users WHERE username = '$user' AND password = PASSWORD('$pass') AND enabled = 1");
    		$this->userdata = $loginConnector->fetchArray($getUser);
    		if ($loginConnector->getNumRows($getUser) > 0){
    			$_SESSION["user"] = $user;
    			$_SESSION["pass"] = $this->userdata['pass'];
    			$_SESSION["thegroup"] = $this->userdata['thegroup'];
    			if ($goodRedirect) { 
    				header("Location: ".$goodRedirect."?".strip_tags(session_id())) ;
    			}
    			return true;
    		}else{
    			unset($this->userdata);
    			if ($badRedirect) { 
    				header("Location: ".$badRedirect) ;
    			}		
    			return false;
    		}
    	}			
    }
    }
    ?>

×
×
  • Create New...