Jump to content

Search the Community

Showing results for tags 'require'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Calendars

  • Community Calendar

Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 6 results

  1. QUESTION: When a variable is passed via a super global from one file to another what happens to the variable that is passed? Where is it stored? What is its half-life? Roddy
  2. PHP beginner here. I have the following in index.php (the two files live in the same directory)... <?php require_once( dirname( __FILE__ ) . '/functions.php' ); ?> <!DOCTYPE html> <html lang="en"> <head> <title><?php echo $nds; ?></title> </head> <body> </body> </html> ...and here is the required PHP file (functions.php)... <? php // test variable $nds = 'Test title.'; ?> This gives me an "undefined variable" error when tested in a browser. Is this an issue of scope?
  3. 'require' in PHP

    Hello. I'm new to this community and I have just recently started learning PHP. I have run into the problem that the require statement doesn't seem to work: HTML 1:phplesson23.tmpl.php <!doctype html><html><head><style>li { list-style: none;}</style></head><body><h1>Join me in my journey to conquer the world!</h1><form action="" method="post"><?php if ( isset($status) ) echo $status; ?><ul><li><label for="name">Your name:</label><input type="text" name="name"></li><li><label for="email">Your email:</label><input type="text" name="email"></li><li><input type="submit" name="SIGN UP"></li></ul></form></body></html> HTML 2: phplesson23.php This is the one with the require statement. <?php if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {$name = trim($_POST['name']);$email = trim($_POST['email']); if ( empty($name) || empty($email) ) {$status = 'Provide a name and valid email.'}} require 'phplesson23.tmpl.php';?> What am I doing wrong?
  4. The code is as following: file:index.php <?php include("fix.php");?> file: fix.php <html> <head> <title></title> <link rel="stylesheet" type="text/css" href="styles/styles.css" /> </head> <body style="margin:0px;"> <h1 style="background-color:red;margin:0px;">Problem</h1> </body></html> When I open file fix.php in firefox and chrome are ok (there is no margin between tag h1 and top boundary of browsers). However, when I open file index.php, in firefox is OK (no margin), but in Chrome, there a margin between them. Please, explain to me the reason. Is it because of the function require () ???
  5. require vs require_once

    I'm confused about require and require_once... Could you please tell me the practical example of require_once and require ?
  6. I know that require give an error and include gives warnings when something goes wrong. I assume require is used for something that you want on the page like a navigation bar or something that appears on multiple pages that doesn't change. I am trying to use include to use a function in another php file, but it seems it only works if I use all the functions in that php page. Is there any way to only use some of the functions and not all? Also, the once means it only shows up once, so any repeats will not show up. Does this apply to each page or the whole site altogether?
×