To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > Tools > Dreamweaver

Dreamweaver In need of help with Dreamweaver?

Reply
 
Thread Tools Rate Thread Display Modes
Old 06-02-2003, 06:41 PM   #1
BEFOR
Senior Member
 
Join Date: Jun 2003
Posts: 381
MX recordset connections

I have been trying to "put" a php page that contains a recordset.

Getting error message:

"Fatal error: Failed opening required (include_path='./:/usr/local/lib/php') in /home2/.../...-www/Connections/filename.php on line 1

What is ':' ?

Also getting error message:

:unable to create remote folder
...-www/connections/_notes/
-----------------------------------------------------------
I noticed dreamweaver has taken the liberty to capitalize "c" in one connections folder line and not the next.

Are characters in directories case sensitive as are php file names?

I've tried to manually create the _notes folder although this can't be seen -- is this _notes folder hidden?

Anyway, to make the connection do I need more of the absolute path (username, etc) not just a relative one. Shouldn't relative path work with host, username, etc. falling lower on the same pg. as they presently exist?
BEFOR is offline   Reply With Quote
Old 06-20-2003, 07:34 PM   #2
dintendo
Junior Member
 
Join Date: Jun 2003
Posts: 4
same problem

I get a similar problem. I actually kinda managed to sort of not fix it...

I'm trying my damndest to learn outta the Dreamweaver MX: PHP Web Development book by glasshaus, and things just aren't going so well. Whenever I try to set up the Insert Record function, which should input records into my database and then transport the user to another page, it simply won't function.

I'll either
A)
get the error you describe, and the page won't even load, or

B)
it will load, and I can input values, and they will be input into the database, but when I click "submit", i get the same page back with an error like

Warning: Cannot modify header information - headers already sent by (output started at c:\inetpub\wwwroot\the dreamweaver hotel\bookings\TMP6kc1lgsvyf.php:2) in c:\inetpub\wwwroot\the dreamweaver hotel\bookings\TMP6kc1lgsvyf.php on line 55

if anybody has any ideas, lemme know...i'm freakin out about this...
dintendo is offline   Reply With Quote
Old 06-23-2003, 02:40 PM   #3
Elizabeth
Has a PhD in Horribleness
 
Elizabeth's Avatar
 
Join Date: Nov 2002
Location: In a meeting with the Bobs
Posts: 2,575
Re: MX recordset connections

Quote:
Originally posted by BEFOR
Are characters in directories case sensitive as are php file names?
If I'm not mistaken, yes. Especially if the server is a Unix system.

Not sure why Dreamweaver is changing the names on you- I guess you can do a "find and replace" on that one.

hth a little!

-Elizabeth
__________________
My blog| Follow me on Twitter
Elizabeth is offline   Reply With Quote
Old 06-23-2003, 02:44 PM   #4
Elizabeth
Has a PhD in Horribleness
 
Elizabeth's Avatar
 
Join Date: Nov 2002
Location: In a meeting with the Bobs
Posts: 2,575
Re: same problem

Quote:
Originally posted by dintendo
I get a similar problem. I actually kinda managed to sort of not fix it...

Dintendo, can you post some of your HTML/PHP code here so we can see what you have? I would guess that you are trying to do something with either cookies or sessions or header:location somewhere inside your HTML- certain of those functions can only be done before even the first <HTML> line, or it won't parse correctly.

-Elizabeth
__________________
My blog| Follow me on Twitter
Elizabeth is offline   Reply With Quote
Old 06-23-2003, 08:29 PM   #5
dintendo
Junior Member
 
Join Date: Jun 2003
Posts: 4
Unhappy still lost

okay, i actually ended up reformatting my entire system because of some other issues. and here i am, still in a similar predicament. i've added an attatchment of my file at elizabeth's request. anybody else who wants to take a crack at this, please do. here's the error message that I get:

Fatal error: Failed opening required '' (include_path='') in c:\inetpub\wwwroot\dreamweaverhotel\TMP51ok8gyjti.php on line 1

i'm a total n00b at this stuff, and although i used to hand code html, i've had no experience doing php thru anything but dreamweaver.

thanks in advance.
Attached Files
File Type: txt add_user_record.txt (15.2 KB, 80 views)
dintendo is offline   Reply With Quote
Old 06-23-2003, 08:53 PM   #6
Elizabeth
Has a PhD in Horribleness
 
