How To Get PHP Into HTML Files - FrontPage
I am new to the PHP world, and want to know if it is possible to create a page with an HTML extension that contains a PHP include statement in it.
I can get the PHP include to work correctly when I name the page it is on with a PHP extension, however, I would like to be able to create that same page with the include statment with an HTML extension.
Is this posible? If so, anything special to get it to work?
FYI - FrontPage 2003 uaser.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
PHP And FrontPage
Can I use the Frontpage Hover Button like a "submit" button and retrieve the POST values using PHP? I can invoke a new URL but I haven't been able to pass POST parameters. What do you suspect I an doing wrong?
FrontPage(Addin) + PHP ?
I'm developing a site where I want to use PHP+MySQL on a Win2k server using php w/IIS (I know that's not the best route, only option I have). I prefer to use FrontPage as my developer because of the IIS and FrontPage integration. I was wondering if anyone knows of a good PHP addin to frontpage that allows me to do the normal WYSIWYG development and also code PHP as if I was doing ASP inside FrontPage.
Developing PHP Pages In MS FrontPage
I am doing my PHP development in MS FrontPage. At on time, when in Frontpage and I would double click on a page in my development folder, FrontPage would open it. Now when I double click, Notepad opens it. I have check my extension settings and my setting is that FrontPage should open an file ending in .PHP. Now what I have do is right click the file name, and use "Open With...." to open it in FrontPage. Somewhere, Somehow, I must have changed a setting to screw this up. Can someone suggest when I need to do to get the double click action back so the ..php file is opened with FrontPage.
RemoveHandler .html .htm (parse Php In .html Files)
I want to parse php in .html files. I put this in .htacces file: RemoveHandler .html .htm AddType application/x-httpd-php .php .htm .html Its work, but some of my php aplications have urls: www.mysite.com/this-is-page without .html in the end how to parse that? Which code I must use.
Pre-build .html Files
I've been told there is a way to build applications so that PHP will automatically build all possible .html files that would result from a given php script. So that visitors to a site would only use the .html files that were pre-generated using php. This seems like an interesting way to get around search engine issues and increase the speed of pages. Does anyone have any experience building applications like this, or know of any tutorials that I could take a look at?
Can I Put Some Php Files In /var/www/ In A Directory Other Than Html?
I setup a local sever, the sever pages are in the /var/www/html/ and when i start the server, it opens the /var/www/html/index.html that is ok, now my question, there is some php files can i put them in a deferent directory then html in the /var/www/ for example /var/www/any_name, and then how i can open them with my server?
PHP On Win 98 (.html Files Render As .php)
I am wondering if I can make all the .html files render as .php. I am running Xitami on Win 98. Do I have to specify something in php.ini file, or is there some other way of doing that.
Uploading Html Files
I need to know how to upload html files from the user machine. The problem is that the I can use the <input type="file" name="userfile"> to upload the file to the server but what about the folder that contains the images etc. What i am going to have is users create word documents with images etc and then they save it as a web page. THis makes a webpage and the corresponding _files folder with the images etc. The user then is going to use my file upload button to upload the html document, but how can i upload the _files folder that contains images etc.
.HTML Files In PHP Suexec
My web host has turned on PHP SuExec, which has completely broken my site, and they don't seem to be able to give me information. Google search is hopeless for this, as "html" appears on most pages. So, while using php suexec, how can I get .html to be processed as php?
PHP Files With HTML Extension
Is it possible to have an page with an html extension that can contain and run PHP scripts? If html was added to the PHP file types in the apache httpd.conf...?
Indenting Using <? Include ?> Files In Html...
Recently starting php codeing, and absolutely love using php includes throughout my normal html code to make things easier/logical etc when working on it. However I have a slight intending issue: using nested tables a lot, the results are often that I have aroundabout 15 spaces in front of stuff. Now, when including a file, I have to put 15 spaces in front of everything in that file...*yuck!* is there any way to get around this? I hope this makes any sense... Perhaps there's some-thing/place someone know about that touches the indenting topic...?
How These Forums Construct Html Files...?
how do these forums output .html files for threads? Im guessing that they use mod_rewrite to change the querystring to f5/34343.html - but how do they actually output html pages? I would like to do this on my own forums, and they use vbulletin as well.
Convert Some Files From Html To Plaintext
I have many html files named like these: c:dirfemo-black.html c:dirloren-white.html c:dirspark-white.html c:dirkim-black.html c:dirpaul-white.html How can I convert only the files named "c:dir*-white.html" to plaintext files named c:dir(original filename)-text.txt? Is there a PHP module that does a good quality conversion HTML to...
How To Use .htaccess To Parse Only .html Files As .php?
I am trying to make my server (Apache) parse .html files as .php. I found this line of code: ForceType application/x-httpd-php placed it in an .htaccess file and uploaded it to the directory I wanted it to work. And it worked; my .html files are all parsed as .php. But, apparently, so are my images, so they aren't loaded into the pages. And something else, my css file isn't found anymore by Netscape and Mozilla, while IE has no problem... I'm calling my css file with @import url(all.css); in the <style> block in the head of my .html files. How do I make the server parse _only_ .html files as .php, and why don't Mozilla and Netscape find the css file? (They did before I sent the .htaccess file)
Parsing .html Files (tried Everything But Can't Get It To Work)
i'm running apache 2.0. here's my php.conf: LoadModule php4_module modules/libphp4.so AddType application/x-httpd-php .php .php4 .php3 .phtml .html DirectoryIndex index.php index.php3 whenever i try to open an html page, the browser keeps trying to download the file.
Including .txt Files With Html Content
I have a php page and I want to include some txt files within it depending on the URL variable. For example, I have some text files (that contain html code) with these names: cat.txt dog.txt parrot.txt How can I make the contents of, say, "parrot.txt" appear on the page, if I use a URL like: mysite.com/page.php?c=parrot "c" stands for "content" and each time I want to include a file, I would use the exact name of the txt file - but without the .txt extention. I know this is possible and I had the code to do it but it's been over two years and I have misplaced the code.
Return All The .html Files In A Folder?
I'm trying to find all the include files in a folder is there a way to some how read a folder and then return an array with all the file names as the array keys or associative keys? I only want to return files that are .html or .php not all files
Convert Some Files From Html To Plaintext
I have many html files named like these: c:dirfemo-black.html c:dirloren-white.html c:dirspark-white.html c:dirkim-black.html c:dirpaul-white.html How can I convert only the files named "c:dir*-white.html" to plaintext files named c:dir(original filename)-text.txt? Is there a PHP module that does a good quality conversion HTML to plaintext?
Show Html Files In A Folder
I am trying to create a script that will parse the folder it's containing php page is in for html files. Create a drop down list of links to the html files. Anyone know how I might do this?
Parsing HTML Files On Local Computer
I would like to be able to open and read HTML files that are on my local (client) computer and then parse them to extract some specific information they contain. I've been looking here and reading my PHP books, but it appears to me that PHP only opens files on the server or URLs. It think that makes sense to me. Is there an alternative?
Convert PHP Output To Static HTML Files
I want to create a static HTML page for every single record of a MySQL database (to improve performance and search engine rankings as well). The approach should by like: open file showrec.php3?id=1234, read formatted html code into array and write the array into a file rec1234.html. Does anybody have a solution?
Howto Use Php As Filter For HTML Files? Curl?
In short, how to modify selected tags/sections of a HTML file, using PHP as the "modifier"/filter? I would have thought this was a very common usage for PHP... I have a set of existing .html files that are plain and ugly. I'd like to create a showdoc.php filter that adds consistent menus, css, look and feel, so that http://me/showdoc.php?d=story shows a nicely formatted http://me/story.html It: * puts in a nice standard header * opens story.html * extacts all <link> and <script> tags from the story <head> and adds them to the output <head> * extracts everything between <body> and </body> * rewrites all non-absolute hrefs e.g. <a href="other.html"> to <a href="showdoc.php?d=other"> * closes story.html * puts in a nice standard footer I realize I can do this by editing all the .html files instead, but can't I just use php as a filter? Am I the first person to want to do this? How? * I _really_ want to avoid using regexps to match e.g. body and hrefs, because there are so many caveats involved. Multiline tags, attributes, for starters. Or how about <nasty attr="</body>"></nasty> (not sure that really is legal, though...) * xml_parse() parses XML and HTML is not XML (e.g. valid HTML missing </end> tags) so xml_parse is out. Or what? * Since I want to preserve all the <body> except the rewritten hrefs, if there is a parser involved, I'd like for any parser to produce output that is easy to re-flatten when generating output. There are examples out there using CURL, but they often are so simple that they don't print out *anything* on their own and only the output of curl_exec(). In any useful application, wouldn't everyone have to extract selected info from the retrieved web page? What do CURL users do?
IIS Could Not Find .php File, However It Finds Html Files In The Same Dir
IIS could not find .php file, however it finds html files in the same dir..... http://localhost/test => the default.htm will be hit, no error http://localhost/test/test.php => 404 error not found( it exists in the dir) The security is set ok, something wrong with the php runtime?? Strange because my application on localhost/prog works smooth.........
Store Images In MySQL And Use Them In Html Files
Does anybody know how to store bitmap data (jpg or png files) in a MySQL table and how to call those files in dynamic php3 generated web pages: I'd like to build an articles database with a jpg file for each article. Data (images and articles) are updated by registred users via a form. I've found many articles and tips explaining the way to store such bitmap data in a MySQL table, but nobody seems to explain how to get the files from the table and put them in a html file………
PHP And MySQL A Faster Option Than Coding HTML Files?
In the article about driving your website using PHP and MySQL it seams that if you have large amounts of information ten it would take ages to actually input data. Does sitepoint use a different type of databse or take a shortcut. Is PHP and MySQL a faster option than coding HTML files. I mean by this, will the page load slower or faster. How about if you use multiple SSI on a HTML page. Would the PHP and MySQL solution be a faster loading one.
User Login And Preventing Access To Non-html Files
I built a user login for my site with php and it works great. The problem is that I want to put some .doc and .pdf files up on the web that only a logged in user can access and I don't want the user to have to enter another username/password I want to use the current system I've got now (which is just checking cookies and a database to see if you're logged in at the beginning of restricted pages). This doesn't have to be done with php but somehow I want to base whether or not you can view the files based on whether you're already logged in.
Read A Directory Files, And Create Echo HTML?
i have a foo/ directory and a foobar/ directory, and a barfoo/ directory in root/ for each directory in root, i'll put x or y or z amount of images in each directory. then, have the php write 01.html with the correct links to a) main image, b) thumb images and prev/fwd links. we could have separate php files to handle the drawing of the new sequenced .html files in each directory (probably best to pass variables), because they're slightly different, or one to rule them all (sounds like too much work). then, the syntax would need to be sorted out (so index.html has a link to foo/foo.php?=foo01) would work correctly and draw up 01.html with the correct images, being that index.html would probably have to have hardcoded variable-passing links. eh? it's sweet, 'cause updating would be fast. upload and delete image files. done. I mean, I know that you could go the database/XML route, but sigh ........
Wnat To Embed Full HTML Page In Email, But Migrating Style From Css Files To Element Style Attributes
My web pages of course use css files, but Webmail services require style to be in element style attributes. How do I convert a standard HTML page to HTML suitable for delivery to webmail services? Perhaps another way to ask the question is: How to I walk the DOM and for every element, for every style, set the element's style attribute to the values that are looked up in the css file in normal rendering. Anyone know of any tools, or examples to do this?
Including Files In Different Direcories That Include Files From Teirs
Okay, I made a simple AJAX shoutbox and I want to include it on all my pages. To insert the shoutbox I simply type <? include('/shoutbox/shoutbox.php');?> into my HTML page. The problem is, that in /shoutbox/shoutbox.php I also include settings.php, functions.php, and some other files, and when I include /shoutbox/shoutbox.php into my index page, /shoutbox/shoutbox.php tries to call settings.php from the same folder that my index file is in, since I just 'included' it in index's source. So my question is, is there any way, without using frames, to include a PHP file as it would be if you link directly to it in the address bar, but placed into another file in a different directory?
How Do I Hide Database Connection Files Using PHP Include Files?
I have the following at the beginning of the PHP page: <?php require_once('Connections/conn.php'); ?> I want to hide the connection file, "conn.php", so it's out of the web accessible file structure. I understand putting them in the php include directory shoudl do this. For example, let's say the directory I put them in is /www/phpIN/, and /www/ht/ is the root web directory. So I put "conn.php" in the inlcude directory (/www/phpIN/conn.php) and removed it form CONNECTIONS directory.
How Do I Hide Database Connection Files Using PHP Include Files?
I have the following at the beginning of the PHP page: <?php require_once('Connections/conn.php'); ?> I want to hide the connection file, "conn.php", so it's out of the web accessible file structure. I understand putting them in the php include directory shoudl do this. For example, let's say the directory I put them in is /www/phpIN/, and /www/ht/ is the root web directory. So I put "conn.php" in the inlcude directory (/www/phpIN/conn.php) and removed it form CONNECTIONS directory. Now it doesn't work. What do I need to change?
Creating Dir, Copy Files And Pass Variables To 2 Files
I need to create a folder on the server weekly named by the user. To this folder copy the contents of an /Original folder. Inside the new folder edit one of the files to insert a data with a XML path generated in another application, copied (via memory) and pasted within the very first form and passed to the file in question. <param name="FlashVars" value="xmlfile= $lanofile" /> the $lanofile is the value that I need to pass from the form to be read by this file. I have created an form (n.php) that POST the name of the folder to a second file (creatdir.php) everything is cool until I have to edit the third file. How can I pass the value of one of the formfileds to a second file and them read this value as a variable to be consumed as mentioned above? Or actually right whatever is on the third field to this position (not using variables).
HTML Email Using PHP Problem (Receive Html Tags)
When I send the html email, the only thing I receive is the tags (the html codes basically). I want to be able to see the email like a html page, what is wrong with my code? Here is a copy paste of it. $HTML = "</html><body><img src='http://www.somewebsite.com/ someimage.jpg'></body></html>"; $headers = "From: $from "; $headers .= "MIME-Version: 1.0 "; $boundary = uniqid("HTMLDEMO"); // Now we attach the HTML version $headers .= "--$boundary ". "Content-Type: text/html; charset=ISO-8859-1 ". "Content-Transfer-Encoding: base64 "; $headers .= chunk_split(base64_encode($HTML)); mail($to,$subject,"",$headers); print "mail Sent<br>"; The email I receive has this as text: </html><body><img src='http://www.somewebsite.com/someimage.jpg'></ body></html>
Embed Php Generated Html In Another Html Page
I am trying to include some php generated html in a page that is just a standard html file, NOT a php file. I have seen other html pages do this by including an src to the cgi script in script tags, like this: <script src="http://someurl.com/somescript.cgi"></script> the html page loads and the script is executed and the returned html is displayed in the calling page. So, I tried this: <script src="http://someurl.com/somescript.php"></script> It doesnt work!!
Upload Audio Files Of Type .wav & Video Files Of Type .avi
I need to upload audio files of type .wav & video files of type .avi / .mov but my current file unloader is not helping me with that. My unloader works with application types, images, txt, pdf , mp3, mpg, mpeg but not with those .wav & .mov/.avi files........
DOMDocument Thinks "<html></html>" Has Two ChildNodes?
I'm trying to mess around with PHP5's DOM functions and have run into something that confuses me: <?php $dom = new DOMDocument(); $dom->loadHTML('<html></html>'); echo $dom->childNodes->length; ?> Why is the output 2? Shouldn't it be 1?
Files Inside Files
im creating something new with alot of php files, and i remembered that alot of times on message boards and things like that you see like "misc.php?action=list" or something like that. i would really like to decrese the amount of files i have for this new thing im creating. can someone show me how to put multi files in one?
$_POST From HTML --> PHP --> HTML
I've read a bunch of threads but I think I'm missing something. I am using paypal as a payment method for a client. But I need to do some variable checking before sending the customer to the paypal page. I want to pass the variables to paypal as post (so the url doen't get crazy). Is there a way to pass post variables to a PHP page that doesn't ouput anything (expect header redirect), and include those variables so they appear at the page that is redirected to?
PHP In Html Or Outside Html Page?
what's better, php code in html page or outside the page in seperate php file...the thing is i have my sql data in that code and i don't want people to see it, can people open up the php files?
Files
My problem is not a php problem but something to do with uploading a file to a folder on a remote server. On the remote server I have my upload script in a folder called lets say "img_upload" and in that same folder I have another folder called "images" where I will be uploading all my images. Now I specify the path to this folder in my code but the images never get uploaded. I have tested this code on my local machine and from another machine in the office and it works fine. But uploading the image to a remote server is a bit of a pain in the butt. If any of you guys have uploaded a file to a folder on a remote server could you please tell me what path I would have to put in my code??
ZIP Files
I have to do a script which read a zip file and update with it a database, I need to know if there is a way to uncompress .zip files with PHP.
.txt Files
Does anyone know where I can find out how to get PHP to save a text file. Also, How can I combine text boxes and check boxes within one form? I would like to write a simple script which will take a url, and allow me to choose a description(from 4 or so options) and write a text file which could be used as a SSI.
Not Able To Run The Php Files
i get these two warnings when i run the php page. Warning: Cannot send session cookie - headers already sent by (output started at /usr/local/apache/htdocs/ticketsmith/config.inc.php:62) in /usr/local/apache/htdocs/ticketsmith/common.inc.php on line 380 Warning: Cannot send session cache limiter - headers already sent (output started at /usr/local/apache/htdocs/ticketsmith/config.inc.php:62) in /usr/local/apache/htdocs/ticketsmith/common.inc.php on line 380 and the code that generates the warnings is : Code:
|