Forum Moderators: mack

Message Too Old, No Replies

istall php?!

a very newbie question

         

Natko

12:17 am on Mar 27, 2004 (gmt 0)

10+ Year Member



Hi,
I have some confusion of php.
I noticed that php is regulary procesed in a form mail as a preview.php on my local without php installed, but I can't proces an include file comand.
Can anyone brefly give me a word of it.
thanks

mack

2:30 am on Mar 27, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



The common way to include a file using php is as follows...

include "file_name.php" ;

If you are wanting to use php to process your form then you will need to install php.

You may also wish to have a read through the PHP scripting forum.

Hope this helps.

Mack.

Natko

3:07 pm on Mar 27, 2004 (gmt 0)

10+ Year Member



Well, my form processes without having php installed, but include file doesn't. More precisely, include doesn't run but echo does?

bumpaw

5:22 pm on Mar 27, 2004 (gmt 0)

10+ Year Member



preview.php on my local without php installed

I can't tell exactly where the confusion is coming from, but PHP only operates in a server environment.

Natko

6:54 pm on Mar 27, 2004 (gmt 0)

10+ Year Member



yes, I have Apache insalled, but not php. I don't understand why 'echo' or why not 'include'

jatar_k

7:01 pm on Mar 27, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



If the file preview.php works then you have php installed.

What is the file extension of the file you are trying to use include in? is it .php or .html or something else?

Is the preview.php file located in a /cgi-bin/?

another thing you could try to see if php is installed and how is to create a file called phpinfo.php with the following code in it.

<?php
phpinfo();
?>

save it, upload it and view it and that will contain all of the information about the php install.

You could also ask your host.

Natko

9:53 pm on Mar 27, 2004 (gmt 0)

10+ Year Member



I don't have php insalled. Only Apache. Echo in preview works, but include file.php doesn't.
Let me post some codes.
First about include
The string contained in html is <iframe id=cal name=cal src=file.php width=481 height=135 scrolling=no frameborder=0 marginwidth=0></iframe>
and it loads. Than, file.php contains <?php include('include.php');?> and it doesn't work. Include.php is an regular html file contains four include/php_file strings. This happens on my local, but on server everything works fine.
Second a form mail. It works even on my local where pgp is not insalled. An example is <input type="hidden" name="UserName" value="<?php echo $UserName?>"> string. It works. I'm pretty sure that I haven't insalled it. The comp is mine. I know what I have installed. Trust me.
As I'm pretty new in php, I'm confused about when php is need to be installed and when not.

mack

10:13 pm on Mar 27, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



The iframe element...
"<iframe id=cal name=cal src=file.php width=481 height=135 scrolling=no frameborder=0 marginwidth=0></iframe>"
does not use php. It is simply an html element.

The php section...
"<?php include('include.php');?> "
will require php to be installed on your system.

Php is a scripting language and you require the php language to be installed before you can execute any form of php code.

If you are using windows there will be a windows php installer available for download. On linux php will almost certainly be available on your distro cd/ftp.

I think if you install php the problem will be resolved.

Mack.

Natko

10:23 pm on Mar 27, 2004 (gmt 0)

10+ Year Member



I know that, but why echo is parsed, in form preview.php without php installed?

Big_Balou

10:28 pm on Mar 27, 2004 (gmt 0)

10+ Year Member



I have just scanned over the replies in this thread. But to ask a simple question: Why don't you just install PHP on your local machine?

If you would like to try looking at an open source package called "PHP Home" it will install on all versions of windoze with the exception of Win98.

Natko

10:38 pm on Mar 27, 2004 (gmt 0)

10+ Year Member



I'm going to instal it on my win2k partition, but why echo is parsed? I have known that I wont to se php localy I have to instal php. My stupid question is that php is an optional in some cases?

mack

11:15 pm on Mar 27, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



perhps your echo statements are being read as html?

so in effect it is displaying the text within the echo but not actualy using the echo as it was intended.

Mack.

Natko

11:41 pm on Mar 27, 2004 (gmt 0)

10+ Year Member



<input type="hidden" name="UserName" value="<?php echo $UserName?>"> is in preview.php and is regulary processed and displayed, but not the 'include'. Both on w2k with Apache, without php. If I would have php installed both things will work. But, in my case none of them should work, right?

ergophobe

10:24 pm on Mar 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Assuming that all functions and language contructs are enclosed in <?> then yes, it should be all or none.

Now, just to help everyone get a grip here, what happens if in your preview.php file, you add this line

<? phpinfo();?>

Natko

11:52 pm on Mar 29, 2004 (gmt 0)

10+ Year Member



mack ... preview.php is preprocessed
ergophobe ... I don't know what happens. You tell me.

ergophobe

1:04 am on Mar 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



well try it. add it, try it and report back

Tom

Natko

10:25 am on Mar 30, 2004 (gmt 0)

10+ Year Member



do you mean a status of server and php report? I won't try it on my local, I havn't got MySQL installed.

ergophobe

11:41 pm on Mar 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



you don't need mysql.

Just create a file called

pasta.php

and put one line in it

<? phpinfo();?>

Then open it through your server

[localhost...]

and report back on what happens

Tom

Natko

12:20 am on Mar 31, 2004 (gmt 0)

10+ Year Member



ok, but first I have to instal SP3 and SP4 and some pathches becouse of svchost.exe on w2k. Then I'll do it nad report it back here. And right now I'm going to sweet dreams. thanks :-)