SunQuest
           PHP Installation
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
IBM developerWorks
Go Back   Codewalkers ForumsPHP RelatedPHP Installation

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today!
  #1  
Old February 22nd, 2004, 10:11 PM
Porco Porco is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Hobart, Tasmania, Australia
Posts: 158 Porco User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Php installed but can't embed in html code

Hi
I have installed mysql, apache and php latest versions on win xp.

I have followed instructions precisely in 'PHP and MySQL Web Development by Luke Welling and Laura Thomson'.

Now mysql is fine.... and when I type in http://localhost I get the correct page so Apache must be configured right

And finally when I type in http://localhost/test.php (pointing to a test page with phpinfo()) the php4 page appears in my browser, so that is apparently installed properly.

I also installed PEAR.

But... umm when I try to embed php in my html page, just a simple echo, it is a no go. It neither works nor hides the raw php on the output page....

I have read the doc you have pointed to, a bit beyond me really as I am new to php etc, but i feel there must be something pretty obvious missing here.

Thanks if you could give me a hand.

Is there something specific I have missed?

Reply With Quote
  #2  
Old February 22nd, 2004, 10:54 PM
nawlej nawlej is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Dallas, Tx. USA
Posts: 2,008 nawlej User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 7 m 51 sec
Reputation Power: 4
RE: Php installed but can't embed in html code

Well, it sounds as if it is all installed correctly...Can you post an example of some code you cant get to embed?

Reply With Quote
  #3  
Old February 22nd, 2004, 10:57 PM
Porco Porco is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Hobart, Tasmania, Australia
Posts: 158 Porco User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Php installed but can't embed in html code

Oh i have also put in my config file

ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"

am a bit stuck for ideas at this point

Reply With Quote
  #4  
Old February 22nd, 2004, 11:00 PM
nawlej nawlej is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Dallas, Tx. USA
Posts: 2,008 nawlej User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 7 m 51 sec
Reputation Power: 4
RE: Php installed but can't embed in html code

like i said, post some code....Its probably just how you are trying to embed it is all.

Reply With Quote
  #5  
Old February 22nd, 2004, 11:01 PM
Porco Porco is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Hobart, Tasmania, Australia
Posts: 158 Porco User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Php installed but can't embed in html code

In my form tag on the web page I call action="processorder.php" method="post"

In processorder.html under some h2 tags I have

<?php
echo '<p>Order processed</p>';
?>


---- Prob is doesn't print Order processed or hide raw php

Reply With Quote
  #6  
Old February 22nd, 2004, 11:04 PM
nawlej nawlej is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Dallas, Tx. USA
Posts: 2,008 nawlej User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 7 m 51 sec
Reputation Power: 4
RE: Php installed but can't embed in html code

what happens when you view source? does it show up in yoru source? Also, is the extension of that page you are including in php? It wont parse if it is just an .html file.

Reply With Quote
  #7  
Old February 22nd, 2004, 11:05 PM
Porco Porco is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Hobart, Tasmania, Australia
Posts: 158 Porco User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Php installed but can't embed in html code

Yes it shows both the html and the php code

Reply With Quote
  #8  
Old February 22nd, 2004, 11:07 PM
nawlej nawlej is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Dallas, Tx. USA
Posts: 2,008 nawlej User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 7 m 51 sec
Reputation Power: 4
RE: RE: Php installed but can't embed in html code


Quote:
Yes it shows both the html and the php code


Whats the extension of the pagename?

Reply With Quote
  #9  
Old February 22nd, 2004, 11:08 PM
Porco Porco is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Hobart, Tasmania, Australia
Posts: 158 Porco User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Php installed but can't embed in html code

sorry
it is 'orderform.html'
and
'processorder.php'

Reply With Quote
  #10  
Old February 22nd, 2004, 11:12 PM
nawlej nawlej is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Dallas, Tx. USA
Posts: 2,008 nawlej User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 7 m 51 sec
Reputation Power: 4
RE: Php installed but can't embed in html code

yeah its not gonna embed in a html file.....switch the exntension.

Reply With Quote
  #11  
Old February 22nd, 2004, 11:13 PM
Porco Porco is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Hobart, Tasmania, Australia
Posts: 158 Porco User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Php installed but can't embed in html code

sorry, the form is a html file
and the page called is php.

Should they both be .php extensions??

Reply With Quote
  #12  
Old February 22nd, 2004, 11:19 PM
Porco Porco is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Hobart, Tasmania, Australia
Posts: 158 Porco User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Php installed but can't embed in html code

Here are both pages--- First "orderform.html"

<html>
<head>
<title>Bob's Auto Parts</title>
</head>

<body>
<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>Tires</td>
<td align="center"><input type="text" name="tireqty" 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" size="3" maxlength="3"></td>
</tr>
</table>
</form>
</body>
</html>


-- here is 'processorder.php'
<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</p>';
?>

</body>
</html>

Reply With Quote
  #13  
Old February 23rd, 2004, 12:55 AM
Porco Porco is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Hobart, Tasmania, Australia
Posts: 158 Porco User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Php installed but can't embed in html code

Here is a clue:---

if I put 'processorder.php' into htdocs folder and type "http://localhost/processorder.php" into the browser it works....

all I am asking is really why its not working when I have a html file and a php file in their website directory on my local machine??

any help appreciated...

Reply With Quote
  #14  
Old May 18th, 2004, 07:28 AM
PsychicReader PsychicReader is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Melvindale,MI.,USA
Posts: 2 PsychicReader User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to PsychicReader Send a message via Yahoo to PsychicReader
RE: Php installed but can't embed in html code

ok I'm running into the same problem how can I get this to work right any help would be appreciated. I have a htm extention that is like the header and the rest of what has to be embeded is exe php??

Reply With Quote
  #15  
Old May 19th, 2004, 01:12 AM
Porco Porco is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Hobart, Tasmania, Australia
Posts: 158 Porco User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Php installed but can't embed in html code

Hi,
I had installed everything all right, Apache, PHP, MySQL. The problem was in my understanding of Apache being a web server.

Basically put your pages in htdocs, or directories inside htdocs. And that is fine.

Why you just can't double click them and look at them on your local machine is that it is in the Apache server. If you type in http://localhost/mypage.php or whatever and you see your page, well that is working fine.

I thought for some reason I should be able to double click and view a page. Nobody thought to explain to me either and it caused me no end of grief.

I hope this is of some help.

Steven
www.nortypig.com
www.blog.nortypig.com

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Installation > Php installed but can't embed in html code


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register