Elizabeth's Avatar
 
Join Date: Nov 2002
Location: In a meeting with the Bobs
Posts: 2,575
You need to "require" something; right now your first line is:
PHP Code:
<?php require_once(''); ?>
But you're not telling it what it's supposed to require.

You can read more about require by clicking on this section of the manual.

It might be a good idea to get a basic book on PHP, or familiarize yourself with the PHP Manual- as you well know from your HTML experience, Dreamweaver can do some funky things with your code and it really helps if you can customize the code yourself.

hth a little,
-Elizabeth
__________________
My blog| Follow me on Twitter
Elizabeth is offline   Reply With Quote
Old 06-23-2003, 10:55 PM   #7
dintendo
Junior Member
 
Join Date: Jun 2003
Posts: 4
Unhappy still lost...

thx for the reply, elizabeth, but...

yes, i ought to pick up a PHP book, i know...but in the meantime, i'm just trying to get this little example i pulled out of a book to work. i don't suppose anybody could give me a hint as to _what_ i should be requiring??? i really have no ideas here... it's connecting to a MySQL database (the page works until i try to use the "insert record" function), so should i be trying to require a database file?

any help would prevent me from maiming myself...
dintendo is offline   Reply With Quote
Old 06-24-2003, 07:02 AM   #8
dintendo
Junior Member
 
Join Date: Jun 2003
Posts: 4
still hacking away

okay, right now, i'm trying to get to the bottom of this, so i'm stripping away as much of the code as possible. Here's what i have so far.

First is my phpbook.php file, which is the following in its entirety:

---
<?php

# Type="MYSQL"
# HTTP="true"
$hostname_phpbook = "127.0.0.1";
$database_phpbook = "dwhotel";
$username_phpbook = "root";
$password_phpbook = "";
$phpbook = mysql_pconnect($hostname_phpbook, $username_phpbook,
$password_phpbook) or die(mysql_error());
?>
---

(and no, i have no root password.)

and then, here's the stripped down page i made based on the big one, which will still not work.

----
<?php require_once('phpbook.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}

$editFormAction = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];
}

if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "userform")) {
$insertSQL = sprintf("INSERT INTO clients (email) VALUES (%s)",
GetSQLValueString($HTTP_POST_VARS['email'], "text"));

mysql_select_db($database_phpbook, $phpbook);
$Result1 = mysql_query($insertSQL, $phpbook) or die(mysql_error());

$insertGoTo = "booking_details.php?email=".$HTTP_POST_VARS['email']."";
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?>

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<form action="<?php echo $editFormAction; ?>" method="POST" name="userform" id="userform">

<input name="email" type="text" id="email">
<input type="submit" name="Submit" value="Submit">
<input type="hidden" name="MM_insert" value="userform">
</form>
</body>
</html>
----

ok, here's the problem. unlike last time, when i couldn't even get it to show up, it now displays (thanks, elizabeth).

so when I preview the file, i am greeted with a single text box and a submit button, as expected. I enter a random value, and click the button.

Two problems.

One, I don't go where I'm supposed to go: i.e., booking_details.php?email=".$HTTP_POST_VARS['email']."

next, i get the following error message:

Warning: Cannot add header information - headers already sent by (output started at c:\inetpub\wwwroot\dreamweaverhotel\phpbook.php:11) in c:\inetpub\wwwroot\dreamweaverhotel\TMPro0m2gzd4v.php on line 45

and in case it matters, this is on winxp pro, running IIS4, and um...php 4.06.

and as an aside, it does actually input the data into the MySQL database, it's just that it shouldn't be giving me that error message, right?? thanks in advance again...
dintendo is offline   Reply With Quote
Old 06-25-2003, 10:01 PM   #9
Elizabeth
Has a PhD in Horribleness
 
Elizabeth's Avatar
 
Join Date: Nov 2002
Location: In a meeting with the Bobs
Posts: 2,575
Sorry, but this is getting really convoluded!

I'm still seeing the "%s" in a few lines- I'm not sure what that's supposed to be. I think that might be the source of your problem... can you try putting in "real" values for this?

-Elizabeth
__________________
My blog| Follow me on Twitter
Elizabeth is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 02:46 PM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.