mschroeder 251 Bestower of Knowledge Team Colleague

for starters you have the usage of str_replace still mixed up.
http://us3.php.net/str_replace

$new_result = str_replace($new_ad, $find_ad, $open_file);

should be:

$new_result = str_replace( $find_ad, $new_ad. $open_file );

The parameters for str_replace are search, replace, subject in your example you're searching for 'NEW AD' and trying to replace it with the result of the get_inner_string function.

Honestly though, this is the thing regular expressions are designed for, especially if the timestamp in "<!-- Begin: AdBrite, Generated: 2008-12-18 16:23:11 -->" changes.

But liked I said previously without seeing whats between those Ad Comments there is no use in trying to guess what kind of regex pattern would be necessary to do this with a simple call to preg_replace()

mschroeder 251 Bestower of Knowledge Team Colleague

Thats going to make it substantially harder to parse through. Is there some kind of unique character that separates the different individuals?

mschroeder 251 Bestower of Knowledge Team Colleague

In the file you are reading the data from, is each person on their own line?

Example:

Last Name, First Name Phone: (H) ######## Birth:##/##/#### ...Patient
Last Name, First Name Phone: (H) ######## Birth:##/##/#### ...Patient
Last Name, First Name Phone: (H) ######## Birth:##/##/#### ...Patient

or do they all wrap together as one single line of continuous text:

Last Name, First Name Phone: (H) ######## Birth:##/##/#### ...Patient Last Name, First Name Phone: (H) ######## Birth:##/##/#### ...Patient Last Name, First Name Phone: (H) ######## Birth:##/##/#### ...Patient Last Name, First Name Phone: (H) ######## Birth:##/##/#### ...Patient

mschroeder 251 Bestower of Knowledge Team Colleague
SELECT
  forum.title,
  comments.comment
FROM
  forum
LEFT JOIN comments ON ( forum.id = comments.thread_id )
WHERE
  comments.userid = $iUserID AND
  forum.id = $iForumID

this would yield something like this:
+---------------+------------------------+
| title | comment |
+---------------+------------------------+
| Forum Title | Comment text #1 |
| Forum Title | Comment text #2 |
| Forum Title | Comment text #3 |
| Forum Title | Comment text #4 |
+---------------+------------------------+

mschroeder 251 Bestower of Knowledge Team Colleague

steer clear of the eregi_* family of functions as of 5.3.0 they are depreciated.

You should be using the preg_* functions instead
http://us3.php.net/preg_replace

it looks like you're trying to read through the source code and replace whatever is between the ad comments with a new ad, but without seeing the actual code between those comments it would be hard to create a pattern that would work for you.

mschroeder 251 Bestower of Knowledge Team Colleague

$team and $section are php variables.

aka

$team = 1;
$section = 'A';

$query = 'SELECT * 
FROM assignment
WHERE assignment.Team = '.$team.' AND assignment.Section = "'.$section.'"';
mschroeder 251 Bestower of Knowledge Team Colleague

There are two ways that I am aware of to do this.

The first would be to use apache's mod_rewrite, which will basically take domain.com/username and actually reference the url domain.com/?uname={username}.
There is a lot of available information via google or the like.

The other option would be to create a .htaccess file and use the following mod_rewrite code.
How this method works it to put something like this into your .htaccess file.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

This will force everything that is not a direct link to an existing file or directory to go to index.php

on index.php you can do something along the lines of:

$urlVars = explode('/',_SERVER["REQUEST_URI"]);

print_r($urlVars);

You should see that you have captured all the parts of the url. Using this method you have a tad more control over how you handle the urls, and you can change the methods without having to write any crazy mod_rewrite structures to handle a variable setup

mschroeder 251 Bestower of Knowledge Team Colleague

I would generally caution against fckEditor for its lack of MS-Word support. Other than that it runs pretty neck and neck with tinyMCE.

tinyMCE however has a wonderful paste from word feature that really does an excellent job of stripping all of the crap markup from the input. If you know you won't be taking input from a user who writes first in word than either one should perform exceptionally.