Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    Richiamare funzioni in una pagina

    Ciao a tutti,

    ho un sito con un'area protetta creata con Pageprotect ( uno script scaricato da questo sito ).

    Lo script ha alcune funzioni richiamabili da altre pagine che permettono di visualizzare il nome dell'utente e il suo username.

    Lo script riporta una pagina di prova con questo codice:

    <body style="font-family:arial;text-align:center;">
    <h1>Examples of available functions:</h1>
    <h4>
    print_name():

    Hello <? print_name(); ?>!



    print_username():

    Your username is "<?php print_username(); ?>".

    che stampa appunto il nome e l'username con i quali ci si è loggati.

    ho ricreato lo stesso in una mia pagina .php con questo codice:


    <P align = "cente"><FONT size="4">
    Ciao <? print_name(); ?>!
    </P></FONT>


    bhè non ci crederete ma mi scrive solo Ciao!!! cos'è che non va?

    Grazie e ciao a tutti!

  2. #2
    Nella pagina d'esempio ci dovrebbe essere una riga dove i include il file con le funzioni print_...

    posta tutto il codice

  3. #3
    Ecco tutto il codice della pagina di esempio:

    <?php include "protect.php"; ?>
    <?php
    /////////////////////////////////////////////////////
    // //
    // PHPPageProtect //
    // V 1.0.0 //
    // //
    // Copyright 2001 //
    // David Broker //
    // php@warpedweb.net //
    // All Rights Reserved //
    // //
    // In using this script you //
    // agree to the following: //
    // //
    // This script may be used and modified //
    // freely as long as this //
    // copyright remains intact. //
    // //
    // You may not distibute this script, or //
    // any modifications of it. //
    // //
    // A link must be provided on the website that //
    // uses the script to: //
    // http://php.warpedweb.net/ //
    // //
    // Any breaches of these conditions //
    // will result in legal action. //
    // //
    // This script is distributed with //
    // no warrenty, free of charge. //
    // //
    /////////////////////////////////////////////////////

    // This page shows an example of how to use the script
    // and it's various functions.
    ?>

    <html>
    <head>
    <title>
    Example page
    </title>
    </head>
    <body style="font-family:arial;text-align:center;">
    <h1>Examples of available functions:</h1>
    <h4>
    print_name():

    Hello <? print_name(); ?>!



    print_username():

    Your username is "<?php print_username(); ?>".



    print_logout_url():

    The logout page is here.



    print_first_page_url():

    A link to the first page.</h4>
    </body>
    </html>

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.