|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
SitePoint Evangelist
![]() ![]() ![]() ![]() Join Date: Jan 2005
Location: N37 33* W122 3*
Posts: 413
|
templates, ECHOing issues...
so i have a html template file something like
PHP Code:
and then i have a script that goes something like: PHP Code:
the web page shows correctly BUT NOT the INCLUDEd part. the EREGI_REPLACE does the job... i hate to make a messy file by combining the two scripts into one... HELP....... thanks... |
|
|
|
|
|
#2 |
|
Follow Me On Twitter: @djg
![]() ![]() ![]() ![]() ![]() Join Date: Aug 2000
Location: Philadephia, PA
Posts: 19,741
|
Choose one convention and stick with it
- Putting PHP code into the template OR - Putting identifiers into the template you later replace For this specific situation: - Put "$firstname" in the template, and include() the template rather than echoing its contents OR - Put "~left_side_nav~" into the template, and replace that with the contents of your nav file |
|
|
|
|
|
#3 |
|
SitePoint Zealot
![]() ![]() Join Date: Oct 2004
Location: australia
Posts: 152
|
Im having trouble with something along the same lines...
I like to keep functions in a seperate file and include the file wherever i may need those functions. The problem is some of the functions deal with variables that are in the main pages... ie.. "Passing variables to the function that is included, and then spitting out results accordingly.." PHP is simply not passing the variable to the included function, there has to be a way around this... Can anyone help? |
|
|
|
|
|
#4 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Jul 2005
Location: Orlando
Posts: 633
|
Two solutions.
1. Pass the variables as arguments (prefered). 2. Declare the variables as global within the function. |
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 19:39.














Linear Mode
