Forums

This topic is locked

Dreamweaver & PHP

Posted 31 Jan 2007 23:04:29
1
has voted
31 Jan 2007 23:04:29 Brian Smith posted:
Have been using MX for time to design web pages. I am conversant with db programming. I now have a need to learn more about dynamic sites. I have the book Inside Dreamweaver MX by Gutman, Ayers & Booth and am trying to follow their Chapter on building a PHP site - using the Antiques database if anyone is familiar with the book.
I am using Windows XP Home, MySQL 5.something. PHP 5.2 and Apache 2.2.3. I can successfully get my browsers to access the remote site (on my computer as localhost:8080
I am now trying to set up the MySQL connection.
Questions asked are :-
Connection Name: (antiques_conn)
MySQLServer: (localhost OR localhost:8080 - both tried)
UserName: (I have tried both 'host' which is the MySql sign on name AND the name shown as User in the Windows Task Manager)
Password: (Used the MySql required password)
Database: Antiques

The following are a couple of scenarios:
If I leave the Database field blank and hit the select button I get "An Undentified Error has occured'
If I type in antiques I get the message:-
Cannot create the New Connection because the file already exists
Please rename either the connection or the file
(F:\DMWVR\Inside MX......\Connections\antiques_conn.php

Should I go into the Site setup and remove the connection info...or what?

Thanks in advance

Brian



Replies

Replied 01 Feb 2007 05:16:10
01 Feb 2007 05:16:10 Javier Castro replied:
I would go to the site structure and delete or rename the connection file, then, create another remote connection to the db.
Replied 02 Feb 2007 00:33:32
02 Feb 2007 00:33:32 Brian Smith replied:
Thanks - that got me a little further. Now when I test the connection I get a Dreamweaver Error message - actually two on the same screen
1. These is no testing server running on the server machine
2. The testing server specified for the site does not map to the http:localhost/antiques_php/mmServerScripts/MMHTTPDB.php URL. Verify that the URL prefix maps to the root of the site.

This is the file antiques_conn.php

<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_antiques_conn = "localhost:8080";
$database_antiques_conn = "antiques";
$username_antiques_conn = "root";
$password_antiques_conn = "*******";
$antiques_conn = mysql_pconnect($hostname_antiques_conn, $username_antiques_conn, $password_antiques_conn) or die(mysql_error());
?>

My Computer Structure is
The local site is F:\DMWVR\Inside MX\Chapters\Chapter_30
with the following folders
_mmServerScripts
Antiques
Connections
Images
InetPub

The Remote folder is C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\antiques_phpThe Testing Server folder is C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\antiques_php
Note the testing & remote are the same = is this correct?

Brian

BJS
Replied 02 Feb 2007 05:00:19
02 Feb 2007 05:00:19 Javier Castro replied:
make sure you copy all the files and folder to your testing server. Also, under Manage sites, site definitions, in your testing server's URL prefix, make sure you have the right path to your site. That sometimes gives similar errors. Also, yout _mmServerScripts are not visible from within DW so go to your site folder using windows explore and copy that folder to your site.

good luck
Replied 02 Feb 2007 21:16:43
02 Feb 2007 21:16:43 Brian Smith replied:
Tried that. Still same message- I note that my remote site address and the testing server address are the same. Is this correct?

Replied 23 Feb 2007 17:53:56
23 Feb 2007 17:53:56 mike zuffoletto replied:
I am building a User Login page with DMX using the server behaviors and PHP. I have administrator levels called "administrators" and "members". Members do not have all the rights as the admins but when the Members login, I want each individual member to be redirected to his or her OWN page once they login. Here is how my tbl is setup in the database:

tbl Members
user_id
username
password
destination_page

I use a destination_page column to store possibly a link with the user's id so that when he or she signs in, they can be redirected to their own page.

I do I pass that variable or parameter at the login so that the member is redirected to his or her specific page (i.e. redirect to ---&gt;members.php?id=? <i>'member's id'</i> ???

Edited by - zuff on 23 Feb 2007 17:59:59

Reply to this topic