|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
please help: tricky file generation problem
Hi,
I have a problem with a HTML generator script I am writing. Basically, I run a PHP script in a while loop. The output of this is stored in a file and then using PHP's file functions, this file is written into a HTML file. The code in my PHP file is fine but there is a problem with the generated HTML. Firstly, I am passing a value and using ereg_replace to replace the word -track- in the PHP file with this value. This value is a word and it can be of variable length. Now, when say I run through a loop of 10 names, each of different lengths. When I open the generated HTML files I am seeing parse errors that aren't actually correct. ie - This error is coded into the generated HTML page because it occurred when the PHP script was being run: PHP Code:
Obviously, ifx_fet() isnt a function. The actual line 104 code in resultscache.php is this: PHP Code:
This is an informix DB function and when I run resultscache.php in the browser and not through the generator script, there are no parse errors. Similarly, in one of the other generated HTML files there is this error: PHP Code:
The word that was passed to generate the first file was 13 characters long while the word for the 2nd file was 7 characters long. For some reason, the PHP seems to be getting messed up when it is read into my script. I use the code below to read a txt file, replace the appropriate words, save it as resultscache.php, run resultscache.php and then save the HTML output of resultscache.php as a HTML file: PHP Code:
I am stumped with this and I have a dealdine hanging ove rmy head so any help is appreciated! Thanks, Martin note: there is forward slashes in the rror output but vBulletin removes them. |
|
#2
|
|||
|
|||
|
Other than getting that error in your file output, is the output correct? if so, just suppress the message using '@'...
__________________
~ Joe Penn We work for free to help make this a valuable resource on the internet. Do you appreciate the help - did we provide help that will help you prosper and help that has contributed to sharpening your current skill set? Show your appreciation and purchase something from our Amazon Wishlist's - it's simple and a great way to say thank you. |
|
#3
|
|||
|
|||
|
Hi,
The error means the database query doesnt produce an array of results to loop through making the page a mess so @ wouldnt work. its a strange problem because it only happens in some files, I am guessing it might be something to do with how the file is being read and then the different lengths of variable name used to replace -track- could be throing it off somehow. Anyone else got any ideas on this? Thanks, Martin |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > please help: tricky file generation problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|