PDA

View Full Version : PHP Ignorance?


SneakyDave
02-24-1999, 08:49 PM
I don't have MySQL, but I'm trying a few things with PHP. I tried installing the simple "quotations.php3" code at:
http://io.incluso.com/content.php3?sec=art&req=php&issue=11&pg=1 , but I just get a blank screen executing it. It doesn't use any MySQL at all.

I double checked that it FTP'd as ASCII and the name and permissions are correct.

Does it belong in a special directory, or am I calling it incorrectly? The sample from the url seems to display the form correctly, but it doesn't work otherwise.

Deb
02-24-1999, 09:16 PM
I've just put it up here...
http://midnightmerchants.com/quote/testphp.php?req=view

W/o seeing your script it's hard to say what may be missing but some points to look for right off the bat would be....

1. make sure there is no spaces above the first <? (I found this out the hard way hehe)

2. Make sure you are going for the full url and not just the file name... e.g. filename.php will return a blank page but filename.php?req=view should give the page...

3. If you have renamed the file make sure you replace all instances of "quotations.php3" in the script with the correct name of the file (same goes for the quotefile.dat file)

4. Make sure they are set to chmod 777

If none of the above work... let us know where yours is at and we'll take a look http://www.aota.net/ubb/smile.gif

Deb

SneakyDave
02-24-1999, 09:29 PM
Deb, once again, that's TOO FAST of an answer. http://www.aota.net/ubb/smile.gif (it was the req=view option that I was missing).
Thanks again.
Sneaky

SneakyDave
02-24-1999, 09:36 PM
Oh, and before anybody uses that script, I think you need to create an empty quotefile.dat file.

Mine wasn't working without it. The sample script at the url in the first post has this problem (I think).

Sneaky

Justin
02-25-1999, 06:42 AM
Deb - that blank line thing only applies to the GIF creation for some reason. Any other file doesn't matter.

The php file doesn't need to be 777 - only the file being written to, I think.

You could place this in the php file:

if(req == "") {
[nbsp][nbsp][nbsp][nbsp]req = "view";
}

This will make that the default action, if none other is specified. Like the UBB - if you don't say action=intro it assumes that anyway.

Ok, there's my 2 cents http://www.aota.net/ubb/smile.gif

Justin

SneakyDave
02-25-1999, 09:41 AM
Justin, that's a great idea, I'll try it out.

Another PHP question. What's this GD support I hear about when graphics are involved with a PHP script. Does FQ have it? Does it mean, "Hey, my script isn't working, where's the G.D. support?"

Thank you.

Sneaky

Jacob Stetser
02-25-1999, 11:12 AM
Heh.

Around here, you don't have to ask where the G** D*** support is! Just email support@futurequest.net and there's your support http://www.aota.net/ubb/wink.gif

Seriously, it's a library of graphics drawing routines that can create images on the fly.

It's especially useful for creating up-to-date graphs and stuff like that.

I may be wrong, but I bet the CNC statistics program uses it.

Jake

Deb
02-25-1999, 04:33 PM
Yes we do have GD Support http://www.aota.net/ubb/wink.gif

I like your ideas Justin! Thanks http://www.aota.net/ubb/smile.gif

Deb

Terra
02-25-1999, 05:04 PM
I compiled the GD library specifically for PHP3 support...

Just do a phpinfo() and you will see the library listed...

--
Terra
sysAdmin
FutureQuest

SneakyDave
02-27-1999, 12:13 PM
MORE ignorance!
After submitting myself to fits of rage and frustration, I think I realized that PHP pages need to have a .phtml identifier. Is this completely true? Inside a server side include, I was trying to include a PHP script, but after hours of frustration, I don't believe I can do it, do to the fact that the SSI page is named .shtml

Deb
02-27-1999, 06:05 PM
You are correct in that SSI needs to have a .shtml extension to work... and PHP needs to have either the .php, .php3, or .phtml extension to work. If you use a .phps extension you get the code in pretty colors http://www.aota.net/ubb/wink.gif

These things can be overridden with .htaccess files but it's not recommend...

Deb

SneakyDave
03-01-1999, 06:12 PM
Thanks Deb, I think I'm just going to convert all my SSI's to PHP and the problem should be solved.

