Go Back   Novahq.net Forum > Computers > Web design and Programming
FAQ Community Calendar Today's Posts Search

Web design and Programming Discuss website creation and other programming topics.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-29-2005, 02:38 PM
Webviper2006 is offline Webviper2006
Registered User

Join Date: Nov 2005
Posts: 495

How to echo variable? PHP

Hi how to echo text for a another page?

Files:
news.php - My page with 4 colom
fn1.php - The text for news colom 1


fn1.php
PHP Code:
 We are closed right now
<hr>

new.php
PHP Code:
 <?php echo"fn1.php"?>
<hr>

And then on the news colom it says like this...

fn1.php

Why?
__________________
Sorry bums, now I'm back! Now I know C++! I use Microsoft Visual C++!
Reply With Quote
  #2  
Old 12-29-2005, 03:17 PM
Scott is offline Scott
Scott's Avatar
AKA. Panther

Join Date: Sep 2001
Location: Minneapolis, MN
Posts: 10,927

you should read a little on what your trying to do... why in the world would you include a file with just a little text in it? if you want to echo what your going to echo just use echo"We are closed right now.";

If you want to use variables from another include you have to include the file first.. you cannot display the contents of a file using echo...

but you could use fn1.php and have a var in it called $message="We are closed right now."; and then include it in new.php and type echo $message;
__________________

04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq
Reply With Quote
  #3  
Old 12-29-2005, 07:49 PM
Webviper2006 is offline Webviper2006
Registered User

Join Date: Nov 2005
Posts: 495

Thanks.
__________________
Sorry bums, now I'm back! Now I know C++! I use Microsoft Visual C++!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get the modified variable value in Java Script function in another HTML page ? balmersmith Web design and Programming 0 12-06-2010 11:53 PM
Alpha 1 Echo alex0705-AE1 Gaming Talk 0 05-04-2008 03:35 AM
Mission variable, subgoals etc Donneck Delta Force 9 05-24-2007 04:01 PM
whoa is there an echo staffy bull Sigs and Graphics 41 07-20-2003 10:18 PM


All times are GMT -5. The time now is 09:38 AM.




Powered by vBulletin®