Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Configuration of web server to use PHP
Old 06-11-2005, 07:09 AM Configuration of web server to use PHP
Super Talker

Posts: 148
Trades: 0
I just used the windows installer to install the latest version of php. When i do a simple php coding, i do not see the desired results. Error is "Order processed at "; echo date("H:i, jS F"); echo "
"; ?>" Below is the full coding:

<html>
<head>
<title>Bob's Auto Parts - Order Results</title>
</head>
<body>
<h1>Bob's Auto Parts</h1>
<h2>Order Results</h2>
<?php
echo "<p>Order processed at ";
echo date("H:i, jS F");
echo "<br>";
?>
</body>
</html>

I do not know how to configure my localhost to make it support PHP. My problem is also attached to this email. Thank you
shaoen01 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-11-2005, 07:31 AM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
PHP files have to be parsed through a server.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-11-2005, 08:01 AM
Monkeon's Avatar
Skilled Talker

Posts: 59
Trades: 0
Yeah, it looks like you just opened the file with the web browser.
It has to be opened with the server address.

For instance

http://localhost/path_to_php_file/test.php

or

http://127.0.0.1/path_to_php_file/test.php
__________________

Please login or register to view this content. Registration is FREE
FREE Online Dating!
Meet your perfect match online right now!
Monkeon is offline
Reply With Quote
View Public Profile
 
Old 06-11-2005, 08:07 AM
Monkeon's Avatar
Skilled Talker

Posts: 59
Trades: 0
I just thought...

Do you have any webserver software installed??
You'll need to get something like Apache or IIS. And make sure you put the .php files into the web directory or the 'localhost' link I showed you earlier isn't going to work
__________________

Please login or register to view this content. Registration is FREE
FREE Online Dating!
Meet your perfect match online right now!
Monkeon is offline
Reply With Quote
View Public Profile
 
Old 06-12-2005, 06:59 AM
Super Talker

Posts: 148
Trades: 0
Hi,
Yeah i have IIS server. I have put the .php file into my wwwroot folder in inetpub and it works. But i am just wondering is there any software that i could use that can help me call the .php file without me typing in the full url?
shaoen01 is offline
Reply With Quote
View Public Profile
 
Old 06-12-2005, 07:05 AM
Super Talker

Posts: 148
Trades: 0
You see i am using a html file that acts like a form, so when user clicks on the submit form button, he will be redirected to the .php file above. How am i suppose to redirect it and make it sure that the .php file works?

Is there a method to do that or a software that can help me? Thanks
shaoen01 is offline
Reply With Quote
View Public Profile
 
Old 06-12-2005, 07:07 AM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
<form action="/path-and/name-of-php-page.php" ...>
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-12-2005, 07:31 AM
Super Talker

Posts: 148
Trades: 0
Hi Chris,

I did this <form action="/PHP_MySQL Practise/processorder.php" method=post>, and my submit button stopped working. Do you know why? Thanks
shaoen01 is offline
Reply With Quote
View Public Profile
 
Old 06-12-2005, 07:36 AM
Super Talker

Posts: 148
Trades: 0
Wait ... urm okay let me explain. I have two files, one html and php file in the same folder. The html file is a order.html form and within this order.html form, there are variables. And in the processorder.php file, i wish to access the variables in the order.html file, for example $aaa.

But when i try to echo the value stored in $aaa in processorder.php file, it gives out an error. The error show below:

Your order is as follows:"; echo "
"; echo $HTTP_POST_VARS["tireqty"]." tires
"; echo $oilqty." bottles of oil
"; echo $sparkqty." spark plugs
"; ?>

Does anyone know how to solve this problem?
shaoen01 is offline
Reply With Quote
View Public Profile
 
Old 06-12-2005, 09:45 AM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
I don't see an error there.
I do see a chunk of PHP code, though that doesn't appear to have an opening delimiter "<?"


have you tried a simple test to see if the php interpreter is running and parsing pages ?

put this in a page called hello.php in the webroot

PHP Code:
<?
echo "hello world";
?>
Then call the page with http://localhost/hello.php
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-12-2005, 09:57 AM
Monkeon's Avatar
Skilled Talker

Posts: 59
Trades: 0
Your webserver still thinks you're trying to view a html file. It looks like PHP hasn't been installed properly.

