HILFE! Probleme mit FileZilla. Posten ist auf Englisch!

Problems with the Windows version of XAMPP, questions, comments, and anything related.

HILFE! Probleme mit FileZilla. Posten ist auf Englisch!

Postby rooomka » 03. November 2008 20:49

Mein Deutsch ist nicht besonders gut, so werde ich mein Problem auf Englisch anschlagen. Ich lernte Deutsch im Militär, aber ich bin etwas rostig, so hier ist mein Problem:

I have uploaded xampp to my pc. I am using Windows XP Professional, and have downloaded the entire xampp package which includes Apache server, MySQL, php5, Mercury mail program, and FileZilla FTP. Once I started FileZilla, I assumed I would be able to use the forms I use with all websites on my paid server and upload information to the database. Now I can update information already in the database if there is already an entry, however uploading/inserting a new entry is not working, which is telling me that it is the FileZilla setting or program. The code I am using is simple and will NOT seem to work with FileZilla:

<? if ($action == "") { ?>

BLAH, BLAH, BLAH, FORM, BLAH, BLAH, BLAH

<? } else {
$question = $_POST['question'];
$answer = $_POST['answer'];
mysql_query("INSERT INTO faq SET question = '$question', answer = '$answer'");
?>

<tr align="center">
<td>FAQ Item has been successfully added.</td>
</tr>
<? } ?>

What am I doing wrong with the settings? How can I configure it to work as I need it to? Please advise!
Thanks so much for the help!
Sincerely,
Charles
rooomka
 
Posts: 8
Joined: 03. November 2008 20:38
Location: United States

Postby Wiedmann » 03. November 2008 21:03

The code I am using is simple

Simple and wrong...

Put "error_reporting(E_ALL);" at first statement in your script (right after "<?php") and correct all errors you can see.

BTW:
and will NOT seem to work with FileZilla:

Your problem have nothing to do with FileZilla, because FileZilla is a ftp server (and not a html server with php, like Apache).
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Confused.

Postby rooomka » 03. November 2008 21:19

I am on a paid windows server as well, and everything works fine, but for whatever reason it is throwing up these 2 errors. Why is it able to operate there and not here at all? Thanks for the script, I inserted it and here is what I got:

Notice: Undefined variable: action in C:\xampp\htdocs\Backpage\faq_add.php on line 75

Notice: Undefined variable: error in C:\xampp\htdocs\Backpage\faq_add.php on line 79

There errors refer to this:

<? if ($action == "") { ?>
<tr>
<td class="header">Add Question </td>
</tr>
<tr>
<td><font color="#FF0000"><? echo $error; ?></font></td>
</tr>
rooomka
 
Posts: 8
Joined: 03. November 2008 20:38
Location: United States

Verbotener Zugang. Fehler 403.

Postby rooomka » 03. November 2008 21:26

Also now when I Submit the form, I get this error:

Access forbidden!
You don't have permission to access the requested object. It is either read-protected or not readable by the server.

If you think this is a server error, please contact the webmaster.

Error 403
rooomka
 
Posts: 8
Joined: 03. November 2008 20:38
Location: United States

Postby Wiedmann » 04. November 2008 08:10

Why is it able to operate there and not here at all?

Loosy (deprecated) php settings there.


Code: Select all
<? if ($action == "") { ?>

Notice: Undefined variable: action in C:\xampp\htdocs\Backpage\faq_add.php on line 75

You are using a variable $action for a comparison, but you have not initialized this variable with a value before ($action does not exists at this point).


Code: Select all
<td><font color="#FF0000"><? echo $error; ?></font></td>

Notice: Undefined variable: error in C:\xampp\htdocs\Backpage\faq_add.php on line 79

You want output the value from the variable $error, but you have not initialized this variable with a value before ($error does not exists at this point).


Also now when I Submit the form, I get this error:

Access forbidden!
You don't have permission to access the requested object. It is either read-protected or not readable by the server.

There is something wrong with the action attribute in your html form.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby EnglishRocker » 04. November 2008 16:01

1. You do not need Filezilla for a mysql query. Use ordinary PHP.

2.
Code: Select all
if $action == "" { .... } 
is a waste of code and you need $action to exist first. Change it to this:

Code: Select all
if (!$action) { .... }


3. Use echo statements or var_dump() on your variables to make sure they are what they are supposed to be.
Code: Select all
echo $action;
EnglishRocker
 
Posts: 25
Joined: 12. September 2008 11:07

Postby rooomka » 05. November 2008 01:32

Works like a champ. My primary server is a Unix, and it has allowed me to be a little sloppy, but with xampp on Windows XP Pro, I have to be much more careful about declaring all variables and getting rid of those chunks of useless code from the old copy and paste method. Thanks for the help guys!
rooomka
 
Posts: 8
Joined: 03. November 2008 20:38
Location: United States


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 91 guests