logo-dw

Go Back   Dreamweaver Club Forums > Dreamweaver forums > Video Tutorials
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 12-29-2006, 09:17 PM   #1
lezgettdrunk
 
Join Date: Dec 2006
Posts: 14
Default PHP Tutorial

I have followed the tutorial exactly, but got stuck on step 6. When I try to preview in the browser it shows me this.

Quote:
Not Found

The requested URL /test/dwc.php was not found on this server.
Apache/2.0.59 (Win32) PHP/5.2.0 Server at localhost Port 80


I have entered this code:

Code:
<?php

require_once("connections/connection.php"); //database connection

$query        =    sprintf("SELECT * FROM table1");
$result        =    @mysql_query($query);
$row        =    mysql_fetch_array($result);

echo $row['field2'];

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
</body>
</html>
Could anyone help me?

Last edited by davidj; 12-31-2006 at 11:24 AM..
lezgettdrunk is offline   Reply With Quote
Old 12-30-2006, 04:33 PM   #2
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

the path designated by apache does not match the path in dreamweaver

you need to find the path thats configured in apache
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 12-31-2006, 02:27 AM   #3
lezgettdrunk
 
Join Date: Dec 2006
Posts: 14
Default

I think I understand what you are saying. I am using the wampserver and the designated path of the apache is the local host right? And that is why it cannot be found. How can I change the path of the wampserver to point to the a different directory ? Thank you!
lezgettdrunk is offline   Reply With Quote
Old 12-31-2006, 11:22 AM   #4
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

to find out where your wamp server has designated its root see figure1 and 2 below

create a blank file in DW and remove all the HTML that DW writes

in code view ad the following

Code:
 
<?php
 
phpinfo();
 
?>
save this off as info.php and copy it to the path that wamp server has as www root (above)

open your browser and in the address type...

http://localhost/info.php

or just click on the link above.
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk

Last edited by davidj; 03-25-2009 at 12:51 AM..
davidj is offline   Reply With Quote
Old 12-31-2006, 02:11 PM   #5
lezgettdrunk
 
Join Date: Dec 2006
Posts: 14
Default

Wow nice details! Unfortunately I still cannot get the page to come up correctly. I created a folder on my desktop called websites and have the webroot and local root folder there.

Code:
Index of /

Icon  Name                    Last modified      Size  Description
[DIR] local root/             30-Dec-2006 20:35    -   
[DIR] webroot/                30-Dec-2006 20:36    -   

Apache/2.0.59 (Win32) PHP/5.2.0 Server at localhost Port 80

When I go to my browser and type local host it shows that website folder. I can navigate to the info.php and it shows me:

Code:
Apache Environment
Variable	Value
HTTP_HOST 	localhost
HTTP_USER_AGENT 	Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061206 Firefox/1.5.0.9
HTTP_ACCEPT 	text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
HTTP_ACCEPT_LANGUAGE 	en-us,en;q=0.5
HTTP_ACCEPT_ENCODING 	gzip,deflate
HTTP_ACCEPT_CHARSET 	ISO-8859-1,utf-8;q=0.7,*;q=0.7
HTTP_KEEP_ALIVE 	300
HTTP_CONNECTION 	keep-alive
HTTP_REFERER 	http://localhost/webroot/test/
PATH 	C:\academic\orawin95\bin;C:\PROGRA~1\Borland\CBUILD~1\Projects\Bpl;C:\PROGRA~1\Borland\CBUILD~1\Bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Intel\Wireless\Bin\;C:\Program Files\Intel\Wireless\Bin\;C:\Program Files\Intel\Wireless\Bin\;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Symantec\pcAnywhere\
SystemRoot 	C:\WINDOWS
COMSPEC 	C:\WINDOWS\system32\cmd.exe
PATHEXT 	.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
WINDIR 	C:\WINDOWS
SERVER_SIGNATURE 	<address>Apache/2.0.59 (Win32) PHP/5.2.0 Server at localhost Port 80</address>
SERVER_SOFTWARE 	Apache/2.0.59 (Win32) PHP/5.2.0
SERVER_NAME 	localhost
SERVER_ADDR 	127.0.0.1
SERVER_PORT 	80
REMOTE_ADDR 	127.0.0.1
DOCUMENT_ROOT 	C:/Documents and Settings/Allen/Desktop/website
SERVER_ADMIN 	webmaster@localhost
SCRIPT_FILENAME 	C:/Documents and Settings/Allen/Desktop/website/webroot/test/info.php
REMOTE_PORT 	4492
GATEWAY_INTERFACE 	CGI/1.1
SERVER_PROTOCOL 	HTTP/1.1
REQUEST_METHOD 	GET
QUERY_STRING 	no value
REQUEST_URI 	/webroot/test/info.php
SCRIPT_NAME 	/webroot/test/info.php
What should I do now?

Last edited by davidj; 01-02-2007 at 05:55 AM..
lezgettdrunk is offline   Reply With Quote
Old 12-31-2006, 03:12 PM   #6
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

where ever you have webroot/test/

that is your root directory (/test/)

all your files must be placed in there for it to work through localhost
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 01-01-2007, 12:08 AM   #7
lezgettdrunk
 
Join Date: Dec 2006
Posts: 14
Default

I understand that, but my files are in webroot/test. The problem is that the apache path is pointing to the folder containing the webroot & localroot folder and not to the path webroot/test. I'm trying to find out how to change the path of apache or can that not be changed?
lezgettdrunk is offline   Reply With Quote
Old 01-01-2007, 12:21 AM   #8
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

if apache is using webroot as the webroot and its not using webroot/test/ then thats fine as anything in webroot will be processed through the PHP engine

thats what you want really so you can add other working/project directories under webroot
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 01-02-2007, 01:43 AM   #9
lezgettdrunk
 
Join Date: Dec 2006
Posts: 14
Default

apache is not using webroot, but using this path

C:\Documents and Settings\Allen\Desktop\website

localroot and webroot are in that folder.

So what can I do?
lezgettdrunk is offline   Reply With Quote
Old 01-02-2007, 02:54 AM   #10
lezgettdrunk
 
Join Date: Dec 2006
Posts: 14
Default

I tried uninstalling wamp server and changed the apache path to the

C:\Documents and Settings\Allen\Desktop\website\webroot\test

But when I hit f12 to preview in browser it shows me

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in C:\Documents and Settings\Allen\Desktop\website\webroot\test\connec tions\connections.php on line 8

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Documents and Settings\Allen\Desktop\website\webroot\test\dwc.ph p on line 7
lezgettdrunk is offline   Reply With Quote
Reply


Thread Tools
Display Modes

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

Forum Jump


All times are GMT. The time now is 06:46 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com