Put this text into a text file and name it test.php

PHP Code:
<?PHP

echo "Hello world";

?>
and call the file through the server

http://localhost/test.php


If you see the output "Hello World" by itself, then your PHP installation is fine.
If you see all that PHP code above, then the installation has gone wrong somewhere.

I suggest going to php.net and downloading the Windows Binary, making sure you get the one that automatically configures IIS for you.
__________________

Please login or register to view this content. Registration is FREE
FREE Online Dating!
Meet your perfect match online right now!
Monkeon is offline
Reply With Quote
View Public Profile
 
Old 06-12-2005, 09:58 AM
Monkeon's Avatar
Skilled Talker

Posts: 59
Trades: 0
Ahh u got there before me Chrishirst
__________________

Please login or register to view this content. Registration is FREE
FREE Online Dating!
Meet your perfect match online right now!
Monkeon is offline
Reply With Quote
View Public Profile
 
Old 06-12-2005, 09:52 PM
Super Talker

Posts: 148
Trades: 0
The hello world is printed out on the internet browser. That is not my problem. My problem is that when i use a html file to call the php file, the url of the internet browser is no longer "http://localhost/test.php", instead the url is from "file:///c:/Inetpub/wwwroot/PHP_MySQL%20Practise/processorder.php".

Here is the code for the order.html file:

<html>
<head>
<title>Bob's Auto Parts</title>
</head>
<body>
<h1>Bob's Auto Parts</h1>
<h2>Order Form</h2>

<form action="processorder.php" method=post>
<table border=0>
<tr bgcolor=#cccccc>
<td width=150>Item</td>

<td width=15>Quantity</td>
</tr>
<tr>
<td>Tyres</td>
<td align=center><input type="text" name="tyreqty" size=3 maxlength=3></td>
</tr>
<tr>
<td>Oil</td>
<td align=center><input type="text" name="oilqty" size=3 maxlength=3></td>

</tr>
<tr>
<td>Spark Plugs</td>
<td align=center><input type="text" name="sparkqty" size=3 maxlength=3></td>
</tr>
<tr>
<td colspan=2 align=center><input type=submit value="Submit Order"></td>
</tr>
</table>
</form>

</body>
</html>



And this is the code for the processorder.php file:

<html>
<head>
<title>Bob's Auto Parts - Order Results</title>
</head>
<body>
<h1>Bob's Auto Parts</h1>
<h2>Order Results</h2>
<?
echo "<p>Order processed at ";
echo date("H:i, jS F");
echo "<br>";
echo "<p>Your order is as follows:";
echo "<br>";
echo $tyreqty." tires<br>";
echo $oilqty." bottles of oil<br>";
echo $sparkqty." spark plugs<br>";
?>
</body>
</html>

Please help me out guys, thanks.
shaoen01 is offline
Reply With Quote
View Public Profile
 
Old 06-13-2005, 02:12 AM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
aha! kerchink (that's the sound of a penny dropping. BTW) A minor fact you have missed mentioning previously

use http://localhost/order.html and all will be well.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-14-2005, 09:07 PM
Super Talker

Posts: 148
Trades: 0
This works totally fine. Thank you

Now that i have got this running, i am wondering is there anyway i can make apache and IIS run together without both of them clashing? And access both of them?
shaoen01 is offline
Reply With Quote
View Public Profile
 
Old 06-15-2005, 01:50 AM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
yes, install apache and configure it to use a different port, 8080 is the usual one then you can access the site via http://localhost:8080
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-15-2005, 09:04 AM
Super Talker

Posts: 148
Trades: 0
Just to let you know that i am using EasyPhp:
http://www.easyphp.org/

I did change the apache port to 8080 but it seems to clash with my IIS. And i also have Visual Studio.net 2003 installed and it totally clashes once i change the apache port to 8080. Before that every will work but i will not be able to use the apache server. Is there anyway i come around it and ensure that both are working?
shaoen01 is offline
Reply With Quote
View Public Profile
 
Old 06-15-2005, 10:49 AM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
maybe VS uses 8080, try 8081 or 8888 many ports from 8000 upwards are free or negotiable

make sure you restart Apache after changing the port in httpd.conf
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Configuration of web server to use PHP
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.50596 seconds with 12 queries