Zurück   Flashforum > Flash und Server > Flash Remoting

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 28-07-2005, 13:04   #1 (permalink)
Neuer User
 
Registriert seit: Nov 2002
Beiträge: 41
db include im service?

Versuche schon eine ganze Weile ein File mit meinen Vars für die DB in meine Service-Datei zu includen - will aber nicht.
Jemand eine Ahnung?

meinservice.php
PHP-Code:
<?php    
class meinservice{
include(
'db.php');

    function 
meinservice()
    {        
        
$this->methodTable = array(
        
"login" => array(
                
"access" => "remote"
                 
"arguments" => array ("password")
            ),
        );

        
                
$this->conn mysql_pconnect($this->dbhost$this->dbuser$this->dbpass);
                
mysql_select_db ($this->dbname);

    }

        function 
login($pass) {
            return @
mysql_query("SELECT * FROM tbl_settings WHERE pass='$pass'"); 

     }
}
?>
db.php
PHP-Code:
<?
    
var $dbhost "localhost"
    var 
$dbname ="remoting";
    var 
$dbuser "root";
    var 
$dbpass "pass"
?>
Wenn ich den Inhalt von db.php in meinservice.php reinschreibe gehts.... So wie hier aber nicht
LooperX ist offline   Mit Zitat antworten
Alt 29-07-2005, 08:37   #2 (permalink)
-
 
Benutzerbild von floresistoned
 
Registriert seit: Apr 2002
Ort: Stuttgart
Beiträge: 57
Funktioniert so wunderbar:

PHP-Code:
<?php

class GetContent {    
    
    function 
GetContent ()
    {
        
$this->methodTable = array(
            
            
"getNews" => array(
                
"description" => "get news",
                
"access" => "remote"// available values are private, public, remote
                
"arguments" => array ()
            ),
            
"getClients" => array(
                
"description" => "get clients",
                
"access" => "remote"// available values are private, public, remote
                
"arguments" => array ()
            ),
            
"sendContactForm" => array(
                
"description" => "send contact form",
                
"access" => "remote"// available values are private, public, remote
                
"arguments" => array ("data")
            )
        );
        
        
// DB Connection
        
include('../../config/config.inc.php');
        
$this->db_conn mysql_connect(MYSQL_HOSTMYSQL_USERMYSQL_PASS);
        
mysql_select_db(MYSQL_DBNAME);
        
    }
    
    
// 
    
function getNews ()
    {
        return 
mysql_query("SELECT headline, text FROM web01_news ORDER BY timestamp DESC");
    }
    
    
// 
    
function getClients ()
    {
        return 
mysql_query("SELECT id, name FROM web01_clients ORDER BY name ASC");
    }
    
    
//
    
function sendContactForm ($data)
    {
        
// includes
        
include_once("../../scripts/php/classes/class.textmail.php");
        
        .
        .
        .
        
        
// create mail-object
        
$mail = new TextMail();
        
$mail->setTo("email""name");
        
$mail->setFrom($email$name);
        
$mail->setSubject("[Website-Formular] " $betreff);
        
$mail->setMessage($message);
        return 
$mail->send();    
    }
    
}

?>
floresistoned ist offline   Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind an
Pingbacks sind an
Refbacks sind an



Alle Zeitangaben in WEZ +1. Es ist jetzt 03:07 Uhr.

Domains, Webhosting & Vserver von Host Europe
Unterstützt das Flashforum!
Adobe User Group


Copyright ©1999 – 2012 Marc Thiele