The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Require Help for Shell Script jagnikam Shell Programming and Scripting 14 02-04-2008 03:04 AM
require alternate command for lsof logic0 UNIX for Dummies Questions & Answers 1 05-17-2007 12:41 AM
Regarding use and require keywords sweta Shell Programming and Scripting 2 03-16-2006 07:09 AM
require help about cut command vikramchots UNIX for Dummies Questions & Answers 2 09-04-2005 10:50 PM
Command to require OS info malaymaru SUN Solaris 4 05-02-2005 10:07 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-20-2003
Registered User
 

Join Date: Oct 2003
Posts: 2
require in first line

I have a website with a lot of php files. I need to to have the line (where "requiredfile.php"' should be a valid reference to the requiredfile.php in the top directory):
require "requiredfile.php" as first line in every php file. The requiredfile.php will be in the top dir and the line I mentioned must contain a valid reference to the requiredfile.php. PLease help me with a script for this task. Thanks.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 10-20-2003
photon's Avatar
Registered User
 
Join Date: Jul 2002
Posts: 128
I think you want something like this.

Code:
<?php

// Required file

$DOCUMENT_ROOT = $HTTP_SERVER_VARS['DOCUMENT_ROOT'];
require_once($DOCUMENT_ROOT.'requiredfile.php');

//rest of code under here

?>
Reply With Quote
  #3 (permalink)  
Old 10-21-2003
Registered User
 

Join Date: Oct 2003
Posts: 2
I was looking for unix script involving sed or something like that.

http://galileo.spaceports.com/~ibidris/
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:19 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0