Search found 14 matches

by fullur
Thu May 31, 2007 3:30 pm
Forum: PHP - Code
Topic: Replace text in html page at load [Solved]
Replies: 29
Views: 4788

Why can't you just use the icon? The fact is I can and probably will end up using the icon. What I meant was that I won't be trying any scripts to do it for me. So you are literally trying to replace the text string '(pdf)' with an image of a pdf icon? In the markup? Why not ctrl-h in the project a...
by fullur
Thu May 31, 2007 2:46 pm
Forum: PHP - Code
Topic: Replace text in html page at load [Solved]
Replies: 29
Views: 4788

Perhaps you could have a file called 'addition-pdf.txt' and in it you could have the string '(PDF)' (which I am still uncertain as to why you did this to begin with) The reason I did it is that I am developing a website and we have a lot of pdf files on it. According to what I have read, (and my ow...
by fullur
Thu May 31, 2007 2:15 pm
Forum: PHP - Code
Topic: Replace text in html page at load [Solved]
Replies: 29
Views: 4788

So basically the task - while doable - would be inadvisable, correct? The more I look at it the more unreasonable it seems.
by fullur
Thu May 31, 2007 11:35 am
Forum: PHP - Code
Topic: Replace text in html page at load [Solved]
Replies: 29
Views: 4788

That worked for the string replacement. Unfortunately I use several requires that I use in my site. Using this method they don't get displayed. I'm thinking that php just may not have what I am looking for here. Javascript might be better suited to this task. What do you think?[/url]
by fullur
Wed May 30, 2007 11:12 pm
Forum: PHP - Code
Topic: Replace text in html page at load [Solved]
Replies: 29
Views: 4788

It is essentially intended to be dynamic. I already have dozens of pages with the (pdf) string used to denote .pdf files. I could go back and replace all of those with an image link (it wouldn't even be that much work using the "Find and Replace" feature), but I was thinking how much coole...
by fullur
Wed May 30, 2007 6:19 pm
Forum: PHP - Code
Topic: Replace text in html page at load [Solved]
Replies: 29
Views: 4788

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <link href="/newsite/css/colco.css" rel="stylesheet" type="text/css"> <script src="/newsite/scripts/email.js" language=&qu...
by fullur
Thu May 24, 2007 6:30 pm
Forum: PHP - Code
Topic: Replace text in html page at load [Solved]
Replies: 29
Views: 4788

The problem with that method is that I am loading the page I want to replace the string on. e.g. I am loading example.php and replacing the string in example.php. Using the method we have been discussing, the page ends up being output twice.
by fullur
Thu May 24, 2007 4:10 pm
Forum: PHP - Code
Topic: Replace text in html page at load [Solved]
Replies: 29
Views: 4788

Okay, so using a local file path I am able to open the page to read. I don't fully understand this as using a URL works for an external website. Would someone be able to explain that to me? Anyway, using this method I end up echoing the entire page. What I want to do is just replace a particular str...
by fullur
Thu May 24, 2007 2:31 pm
Forum: PHP - Code
Topic: Replace text in html page at load [Solved]
Replies: 29
Views: 4788

According to the PHP Manual file_get_contents is restricted by open_basedir. That's what the error was referencing. However, open_basedir is set to allow me to open from my /httpdocs folder. Shouldn't that allow me to open any file in my website?
by fullur
Fri May 18, 2007 4:53 pm
Forum: PHP - Code
Topic: Replace text in html page at load [Solved]
Replies: 29
Views: 4788

Just the reverse actually, safe_mode is off and allow_url_fopen is on.
by fullur
Fri May 18, 2007 2:38 am
Forum: PHP - Code
Topic: Replace text in html page at load [Solved]
Replies: 29
Views: 4788

Oh. Okay, so what should I be using? The URL method worked when I used one from an external site... Is there some reason why a URL will not work for the local site?
by fullur
Thu May 17, 2007 4:36 pm
Forum: PHP - Code
Topic: Replace text in html page at load [Solved]
Replies: 29
Views: 4788

I used $_SERVER['PHP_SELF'] and got that error. I have other PHP scripts that run from that same folder. None of them are very complex but that shouldn't really make a difference for this should it? Here is the exact script that gives that error: <?php $resource = file_get_contents($_SERVER['PHP_SEL...
by fullur
Thu May 17, 2007 2:05 pm
Forum: PHP - Code
Topic: Replace text in html page at load [Solved]
Replies: 29
Views: 4788

Thank you for your reply. I did try file_get_contents, I got this error:
Warning: file_get_contents() [function.file-get-contents]: open_basedir restriction in effect. File(/newsite/pdf_icon_script_test.php) is not within the allowed path(s):
by fullur
Thu May 17, 2007 12:48 pm
Forum: PHP - Code
Topic: Replace text in html page at load [Solved]
Replies: 29
Views: 4788

Replace text in html page at load [Solved]

I am trying to make a script that will allow me to replace a specific string in an html page when it loads. specifically at the moment what I want to do is replace (pdf) with a link to a pdf icon when the page is loaded. I am pretty sure this is possible, but I don't really know where to start. I di...