![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Web Design & Programming Discussion of web design, and server-side & client-side scripting |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Registered User
|
PHP Problem
So what i have is a script that reads a .txt file and randomly chooses a line and displays the msg on my website. (a random quote generator)
This works fine the script until i try and do something else. in the .txt file i have done this Code:
<img src="/pictures/1.jpg" width="549" height="327" /> <?php include("rater.php"); ?>
So im not sure if the random quote script is doing something so that the php code wont be parsed. Here it is: Code:
<?php
// Name of your quote file
$quote_file = "pictures/pic.txt";
// Open the quote file
$fp = fopen($quote_file, "r");
// Read the contents and tokenize the file to individual quotes
$quotes = fread($fp, filesize($quote_file));
$array = explode("\n",$quotes);
fclose($fp);
// Find a random quote
srand((double)microtime()*1000000);
$array_index = (rand(1, sizeof($array)) - 1);
// Show the random quote
echo $array[$array_index];
?>
|
|
|
|
| Important Information |
|
Join the #1 Tech Support Forum Today - It's Totally Free!
TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free. Join TechSupportforum.com Today - Click Here |
|
|
#2 (permalink) |
|
Design Team
Join Date: Mar 2006
Location: Philadelphia
Posts: 1,541
OS: Windows Vista Home Premium (x64)
|
Instead of using a php includes function, try copy and pasting the content in the php file directly into the text file.
__________________
Nice music blog ![]() Nvu || Notepad++ || Apache || PHP || Keep TSF Alive "The great thing about a computer notebook is that no matter how much you stuff into it, it doesn't get bigger or heavier." |
|
|
|
|
|
#4 (permalink) |
|
Design Team
Join Date: Mar 2006
Location: Philadelphia
Posts: 1,541
OS: Windows Vista Home Premium (x64)
|
Have you tried adding the image to the php file and removing it from the text file?
__________________
Nice music blog ![]() Nvu || Notepad++ || Apache || PHP || Keep TSF Alive "The great thing about a computer notebook is that no matter how much you stuff into it, it doesn't get bigger or heavier." |
|
|
|
![]() |
| Thread Tools | |
|
|