I was amazed at how easy some things are to do in PHP, and I don't even have MySQL.

Are there ANY browsers that won't support PHP? A friend of mine claimed that his WebTV unit wouldn't recognize any .phtml files. I called him a pigeon-toed, bow-legged, bald-faced liar! Was I correct?

Deb
03-01-1999, 06:17 PM
I can not say either way with WebTV -- they are totally different from the 'standard web' with their own rules ...

As far as the net standards... no browser should have a problem with php. This is all done by the server before the browser sees the page. It's a server-side-scripting-language.

Deb

Justin
03-01-1999, 06:44 PM
The browser should display a page according to the Content-type sent by the server - regardless of the extention. If the server says it's text/html then by golly the browser should show it as text/html. If it says it's a gif, then it's a gif. The file extention shouldn't matter.

And yes, it's done all on the server, so it's totally browser independant, unlike Java / Javascript / CSS. Just view source on a PHP page - you won't find any PHP code there at all (same with SSI's, Perl, CGI, etc.).

You should be able to include a php file in an shtml file - it will parse the php properly. Just not the other way around. Example: Inside of index.shtml:

<!--#include file="header.php" -->

header.php will get included and parsed. But for some reason, you can't do it the other way, including an SHTML page in a php page. I think it has to do with the order that things are parsed.

It is recomended that you use the extention of PHP or PHP3 instead of PHTML - I think there is something else out, or soon to be out, using PHTML - and PHP can mean any version - so PHP3 is the best way to go. That should always work. Or maybe PHP is better, so when PHP4 comes out...

BTW, I have the WebTV emulator browser thingy, and my PHP pages work fine there - so I don't see why it wouldn't on the real thing - well, as real as WebTV could get, anyway http://www.aota.net/ubb/smile.gif


------------------
Justin Nelson, SFE Software
www.vdj.net (http://www.vdj.net)

Del
03-01-1999, 10:53 PM
<edit>
wrong again
</edit>

Del

[This message has been edited by Del (edited 03-02-99).]

Terra
03-01-1999, 11:43 PM
PHP3 will remain as .phtml, I won't be changing that, but don't recommend using .phtml... .php or .php3 is much cooler http://www.aota.net/ubb/biggrin.gif

The mime type I will use for embedded perl will be .eperl...

Hope this clears the confusion...

--
Terra
--my brain on pause

Del
03-02-1999, 03:24 AM
Sorry, was just going on what I read in a previous post on a similar subject http://www.aota.net/ubb/Forum15/HTML/000020.html

Del

Deb
03-02-1999, 03:36 AM
hehe Del, I would have had said the same as you..... as there was a time the phtml was being spoken of for the Embedded perl http://www.aota.net/ubb/smile.gif

Getting inside the mind of the sys admin can be a task to say the least http://www.aota.net/ubb/wink.gif

Deb

Del
03-02-1999, 04:02 AM
Getting inside the mind of the sys admin can be a task to say the least


you **** skippy! http://www.aota.net/ubb/smile.gif

Del

SneakyDave
03-02-1999, 06:00 PM
Well, now I've PERSONALLY seen both .phtml and PHP3 pages work on a WebTV Classic, so my friend WAS a pigeon-toed, bow-legged, bald-face liar, and I reminded him of that fact. I told him to buy a REAL internet connection as I stormed out his door.
So I think we can consider this thread closed if nobody objects....
Sneaky

Terra
03-02-1999, 06:26 PM
Wow SneakyDave - I do LIKE your style!

Want a job doing tech support for us??? http://www.aota.net/ubb/wink.gif

--
Terra
--Another one bites the dust--
FutureQuest

SneakyDave
03-03-1999, 02:35 PM
Oh yeah, I can really see that... I'd just tell everybody to clear their cache, make sure its an ASCII transfer, and if that didn't work, then call them all LIARS! Liars from the pit of Hades!

Is there a good PHP reference book out there somewhere?

Sneaky

Deb
03-03-1999, 04:58 PM
No, not yet http://www.aota.net/ubb/frown.gif

Something should be out around April/May-- we are anxious to see the MySQL book come out!!!!!

Deb