php code in http
I would like to put some php code in a http file and save it to my earthlink storage area.
I have no background in php coding and not a clue how it should look in the http file. I have done this looking as to css files and seeing other than http code in them. Will what I have work? I apologize for the long post. Code:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> Thanks. |
1. My preference for PHP tags is:
<?php .. ?> That's the current "standard", that's a convention that doesn't conflict with XML ("<? .. ?>" does). 2. Supposing you added PHP to your Earthlink page. Does your Earthlink account permit PHP? Probably not. 3. If it did (and most ISPs *will* let you do PHP, at least in specific directories: shop around if Earthlink doesn't), then you still probably need to suffix your file ".php" before it'll work. 4. There are *lots* of great PHP tutorials on the web. (Please don't laugh), but my favorite introductory text for PHP is: "Teach yourself PHP, mySQL and Apache in 24 Hours", Julie C. Meloni I don't generally advocate SAMS books, and "teach yourself ANYTHING in 24 hours" is a ridiculous concept: but Ms. Meloni did a great job, and covers all the essentials you need to quickly get started. Another great book is: "PHP and MySQL Web Development", Luke Welling & Laura Thomson. 'Hope that helps .. PSM PS: Your post was fine and, as far as I could tel, your PHP code looked fine. Heck - you even used the LQ "code" tags correctly - that's WAY more than most posters do ;-)! |
Hi.
Im not too sure what your asking but your code seems fine. I place my php code is placed inside the <? ... ?> brackets. but the above persons recommendation to use <?php ... ?> makes a lot of sense. I'm not familar with the header(), imagepng() or imagedestroy() functions but if they exist the code shouldnt have any problems...... as long as the server is configured to process php code. (php is server side) hope that helps ? cheers, Ben. |
Quote:
Quote:
Quote:
You seem to have read my mind. I was going to ask about toturals. I will get my hands on your recommendations and search for what else is available. I have alway thought that if I had/knew what to read I could answer my own questions quicker that I could wait for an answer. Again, Thanks Dave |
Quote:
Again Thanks for responding. Dave |
Oh yes - sorry I didn't notice it at first: if you're going to use "header()", it *MUST* come before you output *ANY* other HTML. Including HTML output of any kind from PHP.
Here's a link that explains why: http://us3.php.net/header Your .. PSM |
All times are GMT -5. The time now is 12:04 PM. |