Jump to content

[SOLVED] Small script problem


j634

Recommended Posts

Hi all,

 

I have this script that I can't seem to get working. No matter what I do only the code shows on the page. Could someone take a quick peek and see if they can find the problem?

 

<?php 
/*************************************************************************** 
*                                pg_hyip_all.php 
*                            ------------------- 
*   begin                : Sunday,jan 1,2006 
*   copyright            : (C) 2001 The ShowHyip Group 
*   email                : [email protected] 
* 
*   $Id: pg_hyip_all.php,v 0.0.0.1 2005/10/31 07:31:06 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. 
* 
***************************************************************************/ 
echo ' 
<HTML><HEAD><TITLE>hyip monitors example</TITLE></HEAD> 
<STYLE type=text/css> 
TD.hatitle {FONT-FAMILY: Verdana,Arial,Helvetica,sans-serif; FONT-SIZE: 14px; FONT-FAMILY: Verdana;} 
</STYLE><BODY> 
'; 

define("dc_ha_count","dcount"); 
define("dc_ha_id","did"); 
define("dc_ha_name","dname"); 
define("dc_ha_status","dstatus"); 
define("dc_ha_url","durl"); 
define("dc_ha_arate","darate"); 
define("dc_ha_urate","durate"); 
define("dc_ha_adate","dadate"); 
define("dc_ha_udate","dudate"); 
define("dc_ha_infocount","dinfocount"); 
define("dc_ha_kw1","dkw1"); 
define("dc_ha_kw2","dkw2"); 
define("dc_ha_kw3","dkw3"); 
define("dc_ha_kw4","dkw4"); 
define("dc_ha_kw5","dkw5"); 
define("dc_ha_value","dvalue"); 
define("dc_ha_site","dsite"); 

define("dc_ha_desc","ddesc"); 

define("d_ha_table_cfg","ha_cfg"); 
define("d_ha_table_all","ha_all"); 

define("d_ha_cfg_count","dcfg_count"); 
define("d_ha_cfg_utime","dcfg_utime"); 
if (1) {$hyip_mysql_host = "localhost";  $hyip_mysql_user = "user";      $hyip_mysql_pwd = "password";          $hyip_mysql_db = "hyip";} 
class CPHPMysql{ 
  var $link,$select; 
  function CPHPMysql(){$this->link = 0;$this->select = 0;$this->Connect();$this->DbSelect();} 
  function Connect() { 
    if ($this->link) { return FALSE;} 
    global $hyip_mysql_host,$hyip_mysql_user,$hyip_mysql_pwd; 
    $this->link = mysql_connect($hyip_mysql_host,$hyip_mysql_user,$hyip_mysql_pwd); 
    if (!$this->link){die('Could not connect: '. $hyip_mysql_host . mysql_error());return TRUE;} 
    return FALSE; 
  } 
  function DbSelect(){ 
    if ($this->select){return FALSE;} 
    global $hyip_mysql_db; 
    $this->select = mysql_select_db($hyip_mysql_db,$this->link); 
    if ($this->select){return FALSE;} 
    else { 
      $sql = "CREATE DATABASE $hyip_mysql_db"; 
      if (mysql_query($sql,$this->link)){ 
         $this->select = mysql_select_db($hyip_mysql_db,$this->link); 
         if ($this->select){return FALSE;} 
         else {return TRUE;} 
      } 
      else {return TRUE;} 
    } 
  } 
  function DbQuery($sql){ 
    $resource = mysql_query($sql,$this->link); 
    if (0){echo "SQL:$sql<br>";if ($resource) {echo "DbQuery successfully<br>\n";} else {echo 'DbQuery:',mysql_error()."<br>\n";}} 
    return $resource; 
  } 
} 
$g_mysql = new CPHPMysql(); 

function HaFavCreate(){ 
  global $g_mysql; 
  $test = sprintf("select * from %s",d_fav_table); 
  $resource = $g_mysql->DbQuery($test); 
  if (!$resource){ 
    $sql = sprintf("CREATE TABLE %s (%s INTEGER NOT NULL AUTO_INCREMENT UNIQUE PRIMARY KEY,%s VARCHAR(32),%s VARCHAR(64),%s INT ZEROFILL)",d_fav_table,"id",d_fav_user,d_fav_hyipname,d_fav_adate); 
    $g_mysql->DbQuery($sql); 
  } 
} 
function HaFavAdd($user,$hyipname){ 
  global $g_mysql; 
  $test = "select * from ".d_fav_table." where ".d_fav_user."=\"".$user."\" and ".d_fav_hyipname."=\"".$hyipname."\""; 
  $resource = $g_mysql->DbQuery($test); 
  if ($resource){$row = mysql_fetch_array($resource);if ($row){return 0;};}else{HaFavCreate();} 
  $sql = sprintf("INSERT INTO %s(%s,%s,%s) VALUES( \"%s\",\"%s\",%d)",d_fav_table,d_fav_user,d_fav_hyipname,d_fav_adate,$user,$hyipname,time()); 
  $g_mysql->DbQuery($sql); 
} 
//HaAllCountSet(); 
$sql = sprintf("select * from %s",d_ha_table_cfg); 
$res = $g_mysql->DbQuery($sql); 
if ($res){ 
  while($row = mysql_fetch_array($res)){ 
  if ($row[dc_ha_name] == d_ha_cfg_count)  $ha_all_count = intval($row[dc_ha_value]); 
  if ($row[dc_ha_name] == d_ha_cfg_utime)  $ha_all_utime = $row[dc_ha_value]; 
  } 
} 
$cur_page = 0;          if (isset($_GET['pg']))   {$cur_page = intval($_GET['pg']); } 
$ha_kw = "";            if (isset($_GET["kw"]))   {$ha_kw = $_GET["kw"];  } 
$ha_parm = dc_ha_urate; if (isset($_GET["parm"])) {$ha_parm = $_GET["parm"]; } 
function HaAllShow($start = 0){ 
  global $g_mysql,$ha_all_count,$ha_parm,$ha_kw; 
  $page_name_fav="pg_hyip_all.php?parm=$ha_parm

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/80774-solved-small-script-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.