ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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">
<head>
<title>random tag line generator for phpbb sites</title>
</head>
<body>
<!-- Place php code here -->
<?
header('Content-Type: image/png'); // its a png file - let the browser know that
HHHHHHHmmmmmmmmmmmmmmm! Looking here again, I'm not asking if the code will work, only if I impliment it correctly.
So it does not have to be a long post.
imagepng($im2); // write the file as a png
imagedestroy($im2); // no longer need the image
?>
<!-- end php code -->
</body>
Is their a better to way to call php code from the signature box?
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 ;-)!
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)
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 ;-)!
Thank you for the compliment. Kind words always make me feel good.
Quote:
Originally posted by paulsm4
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.
I had not considered that, I must check. Thanks for bringing it up.
Quote:
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.
I tend to agree with you. All the 24 hour and dummy books I have bought wound up been sent to the outhouse for usage if the paper wasn't too slick.
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.
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)
I'm not too sure what I was asking either. Both of you answered what I think I wanted to know. Had I implimented my code correctly. I haven't got a clue about those function calls. I thought for a while they were from the imagemagick suite but have decided they aren't.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.