Jump to content
Welcome, Guest
Existing user? Sign In

Sign In



Sign Up
The MatriX
  • Welcome To Ghbsys
  • CS GO Streaming Version is released. Have fun streaming while cheating!
  • Have a Payment Issue? Send us a Support ticket.
  • Make a thread if you need support or join our discord for live support.
  • Have Suggestions? Make a thread and you'll earn Ghbsys Points for implemented suggestions.
  • Join our discord to stay well connected! Don't forget to integrate your discord to the site
  • Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum

    Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum, like most online communities you must register to view or post in our community, but don't worry this is a simple free process that requires minimal information for you to signup. Be apart of [GHB] - GAmEhAcKbAsTaRdS Forum by signing in or creating an account.
    • Start new topics and reply to others
    • Subscribe to topics and forums to get email updates
    • Get your own profile page and make new friends
    • Send personal messages to other members.

    abc.php in def.php einfügen?


    Recommended Posts

    Also meine frage ist wie füge ich eine php funktion von punkt a in punkt b ein?

    bsp.:

    in neskes.de/time.php is nur die funktion datum und uhrzeit anzeigen

    <?php
    $timestamp = time();
    $datum = date("d.m.Y - H:i", $timestamp);
    echo $datum;
    ?>

    (weis nicht ob man bei datum auch noch mal $timestamp schreiben muss aber egal)

     

    nun möchte ich bsp auf meiner neskes.de/index.php einfach wie bsp in c++, java, oder vb diese funktion einfügen wie include bei c++ oder input bei java das

    ich diese funktion bsp. !time nen

    und wen ich iwo jetzt auf der index.php !time schreibe und dann uploade das die funktion auch dort angezeigt wird wist ihr was ich mein? wen ja geht das? und wie?

    Link to comment
    Share on other sites

    funktioniert einwand frei wen einer wissen will wie:

     

    in time.php folgenden code:

    <?php
    $time = $timestamp = time(); $datum = date("d.m.Y - H:i", $timestamp); echo $datum;
    
    ?>

     

    in die index einfach nur:

    <?php
    include 'vars.php';
    
    $time
    
    ?>

    über all wo ihr nun $time schreibt wird die zeit mit datum angezeigt xD

    Link to comment
    Share on other sites

    • 2 months later...

    Hinzufuegung:

     

    Include(): Fuegt eine Datei ins Script ein, woraus alle Variablen und Funktionen benutzt werden koennen. Wenn ein Fehler auftretet, geht das script trotzdem weiter nur die Includete Datei funktioniert nicht.

     

    Require(): Wie Include(), nur wenn es 1 Fehler gibt, hoert das ganze script auf zu arbeiten. Praktisch fuer wenn man fremde dateien includen will (zB anti sql injection und fehlerquellenaufspuerung usw^^)

     

    Um in die Root-Directory von deinem Host zu kommen, schreibst du: "../functions.php", die wird aus der Root gezogen.

    Um in demselben Ordner zu arbeiten, einfach "functions.php" und um in ner anderen directory was zu holen: "../andererOrdner/functions.php"

    Link to comment
    Share on other sites

    • 2 months later...

    functions.php

    <?php
    function MyTime() {
    $datum = date("d.m.Y - H:i", time());
    return printf($datum);
    }
    ?>

    index.php

    require_once('functions.php');
    echo "Current time is: <b>".MyTime()."</b>!";

     

    hope i helped.

     

     

    -----------------------------------------------------------------------

    Functions are better, but if i readed good, u wanted the VARs only.

    just use the same but then the vars.. Like..

     

    vars.php

    <?php
    $datum = date("d.m.Y - H:i", time());
    ?>

    index.php

    <?php
    require_once('vars.php');
    echo "Current time is: <b>".$datum."</b>!";
    ?>

    Edited by Sayuta
    Link to comment
    Share on other sites

    Guest
    This topic is now closed to further replies.
     Share

    • Recently Browsing   0 members

      • No registered users viewing this page.
    ×
    ×
    • Create New...