Inavlid path: Error

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
iliad2b
Forum Newbie
Posts: 3
Joined: Wed Oct 12, 2005 4:36 pm

Inavlid path: Error

Post by iliad2b »

Hello,

can anyone help me out here, i do not understand where exactly my error is:

the server has this directory structure

public_html/index.php

Code: Select all

<?php require_once('Connections/dbConnection.php'); ?>
public_html/Connections/dbConnection.php

Code: Select all

<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_dbConnection = "localhost";
$database_dbConnection = "me_emaildb";
$username_dbConnection = "me_emaildb";
$password_dbConnection = "test";
$dbConnection = mysql_pconnect($hostname_dbConnection, $username_dbConnection, $password_dbConnection) or trigger_error(mysql_error(),E_USER_ERROR); 
?>
my error is:

Code: Select all

Inavlid path: /domains/mydomain.org/public_html/<, Path's must also begin with a forward slash (/)
Last edited by iliad2b on Thu Oct 13, 2005 11:30 am, edited 1 time in total.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

Could you give us the code from index.php or is what you've got there all there is?
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
iliad2b
Forum Newbie
Posts: 3
Joined: Wed Oct 12, 2005 4:36 pm

Post by iliad2b »

Code: Select all

<?php require_once('Connections/dbConnection.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 = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

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

  mysql_select_db($database_dbConnection, $dbConnection);
  $Result1 = mysql_query($insertSQL, $dbConnection) or die(mysql_error());

  $insertGoTo = "index.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $insertGoTo));
}
?>
<html>
	<head>
		<title>myweb</title>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
		<style type="text/css">
			<!--
			.style1 {font-family: Arial, Helvetica, sans-serif}
			-->
		</style>
	</head>
	
	<body>
<form method="post" name="form1" action="<?php echo $editFormAction; ?>">
			<table align="center">
				<tr valign="baseline">
					<td nowrap align="center">
						<span class="style1">
							subscribe to our e-newsletter
							<input type="text" name="email" value="" size="32">
							<input type="submit" value="Submit">
						</span>
					</td>
				</tr>
			</table>
			<input type="hidden" name="MM_insert" value="form1">
		</form>
	</body>
</html>
Last edited by iliad2b on Thu Oct 13, 2005 11:31 am, edited 1 time in total.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

4 things:

1) Try setting the path of dbConnection.php to absolute - enter the full path
2) You don't need to put require_once() inside it's own <?PHP ?> tags
3) If, in this forum, you use [syntax=php][/syntax] tags rather than [syntax=php][/syntax] tags, your PHP code'll be coloured all pretty like, rather than being all green ;)
4) The problem might also be with this: /domains/mydomain.org/public_html/< . I'm not sure how, but it seems you're asking to require the file '<'. Dunno what to do there, just a heads up.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
iliad2b
Forum Newbie
Posts: 3
Joined: Wed Oct 12, 2005 4:36 pm

Post by iliad2b »

i tried all your suggestions, but they didn't seem to work.

what i ended up doing was to take the line from:
dbConnections.php

Code: Select all

$dbConnection = mysql_pconnect('localhost', 'me_emaildb', 'test') or trigger_error(mysql_error(),E_USER_ERROR);
and inserted it in the index.php:

Code: Select all

<?php
        $dbConnection = mysql_pconnect('localhost', 'me_emaildb', 'test') or trigger_error(mysql_error(),E_USER_ERROR);

	function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
	{
		$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

		switch ($theType)
		{
so i guess i can now start trouble shooting the path again....cuz this proved that the code worked, and it did communicate with the database.

if anyone has more suggestions it would be great to here them.

p.s. i am using Macromedia Flash Pro 8
Post Reply