Click to See Complete Forum and Search --> : Urgent PHP Question!
Memphis10
07-26-2003, 07:59 PM
I am trying to do a simple php order form.
I have the order form with a..
<--form action="processorder.php" method=post on a html file-->
& the processorder.php with this code...
<--?php
echo '
Order processed.
';
?-->
I tested it & I dont see the words "order processed" php text.??
I think its because I have the html & php files in a folder on the desktop. I am supposed to put them in the local host folder?? & if so where is it??
cgraz
07-26-2003, 08:15 PM
yeah they need to be in your web docs directory. What web server are you using? Apache? What OS?
If you're on windows using apache, check c:/program files/apache... or something to that effect.
Cgraz
Memphis10
07-26-2003, 08:50 PM
I am using Apache. I got it from this cd rom from this book Im using. Its called apache_1.3.27-win32-x86-no_src
I checked c:/program files/apache group/apache but there are a few folders in there. bin, htdocs, cgi-bin, conf, icons, include, lib, libexec, lib, modules, logs and proxy...
Which one should I use?
cgraz
07-26-2003, 08:57 PM
i'm pretty sure it's the htdocs one
Cgraz
Memphis10
07-26-2003, 09:12 PM
I put both files in the htdocs folder. But I did not work??
But also in the htdocs folder, there is a manual folder, with about 5 other folders in it??
:confused: :confused:
cgraz
07-26-2003, 09:32 PM
i'm pretty sure it should work in that htdocs folder. Are you sure apache is running?
Cgraz
Memphis10
07-26-2003, 09:44 PM
I assume Apache is running...
I checked the http://localhost in my browser & I got this message...
If you can see this, it means that the installation of the Apache web server software on this system was successful. You may now add content to this directory and replace this page.
Seeing this instead of the website you expected?
This page is here because the site administrator has changed the configuration of this web server. Please contact the person responsible for maintaining this server with questions. The Apache Software Foundation, which wrote the web server software this site administrator is using, has nothing to do with maintaining this site and cannot help resolve configuration issues.
I am also doing this in Dreamweaver if that matters...
cgraz
07-26-2003, 10:06 PM
there should be an index.htm or index.html in that htdocs folder. Open it up and see if it says
If you can see this, it means that the installation of the Apache web server software on this system was successful. You may now add content to this directory and replace this page.
If not, locate that file. That's where you want to place your .php files.
Cgraz
superwormy
07-26-2003, 10:14 PM
What is the URL you're viewing in your browser? It should be something to the effect of:
http://localhost/filename.php
Memphis10
07-26-2003, 11:49 PM
Quote: there should be an index.htm or index.html in that htdocs folder. Open it up and see if it says.
There are a bunch of index.html files in htdocs folder. But they all have different have words after .html Like index.html.pt, index.html.no, index.html.cz etc... and they are files that can not be opened...
:confused:
Memphis10
07-27-2003, 12:01 AM
Quote: What is the URL you're viewing in your browser? It should be something to the effect of:
http://localhost/filename.php
I put in both...
http://localhost/orderform.html
and
http://localhost/processorder.php
Neither one worked...I assume because they are not in the local host folder...? dont know where it is??
But when I did the
http://localhost/orderform.html
& pressed Submit. It gave me this message...
Method Not Allowed
The requested method POST is not allowed for the URL /processorder.php.
Apache/1.3.27 Server at Rafik.cablebahamas.net Port 80
superwormy
07-27-2003, 12:24 AM
First off, you should put all your files in teh same folder as all those index.html.* files are.
And delete those, those are just index pages for differnet languages. Default Apache ones.
How did you POST to processorder.php? You just said in the sentence above neither page worked...
I would suggest you create a file with just <?php phpinfo(); ?> and make sure PHP is working. It will display a ton of stuff if its working.
You did install both Apache and PHP right?
Memphis10
07-27-2003, 12:44 AM
Quote:How did you POST to processorder.php? You just said in the sentence above neither page worked...
Okay, this is what I did. I have this PHP book. & I am tryin this example..."Bobs Auto Parts order form"...This the script on the 1st page...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<--html>
<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"></td>
</tr>
</table>
</form>
</html-->
Then It said create a new doc. & put this code...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<--html>
<head>
<title>Bob's Auto Parts - Order Results</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<h1> Bobs Auto Parts</h1>
<h2> Order Results</h2>
<?php
echo "Order processed.";
?>
</body>
</html-->
Okay 1st just had the 2 files html & .php in a folder on the desk top, when I clicked submit. It went to the 2nd page, but I did not see the php "Order processed" words. Only the html basic text "Bobs Auto Parts Order results"....
Now, I know I had in in the wrong folder, now I am trying to put them in the right place...
I hope I am explain'ing my self right, because I really would like to get this to work...
Memphis10
07-27-2003, 01:01 AM
Quote:I would suggest you create a file with just <?php phpinfo(); ?> and make sure PHP is working. It will display a ton of stuff if its working.
hmmm. You mean create a new html html file in dreamweaver Mx and put the <?php phpinfo(); ?> code in the body tags save it & preview it...
If so, I did that & I saw I blank screen in the browser? But there was the yellow php icon in dreamweaver Mx...
:confused:
superwormy
07-27-2003, 11:06 AM
No, I mean create a .php file, and put this in it:
<?php
phpinfo();
?>
Save it to the /htdocs/ folder or other folder where all those index.html.* files are.
Open Internet Explorer and browse to http://localhost/name_of_the_file_you_just_made.php
And tell us what it does.
Memphis10
07-27-2003, 02:30 PM
Okay,
I made the .php file put in in the htdocs folder. the name was oner.php Then I did http://localhost/oner.php. Then It asked me if I wanted to open or save the file. I clicked Open.
Then I took me to Dreamweaver Mx, the file was there. I then clicked preview in browser. Then it said...
"To preview pages containing server side code you need a testing sever. Would you like to speficy one now"
I clicked yes. Then I took me to the Define sites window. There was the local info option & the local root folder was in the Apache/htdocs folder.
& there was a testing server option. I clicked it & I saw "server model", "this site contains" & "Access"
Now Dont which one to pick. I assume in the server model I pick PHP & Access is local network...?
I did that & got a blank screen i the browser...?
superwormy
07-27-2003, 03:19 PM
If it asked you if you wanted to download or save the *.php file, then you either dont' have PHP installed correctly, or havn't restarted your webserver after installing PHP.
Try restarting Apache.
If you still have issues, then you need to install PHP correctly. You did install PHP right?
Memphis10
07-27-2003, 03:51 PM
Quote: or havn't restarted your webserver after installing PHP.
No. I did not. how you do that?
Quote:Try restarting Apache.
Dont know how to do that .
Yes I installed php. I installed php-4.3.0-installer that I got from the cd rom. & it said it was installed. & there is a php folder in my c drive. with BACKUP, sessiondata, uploadtemp folders & 3 other files.
BuzzLY
07-28-2003, 03:43 AM
Chäncës ärë, íf yøü ínställëd thís frøm ä bøøk, ít's prøbäbly än øldër vërsíøn. Chëck yøür httpd.cønf fílë ín /äpächë/cønf, änd fínd thë línë thät løøks sømëthíng líkë thís:
ÄddTypë äpplícätíøn/x-httpd-php .php3 .phtml .php4
Îs thërë ä ".php" ëxtënsíøn øn thät línë? Îf nøt, püt ít thërë:
ÄddTypë äpplícätíøn/x-httpd-php .php .php3 .phtml .php4
Ëíthër thät, ør rënämë yøür fílë tø hävë thë .php3 ëxtënsíøn.
Gøød Lück!
Mødërätør(s): Përhäps thís pøst shøüld bë püt ín thë Nëwbíë førüm?
Weedpacket
07-28-2003, 05:15 AM
Originally posted by BuzzLY
Mødërätør(s): Përhäps thís pøst shøüld bë püt ín thë Nëwbíë førüm?
Tössüp - Néwbíé òr Ïnstàll?
Mövïng tò Înståll - Búnkérmástér || pìèrsk cån mövê ít òn îf néèd bë.
Memphis10
08-02-2003, 06:28 PM
Quote:Chäncës ärë, íf yøü ínställëd thís frøm ä bøøk, ít's prøbäbly än øldër vërsíøn. Chëck yøür httpd.cønf fílë ín /äpächë/cønf, änd fínd thë línë thät løøks sømëthíng líkë thís:
ÄddTypë äpplícätíøn/x-httpd-php .php3 .phtml .php4
Îs thërë ä ".php" ëxtënsíøn øn thät línë? Îf nøt, püt ít thërë:
ÄddTypë äpplícätíøn/x-httpd-php .php .php3 .phtml .php4
Ëíthër thät, ør rënämë yøür fílë tø hävë thë .php3 ëxtënsíøn.
I dont see a httpd.conf file. only httpd text doc. where it says stuff like..."This is the main Apache server configuration file. It contains the
configuration directives that give the server its instructions.
See <URL:http://www.apache.org/docs/> for detailed information about
the directives." with a bunch of other information...?
and a httpd.default text doc. with mostly the same stuff.
:confused:
bjoerndalen
08-03-2003, 05:40 PM
Hi guys...
I've been watching this one with interest as I have a very similiar problem. I'm using Windows98se.
I've got Apache operating.I type in http://localhost and I get the default screen. I've also created a file called test.php which I have placed in the htdocs folder.However when I type http://localhost/test.php I get a window asking if I want to open this file or save to disk.Either way when it opens I get an error window pop up with the following. Access to the specified device,path or file is denied.
Any ideas on where i've gone wrong. I've restarted Apache and it still does the same thing.I've also looked at the conf file and added the following lines.
ScriptAlias /php/ "c:/php/"
Action application/x-httpd-php /php/php.exe
AddType application/x-httpd-php .php
thanx Dave:confused:
BuzzLY
08-04-2003, 01:08 AM
The fact that it's asking you if you want to download it confirms that it recognized the mime type. PHP is NOT apache. If you installed Apache, you still need to install PHP. Go to PHP.net, download it, and install it.
jassh
08-04-2003, 01:49 AM
and dont forget, after you have installed php
you gotta configure ur php.ini so that it will reflect your server setting
and if ur on a windows enviroment, make sure you copy ur .ini, .dll to ur system folder
cheers;
-jash
Memphis10
08-04-2003, 11:41 AM
Unistall everything!
Then go to http://www.easyphp.com and install that. It works much better & quicker.
bjoerndalen
08-04-2003, 04:18 PM
Thanx...
I realise that Apache is not php. I have also installed v4.1.1 of php. Plus v3.23.49 of MySQL....
When I re-install PHP I understand that all the old files need to be removed manually is this correct. Also regarding PHP which download should I choose. The zip file ??
Might sound a daft question also but as you can guess I'm new to this. What are binaries??
Is it worth downloading and starting afresh or should I just do the PHP??
I'll check out the link also.
Again Thanx :)
Dave
superwormy
08-04-2003, 04:37 PM
Do yourself a favor and download and install PHPTriad. It does it all for you. Then when you get more farmilair with things and up and running... you can try it again. Maybe even on a real OS ( FreeBSD all the way! ) this time too :-)
Link to PHPTriad:
http://sourceforge.net/projects/phptriad
scottrad
08-24-2003, 02:39 AM
I have the same book. First things first. go to source forge and download phpdev5 install it and when you do make sure you install apache not apache 2 and then install mysql as well.
Now after you have done this, all you need to do is put your files in the www folder and tey should work.
Another useful tool on your machine would be cygwin.
try printing some variable first instead of echoing your message.
PHP Builder
Copyright Internet.com Inc. All Rights Reserved.