PHP

Moderators: None (Apply to moderate this forum)
Number of threads: 1845
Number of posts: 5013

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Help with PHP for website Posted by hedgehog333 on 3 Feb 2006 at 7:45 AM
Hello,
I'm setting up a website and when I try to access it at www.url.com/random/admin.php it brings up a login page. I enter my login details but it doesn't work. Here's my config.php script, hopefully someone can help me out.

<?
// config.php

// all varaibles must be defined

// mysql:
$conf[table] = "people"; // do not alter
$conf[ipnlog] = "ipnlog"; // do not alter
$conf[dbuser] = "danfai10_db";
$conf[dbpass] = "xxxxxxx";
$conf[dbname] = "danfai10_db";
$conf[dbhost] = "coconia.net";

// site specific:
$conf[domain] = "danfai10.coconia.net"; // without www or http://
$conf[subdir] = "random/"; // sub folder
$conf[bgcolor] = "#800000";
$conf[adminsremail] = "xxxxxxx@hotmail.com"; // admin spam report email
$conf[rname] = "Big Cash Stormpay Randomizer!"; // Randomizer name
$conf[rcost] = "5"; // cost to pay sponsor
$conf[acost] = "5";
$conf[spay_admin] = "xxxxxxxx@hotmail.com";

// admin:
$conf[adminuser] = "admin";
$conf[adminpass] = "xxxxxxx";
$conf[fromemail] = "xxxxxxxxxx@hotmail.com";


$conf[ipn_code] = "ipncode";


// define price array
$plst['2.50'] = 1;
$plst['5.00'] = 2;
$plst['8.00'] = 4;
$plst['15.00'] = 8;
$plst['30.00'] = 16;
$plst['60.00'] = 30;
$plst['90.00'] = 50;
$plst['150.00'] = 100;
$plst['240.00'] = 200;
$plst['400.00'] = 500;

function output_content($layout, $cont = '') {
global $conf;
$fp = fopen($layout.".html", "r");
$content = '';
while(!feof($fp)) {
$content .= fread($fp, 1024);
}
fclose($fp);
$content = str_replace("%{r_name}", $conf[rname], $content);
$content = str_replace("%{admin_semail}", $conf[adminsremail], $content);
$content = str_replace("%{bgcolor}", $conf[bgcolor], $content);
$content = str_replace("%{r_amount}", $conf[rcost], $content);
if($layout == "admin") {
$content = str_replace("%{admin}", $cont, $content);
} else {
$content = str_replace("%{s_domain}", $conf[domain], $content);
$content = str_replace("%{s_dir}", $conf[subdir], $content);
$content = str_replace("%{a_amount}", $conf[acost], $content);
$content = str_replace("%{p_email}", $conf[spay_admin], $content);
}
return($content);
}
Report
Re: Help with PHP for website Posted by tvienti on 3 Feb 2006 at 3:07 PM
You're going to have to give us some more information than that. For starters, when you say "it doesn't work", what exactly do you mean?

: Hello,
: I'm setting up a website and when I try to access it at www.url.com/random/admin.php it brings up a login page. I enter my login details but it doesn't work. Here's my config.php script, hopefully someone can help me out.
:
: <?
: // config.php
:
: // all varaibles must be defined
:
: // mysql:
: $conf[table] = "people"; // do not alter
: $conf[ipnlog] = "ipnlog"; // do not alter
: $conf[dbuser] = "danfai10_db";
: $conf[dbpass] = "xxxxxxx";
: $conf[dbname] = "danfai10_db";
: $conf[dbhost] = "coconia.net";
:
: // site specific:
: $conf[domain] = "danfai10.coconia.net"; // without www or http://
: $conf[subdir] = "random/"; // sub folder
: $conf[bgcolor] = "#800000";
: $conf[adminsremail] = "xxxxxxx@hotmail.com"; // admin spam report email
: $conf[rname] = "Big Cash Stormpay Randomizer!"; // Randomizer name
: $conf[rcost] = "5"; // cost to pay sponsor
: $conf[acost] = "5";
: $conf[spay_admin] = "xxxxxxxx@hotmail.com";
:
: // admin:
: $conf[adminuser] = "admin";
: $conf[adminpass] = "xxxxxxx";
: $conf[fromemail] = "xxxxxxxxxx@hotmail.com";
:
:
: $conf[ipn_code] = "ipncode";
:
:
: // define price array
: $plst['2.50'] = 1;
: $plst['5.00'] = 2;
: $plst['8.00'] = 4;
: $plst['15.00'] = 8;
: $plst['30.00'] = 16;
: $plst['60.00'] = 30;
: $plst['90.00'] = 50;
: $plst['150.00'] = 100;
: $plst['240.00'] = 200;
: $plst['400.00'] = 500;
:
: function output_content($layout, $cont = '') {
: global $conf;
: $fp = fopen($layout.".html", "r");
: $content = '';
: while(!feof($fp)) {
: $content .= fread($fp, 1024);
: }
: fclose($fp);
: $content = str_replace("%{r_name}", $conf[rname], $content);
: $content = str_replace("%{admin_semail}", $conf[adminsremail], $content);
: $content = str_replace("%{bgcolor}", $conf[bgcolor], $content);
: $content = str_replace("%{r_amount}", $conf[rcost], $content);
: if($layout == "admin") {
: $content = str_replace("%{admin}", $cont, $content);
: } else {
: $content = str_replace("%{s_domain}", $conf[domain], $content);
: $content = str_replace("%{s_dir}", $conf[subdir], $content);
: $content = str_replace("%{a_amount}", $conf[acost], $content);
: $content = str_replace("%{p_email}", $conf[spay_admin], $content);
: }
: return($content);
: }
:




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.