Computing.Net > Forums > Web Development > PHP and how to call it?

PHP and how to call it?

Reply to Message Icon

Original Message
Name: boaster
Date: May 15, 2008 at 08:16:51 Pacific
Subject: PHP and how to call it?
OS: n/a
CPU/Ram: n/a
Model/Manufacturer: n/a
Comment:

Where do I put my php scripts and then how do I refer to them in my code.

My web directory is public_html/website.
The page calling the script is public_html/website/happenings/happage.html

I put a php subdirectory under public_html as instructed by my web host but get a "script not found" error when I use any of the following as the script path for test.php:

test.php
../../php/test.php
public_html/website/php/test.php

If I move the .php file to the "happenigns" directory then I get a "no script directory found" error.

Thank you


Report Offensive Message For Removal


Response Number 1
Name: ShaqDiesel
Date: May 20, 2008 at 13:00:59 Pacific
Subject: PHP and how to call it?
Reply: (edit)

Assuming you're using apache, look in your server configuration file httpd.conf. Whatever you set your DocumentRoot as is where your php scripts should go. By default it should be your htdocs folder.

To refer to the php script, set the action attribute of your html form to the path of your php script.


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: PHP and how to call it?

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




How often do you use Computing.Net?

Every Day
Once a Week
Once a Month
This Is My First Time!


View Results

Poll Finishes In 3 Days.
Discuss in The Lounge