Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default Whats wrong with my code :(

    Im new to php and i cant figure out whats wrong.
    I want it so that when you go to mysite.com/index.php?page=1 it includes pages/1.txt. This is the code;

    PHP Code:
    <?php
    $page 
    input($_GET['page']);
    include(
    "pages/' . $page . '.txt");
    ?>
    EDIT: The error message is Fatal error: Call to undefined function input() in C:\wamp\www\index.php on line 12
    Last edited by Decode; 24-02-2008 at 11:04 AM.
    Lets set the stage on fire, and hollywood will be jealous.

  2. #2
    Join Date
    Jul 2005
    Posts
    1,653
    Tokens
    50

    Latest Awards:

    Default

    Is that your only code? Because input() is a function, but you have no code that defines the function.

    PHP Code:
    <?php
    $page 
    $_GET['page'];
    include(
    "pages/" $page ".txt");
    ?>
    Although, I'd definitely clean that $_GET.

  3. #3
    Join Date
    Oct 2006
    Location
    Peterborough, UK
    Posts
    3,855
    Tokens
    216

    Latest Awards:

    Default

    Quote Originally Posted by RYANNNNN View Post
    Is that your only code? Because input() is a function, but you have no code that defines the function.

    PHP Code:
    <?php
    $page 
    $_GET['page'];
    include(
    "pages/" $page ".txt");
    ?>
    Although, I'd definitely clean that $_GET.
    Why, it can't do anything apart from maybe navigate round your files.


    visit my internet web site on the internet
    http://dong.engineer/
    it is just videos by bill wurtz videos you have been warned

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •