Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

can't find the file <?php echo $editFormAction; ?> in XAMPP

New Here ,
Aug 31, 2009 Aug 31, 2009

I used the insert record function in CS4 on a page I'm working on.  I'm running XAMPP in win XP.

Whenever I load the page into firefox, fill out the forms with random data, and click the submit button, I get the following error:

can't find the file at /C:/xampp/htdocs/MySite.com/<?php echo $editFormAction; ?>

I have been trying to research this a bit myself, and I think the problem may simply be that the editFormAction script is not in the root folder of my site.  But I am not sure where it is, and so, what to change the reference to.

Or perhaps I'm completely wrong about this???

Please Help Me!!

TOPICS
Server side applications
2.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Aug 31, 2009 Aug 31, 2009

You may be better off asking this question in the

DW Application Dev forum

--

Nadia

Adobe® Community Expert : Dreamweaver

---------------------------------------------------------------

Unique CSS Templates | Tutorials | SEO Articles

http://www.DreamweaverResources.com

--------------------------------------------------------------------------

Web Design & Development

http://www.perrelink.com.au

http://twitter.com/nadiap

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Aug 31, 2009 Aug 31, 2009

You have not provided enough information. Explain database and code system you have in place if you want someone to hold your hand and walk you through your personal errors. No mind readers here.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 01, 2009 Sep 01, 2009

In all likelyhood, if you go to your page with the form on it you will find this

<form method="post" action=" <?php echo $editFormAction; ?>">

$editFormAction appears to be a variable, but it also sounds like it is missing.  Your HTML form is looking for the file or script to process your form data.  I have never used this, however from what I can see, it is used if there is more than one action that can occur with your form (For example, if answer is this, go here, if answer is that, go there).

If you post more information, someone might be better able to help you.

gary

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 01, 2009 Sep 01, 2009

garywpaul wrote:

In all likelyhood, if you go to your page with the form on it you will find this

<form method="post" action=" <?php echo $editFormAction; ?>">

Correct. It's inserted by the Dreamweaver Update Record server behavior. The server behavior defines $editFormAction around line 34 of the code it inserts:

$editFormAction = $_SERVER['PHP_SELF'];

Nothing mystical or magical. However the error message tells everything:

can't find the file at /C:/xampp/htdocs/MySite.com/<?php echo $editFormAction; ?>

It looks as though the testing server has not been set up correctly (or not set up at all). If the page were being tested through a PHP-enabled server, the URL would be something like http://localhost/MySite.com/pagename.php. Instead, it's pointing to the C drive, and the PHP variable hasn't been parsed.

See the following tutorial for setting up a PHP testing environment correctly: http://www.adobe.com/devnet/dreamweaver/articles/setting_up_php.html.

By the way, this thread has now been moved to the Dreamweaver Application Development forum, which is the correct place for questions about PHP and other server-side technologies.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 01, 2009 Sep 01, 2009

Well, I have to chuckle a bit because the article on how to set up a php testing server that you wrote is the exact one I read to set up my testing server!  It is very well written and probably the most helpful and straight foreward article on setting up dreamweaver with XAMPP on the web.  I followed all of the instructions exactly, so I imagine the problem must be elsewhere?  It's pointing to the C drive because that's where XAMPP is installed.  This is how is it supposed to be setup, correct?  Apache and MySQL are running, or at least it says so on the XAMPP control panel.

Also, I apologize for not posting this in the right forum.  That was my first post on the adobe boards and I didn't really consider inserting records to a database to be an "application."  So thanks for pointing me in the right direction.

for those who want to see my code, here it is.  Except for the exact names of the fields, it's exactly what dreamweaver creates when youc click on the "insert record" button in the insert menu.  I don't see any option for pasting the code as "code" like in most code devolpoer forums.  I know some poeple get upset if you paste code without doing it right, so I hope I'm not making anybody mad.

the following is inserted in the head:

<?php require_once('Connections/GiftListConnection.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($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_update"])) && ($_POST["MM_update"] == "form1")) {
  $updateSQL = sprintf("UPDATE ff SET EmailAddress=%s, Relationship=%s WHERE FirstName=%s",
                       GetSQLValueString($_POST['EmailAddress'], "text"),
                       GetSQLValueString($_POST['Relationship'], "text"),
                       GetSQLValueString($_POST['FirstName'], "text"));

  mysql_select_db($database_GiftListConnection, $GiftListConnection);
  $Result1 = mysql_query($updateSQL, $GiftListConnection) or die(mysql_error());

  $updateGoTo = "ManageFF.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
    $updateGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $updateGoTo));
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form2")) {
  $insertSQL = sprintf("INSERT INTO ff (FirstName, EmailAddress, Relationship) VALUES (%s, %s, %s)",
                       GetSQLValueString($_POST['FirstName'], "text"),
                       GetSQLValueString($_POST['EmailAddress'], "text"),
                       GetSQLValueString($_POST['Relationship'], "text"));

  mysql_select_db($database_GiftListConnection, $GiftListConnection);
  $Result1 = mysql_query($insertSQL, $GiftListConnection) or die(mysql_error());

  $insertGoTo = "ManageFF.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $insertGoTo));
}

mysql_select_db($database_GiftListConnection, $GiftListConnection);
$query_Recordset1 = "SELECT * FROM ff";
$Recordset1 = mysql_query($query_Recordset1, $GiftListConnection) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>

and then this is the actual form code in the body:

<p class="Bold">&nbsp Add new family member or friend...</p>
<form action="<?php echo $editFormAction; ?>" method="post" name="form2" id="form2">
  <table align="left">
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">FirstName:</td>
      <td><input type="text" name="FirstName" value="" size="32" /></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">EmailAddress:</td>
      <td><input type="text" name="EmailAddress" value="" size="32" /></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">Relationship:</td>
      <td><input type="text" name="Relationship" value="" size="32" /></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right"> </td>
      <td><input type="submit" value="add" /></td>
    </tr>
  </table>
  <input type="hidden" name="MM_insert" value="form2" />
</form>

Thanks for trying to help out this noob, everybody!

BTW, this is Inkexit posting.  For some reason when I logged in this morning, I was made to pick a new screenname, as inkexit was already in use.  But I knew that though, as I was the one using it, lol.  Kinda bizzarre.  Perhaps the Mods should know about this?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 01, 2009 Sep 01, 2009

The code in the page is irrelevant to your particular problem. The problem, as I stated before, is that the error message points to the C drive, which indicates that the page is not being processed through the testing server.

Did you define the testing server in your site definition? If so, how did you launch the page?

Seeing the page in a browser is not enough. It must be processed by the Apache web server. If you defined a testing server in your site defintion, and press F12 to preview the page, it will be launched correctly through Apache. Also make sure that Preview in Browser in Dreamweaver Preferences does NOT use a temporary file.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 01, 2009 Sep 01, 2009

Wow!  All I did was press F12 and it works no problem.  Boy do I feel like a fool now!

I had defined the site and the testing server and all that correctly.  The problem was that I was opening the page by launching firefox (by itself, by clicking on it's icon on my desktop) and then opening the page by pressing ctrl-O.

I must say it seems very odd that I have to launch the web browser from dreamweaver to make it work correctly.  What If I was hand coding all this and I didn't own dreamweaver and I wanted to try out my files with a testing server on my own computer?  Is that not possible?  What happens inside dreamweaver that makes my web browser work with XAMPP, whereas if I simply open the document, even when XAMPP is tunning, apache won't process it?

Thanks for all your help again, David.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 01, 2009 Sep 01, 2009
LATEST

Original_inkexit wrote:

I must say it seems very odd that I have to launch the web browser from dreamweaver to make it work correctly.  What If I was hand coding ll this and I didn't own dreamweaver and I wanted to try out my files with a testing server on my own computer?

It's not at all odd. Pressing F12 is the normal Dreamweaver way of previewing a web page in a browser.

If you don't have Dreamweaver, you just type the correct address in the browser. The htdocs folder is the equivalent of http://localhost/. That's why you need to specify the URL prefix in the Testing server definition, so Dreamweaver knows which URL to use.

Since you're not able to log in to the forum with your original name, I'll marked this thread as "assumed answered".

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines