PDA

View Full Version : PHP, A Beginners Guide...


binomonkey
11-08-2007, 05:47 AM
Hey there,
My question is in regard to the "www directory" setup. At the beginning of the "Configuring Dreamweaver" tutorial, you had mentioned that you pointed the "www directory" to a directory within "My Documents."
I think this is the step I'm missing because I get an error when previewing my pages that says something like this... "NOT FOUND...The requested URL /web_root/TEST/foo.php was not found on this server."
Any help would be awesome.

Cheers and thanks very much for your tutorials.

davidj
11-08-2007, 07:41 AM
which directory did you point the WWW to?

binomonkey
11-08-2007, 05:34 PM
Thanks for the reply.
...in fact, I don't even know how to "point" or link the www directory anywhere. In the tutorial, this was done without showing it. Basically, I'd like it to point to my site folders I have stored in My Documents/website/projects/project/... I think in the tutorial, there was a ".../web_root/TEST/" path.
I'm just starting out with this so I'm sorry if my questions are very novice.
Cheers and thanks

davidj
11-08-2007, 06:38 PM
try setting an alias from the wamp icon in your systems tray

just click alias and select new then follow the onscreen instructions

binomonkey
11-09-2007, 01:23 AM
Thanks for the info however, now I get this error happening:

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in C:\Documents and Settings\foo\My Documents\My_Web\project_foo\web_root\TEST\connect ions\connection.php on line 8

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Documents and Settings\foo\My Documents\My_Web\project_foo\web_root\TEST\foo.php on line 10

any ideas?

Thanks

binomonkey
11-09-2007, 04:22 AM
one more thing to add to my last post..
I noticed the when one creates an alias, it'll alias localhost/foo. However, in your tutorial, it looks like you were able to somehow remap localhost instead.
Is there more to this?
Cheers

davidj
11-09-2007, 07:32 AM
no you got it right

in the tutorial i set my WWW dir to the dir in my documents so i did this from the installation point. If you forget to do this you can use an alias to get round it

binomonkey
11-09-2007, 08:38 PM
David,
Thanks for the help thus far..

Ok, so I changed my alias to something like "localhost/foo." Do I need to change my testing server within DW to "http://localhost/foo" or just leave it as "http://localhost" as in the tutorial. Also, do I need to change anything in the "connection.php" script? At the moment, the line of code in question reads:
"$link = @mysql_connect('localhost', $username, $password);"

Thanks again.

davidj
11-09-2007, 08:45 PM
if your working from foo then change it to foo

binomonkey
11-09-2007, 09:04 PM
should the alias go as deep as:

c:\Documents and Settings\MY Name\My Documents\My_Web\project\web_root\TEST\(php files are here)?
?
Because I'm still getting the same message when trying to preview the page.
That error being: "Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in"

Thanks

davidj
11-10-2007, 07:41 AM
post your connection script

binomonkey
11-10-2007, 05:01 PM
I was changing the 'localhost' to 'localhost/alias' but still nothing. It should
basically a mirror image from your tutorial script:

<?php
/////////////////////
$database = "zippics";
$user = "bz";
$password = "**********";

$link = @mysql_connect('localhost', $username, $password);
$db = $database;

//mysql_select_db($database, $link);

?>

cheers.

binomonkey
11-11-2007, 06:06 AM
David,
I got it and you'll never guess what a silly mistake it was on my part.
I defined $user yet called $username.

Thanks for your help.

davidj
11-11-2007, 10:29 AM
great. nice work

you will encounter allot of those errors / mistakes in your time and the fact you successfully found it means your well on your way to becoming a good programmer