Page 1 of 3

PHP problem

Posted: Fri Oct 06, 2006 9:39 pm
by Racoon200
this might be the most rookie Q uve heard but, when i save a *.phtml file, it doesnt appear as a IE# file, and i try t open it with IE and it doesn't work, even though it CAN open phtml files, when they are in web pages. :(

Posted: Fri Oct 06, 2006 9:53 pm
by aaronhall
* Please use descriptive post titles
* Please post PHP-related questions in the PHP forum
* Please do not use AOL-speak

This depends on your Apache configuration, not on your browser. Take a look at http://alfredo.palconit.com/archives/ph ... dconf.html

Posted: Sat Oct 07, 2006 11:35 am
by Racoon200
Thanks dude. Ill try in alfreospage but i would like to know why that happens and if i can edit a php with the notepad and save it as php without it being tagged automatically with a txt extension.

About the ttle, i post it like that so people gets curious, like you lol

Posted: Sat Oct 07, 2006 11:40 am
by feyd
Regarding titles, there's this:
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.
Regarding posting location, there's this:
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:1. Select the correct board for your query. Take some time to read the guidelines in the sticky topic.
As for using notepad: download a real code/text editor. There's a long thread in General Discussion regarding editors people have recommended, so this isn't the place to talk of that.

As for getting the filename use double quotes around the filename to make it literal to notepad: "foo.php" for example.

Posted: Sat Oct 07, 2006 11:48 am
by Racoon200
omg i didnt notice those rules, iam sry
thnks for the tips with the notepad dude
damit! u answer fast!

O, i already saved some php files and phtml, but my IE continues without reading them, is there something i need to install. (i got SP2)

Posted: Sat Oct 07, 2006 12:16 pm
by feyd
Have a read through the Starter Pack.

And please, stop using aolSpeak.

If you're not sure what that means: http://en.wikipedia.org/wiki/AOL_speak

Posted: Sat Oct 07, 2006 1:58 pm
by RobertGonzalez
.phtml files still need to be parsed through the PHP engine. Are you putting the .phtml files in your server path somewhere and calling them like a web page (from http://localhost/mypage.phtml) or are you trying to view them as html files in your browser?

Posted: Sat Oct 07, 2006 2:41 pm
by Racoon200
look, 2b honest, my web page hasnt any files (http://www.xtra-e-ncome.com), but what i do is that i make my txt files and save em like you told me("foo.phtml"). Then i try to run them wih IE7 browser, but he cant read em, so. dats my problem. IDK if i have to install those php files (php.net) in my computer or what, i would appreciatte advice.

Posted: Sat Oct 07, 2006 3:44 pm
by jayshields
feyd wrote:stop using aolSpeak.

If you're not sure what that means: http://en.wikipedia.org/wiki/AOL_speak

Posted: Sat Oct 07, 2006 5:31 pm
by RobertGonzalez
Everah | Moved to Miscellaneous
Racoon200 wrote:look, 2b honest, my web page hasnt any files (http://www.xtra-e-ncome.com), but what i do is that i make my txt files and save em like you told me("foo.phtml"). Then i try to run them wih IE7 browser, but he cant read em, so. dats my problem. IDK if i have to install those php files (php.net) in my computer or what, i would appreciatte advice.
First bit of advice, please stop using AOL speak. There are a lot of people that visit these forums from all over the world. It is hard enough for a native English speaker to understand AOL speak, I can imagine how difficult it could be for someone that doesn't speak English as a primar language. Thanks in advance for following that rule.

Next, you are going to need to set your computer up as a server. The most commonly recommended package for doing this for you is XAMPP which installs the Apache Web Server, the MySQL database server, PHP, Perl and host of other web server apps. Additionally, you can install each component individually if you wanted to. I would suggest installing the Apache web server (version 2.0.X) first, then the MySQL database server (version 5.0.X), then PHP (version 5.1.X). Whenever possible, and if you are on Windows, install them using the installers (.msi files) as the wizards make installation a lot easier than manual configuration. Of course, if you want to teach yourself how to install these apps, a manual install might be a better learning experience than the wizard.

Start with that, and make sure to follow the installation instructions to the letter. Then save your phtml (or .php files) into your web server somewhere and call it in your browser like you would any web site substituting the domain.com bit for localhost.

Post back if you have any questions.

Posted: Sat Oct 07, 2006 6:01 pm
by Racoon200
jayshields wrote:
feyd wrote:stop using aolSpeak.

If you're not sure what that means: http://en.wikipedia.org/wiki/AOL_speak
why the hell did you replied my topic just to say stop using AOL speak if you didnt reaply something useful dude, i think you may need t remember the purposes of replies.

And in reply to everal, i think you guyz are confusing my question. I just wanted to know what do i need or what is happening that i can't test my php and phpfamily files. Just that, no need to host the files for the moment.

PS: Im not a native speaker, just for information. I WILL stop using aolspeak but as iam latin, spanish native speaker, and i learned to interpret AOL speak, so can they learn. Also, is much easier to use it.

Posted: Sat Oct 07, 2006 6:26 pm
by RobertGonzalez
Racoon200 wrote:And in reply to everal, i think you guyz are confusing my question. I just wanted to know what do i need or what is happening that i can't test my php and phpfamily files. Just that, no need to host the files for the moment.
PHP files can only be tested by executing them. If you don't have a PHP engine on your machine then you will either need to host the file to test it or look at the code to test it because a browser will not do anything with a .php, .phtml, .php3, .php4, or .php5 file because it doesn't know what to do with it. The previous explanation I offered was to explain how to set up a PHP engine on your computer to test your PHP files.

Please keep in mind that PHP is a server side language and that if there is nothing to interpret it, all you will have is a text file with code in it that does nothing.

Posted: Sun Oct 08, 2006 8:51 pm
by Racoon200
thanks man, thats the kind of answers that everyone would like to have. i apreciatte

Well, i was thinking that i could propbably use the javascript to susbstitute the php, now that i only want the php for making a format page, or a top and bottom that appears in every page.

Posted: Mon Oct 09, 2006 9:09 pm
by Racoon200
Oh! one last thing. I already installed Apache and MySQL, but i only get the PHP5 to install manually. Can i install PHP4 instead or is there any PHP5 msi package?

Posted: Tue Oct 10, 2006 10:12 am
by RobertGonzalez
You know what, I don't think there is an installer for PHP5. But I set it up on my current machine following the instructions and it only took about 20 minutes. Follow the install instructions to the letter and it should not be that difficult or problematic to install it.