|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today! |
|
#1
|
|||
|
|||
|
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? |
|
#2
|
|||
|
|||
|
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?
|
|
#3
|
|||
|
|||
|
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 |
|
#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.
|
|
#5
|
|||
|
|||
|
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 |
|
#6
|
|||
|
|||
|
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.
|
|
#7
|
|||
|
|||
|
RE: Php installed but can't embed in html code
Yes it shows both the html and the php code
|
|
#8
|
|||
|
|||
|
RE: RE: Php installed but can't embed in html code
Quote:
Whats the extension of the pagename? |
|
#9
|
|||
|
|||
|
RE: Php installed but can't embed in html code
sorry
it is 'orderform.html' and 'processorder.php' |
|
#10
|
|||
|
|||
|
RE: Php installed but can't embed in html code
yeah its not gonna embed in a html file.....switch the exntension.
|
|
#11
|
|||
|
|||
|
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?? |
|
#12
|
|||
|
|||
|
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> |
|
#13
|
|||
|
|||
|
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... |
|
#14
|
|||
|
|||
|
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??
|
|
#15
|
|||
|
|||
|
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 |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Installation > Php installed but can't embed in html code |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|