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-28-2005, 06:42 PM
Webviper2006 is offline Webviper2006
Registered User

Join Date: Nov 2005
Posts: 495

How can I incude a file? (PHP)

Guys how to us incude? I did this code. And says the file does not exisits.

Code:
 <?php incude"php/stats/stats.php"; ?>
So?
__________________
Sorry bums, now I'm back! Now I know C++! I use Microsoft Visual C++!
Reply With Quote
  #2  
Old 12-28-2005, 07:16 PM
DevilDog#1 is offline DevilDog#1

Join Date: Jul 2002
Posts: 7,040

I don't see any incude function on php.net

PHP Code:
 <?php include"php/stats/stats.php"?>
Makes more sense to me.
__________________








Quote:
If I don't do that doesn't mean I can't - DD#1
Reply With Quote
  #3  
Old 12-28-2005, 07:19 PM
Webviper2006 is offline Webviper2006
Registered User

Join Date: Nov 2005
Posts: 495

But when I downloaded another differant source code, then it was like this.

PHP Code:
 <?php incude'php/stats/stats.php'?>
__________________
Sorry bums, now I'm back! Now I know C++! I use Microsoft Visual C++!
Reply With Quote
  #4  
Old 12-28-2005, 07:31 PM
DevilDog#1 is offline DevilDog#1

Join Date: Jul 2002
Posts: 7,040

Need to see the whole code .... Manual doesn't have incude in it.
__________________








Quote:
If I don't do that doesn't mean I can't - DD#1
Reply With Quote
  #5  
Old 12-28-2005, 09:24 PM
Webviper2006 is offline Webviper2006
Registered User

Join Date: Nov 2005
Posts: 495

Ok here it is...

File = index1.php
File2 = stats.txt

File One-
PHP Code:
<body>
<font face="Verdana" size="1">
<?php
// My log file;
$counter "stats.txt";

// Date logging;
$today getdate();
$month $today[month];
$mday $today[mday];
$year $today[year];
$current_date $mday $month $year;


// Log visit;
$fp fopen($counter"a");
$line $REMOTE_ADDR "|" $mday $month $year "\n";
$size strlen($line);
fputs($fp$line$size);
fclose($fp);

// Read log file into array;
$contents file($counter);

// Total hits;
$total_hits sizeof($contents);

// Total hosts;
$total_hosts = array();
for (
$i=0;$i<sizeof($contents);$i++) {
    
$entry explode("|"$contents[$i]);
    
array_push($total_hosts$entry[0]);
}
$total_hosts_size sizeof(array_unique($total_hosts));

// Daily hits;
$daily_hits = array();
for (
$i=0;$i<sizeof($contents);$i++) {
    
$entry explode("|"$contents[$i]);
    if (
$current_date == chop($entry[1])) {
        
array_push($daily_hits$entry[0]);
    }
}
$daily_hits_size sizeof($daily_hits);

// Daily hosts;
$daily_hosts = array();
for (
$i=0;$i<sizeof($contents);$i++) {
    
$entry explode("|"$contents[$i]);
    if (
$current_date == chop($entry[1])) {
        
array_push($daily_hosts$entry[0]);
    }
}
$daily_hosts_size sizeof(array_unique($daily_hosts));

?>
<? 
echo "
Page hits:<b> " 
$total_hits "</b><br><br>
Unique hits: <b> " 
$total_hosts_size "</b><br><br>
Todays Page hits: <b> " 
$daily_hits_size "</b><br><br>
Todays unique hits: <b>" 
$daily_hosts_size
?>
So?
__________________
Sorry bums, now I'm back! Now I know C++! I use Microsoft Visual C++!
Reply With Quote
  #6  
Old 12-28-2005, 09:44 PM
DevilDog#1 is offline DevilDog#1

Join Date: Jul 2002
Posts: 7,040

Don't see the "incude" line you been talking about in the code...

I need to see the code where the "INCUDE" is being used.

You know

LINE BEFORE "INCUDE"
<?php incude'php/stats/stats.php'; ?>
LINE AFTER "INCUDE"
__________________








Quote:
If I don't do that doesn't mean I can't - DD#1
Reply With Quote
  #7  
Old 12-29-2005, 12:30 AM
IcIshoot is offline IcIshoot

Join Date: Mar 2004
Location: Farmington Hills, MI
Posts: 1,473

Send a message via AIM to IcIshoot Send a message via MSN to IcIshoot Send a message via Yahoo to IcIshoot
Quote:
Originally posted by DevilDog#1
Don't see the "incude" line you been talking about in the code...

I need to see the code where the "INCUDE" is being used.

You know

LINE BEFORE "INCUDE"
<?php incude'php/stats/stats.php'; ?>
LINE AFTER "INCUDE"

include on php.net: http://us3.php.net/manual/en/function.include.php


It sounds like your path isn't correct. You need to make sure that the path is correct, relative to your script.


icI
Reply With Quote
  #8  
Old 12-29-2005, 05:10 AM
Capers is offline Capers
Registered User

Join Date: Oct 2003
Posts: 158

I think it's fair to assume that incude was a typo that he has just repeated a few times without realising. He must have called include correctly in the script otherwise he would have received a "Call to undefined function" error rather than a file does not exist error.

As icishoot said, you need to check that the path to the file you are including is correct and that the file exists etc. (check for typos aswell).
__________________
Reply With Quote
  #9  
Old 12-29-2005, 06:00 AM
Steve is offline Steve
Steve's Avatar
Administrator

Join Date: Sep 2001
Location: 2077
Posts: 21,552

Send a message via ICQ to Steve
^^ hehe i think that might work
Reply With Quote
  #10  
Old 12-29-2005, 01:21 PM
Webviper2006 is offline Webviper2006
Registered User

Join Date: Nov 2005
Posts: 495

Oh 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
incorporate php file upload with MySQL form? pauldridge Tech Support 1 06-16-2010 08:46 AM
Need some file help please GaryP Delta Force 3 08-19-2005 04:06 PM
PHP-NUKE and PHP ~BLÃÐE~ phphq.Net Forums 9 01-19-2005 06:49 AM
Trying to edit a PHP File katana*GFR* phphq.Net Forums 4 08-24-2004 05:06 AM
File Currupted why??! Muninn Tech Support 3 03-28-2003 03:14 PM


All times are GMT -5. The time now is 06:20 AM.




Powered by vBulletin®