justsomeguy Posted August 13, 2007 Share Posted August 13, 2007 To find out the full file name of the script you are running you can print the __FILE__ constant. You can use that info to figure out which path you need to give the script.To add something directly after the body tag, you need to find the position of wherever the body tag ends, then insert whatever you want at that point. You can use strpos to find the position of "<body", and then find the first ">" after that. $bodystart = strpos($html, "<body");$bodyend = strpos($html, ">", $bodystart + 5) + 1; Once you know where the body ends then you can get all the text before it and after it. $start = substr($html, 0, $bodyend);$end = substr($html, $bodyend); Once you have all the text before and including the body tag, and all the text after it, then you can insert whatever you want in between when you save the new file. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.