NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Problems with DB Form Wizard


Joined: 09 Aug 2006
Posts: 18
Reply with quote
My goal is to make a form with multiple checkboxes.

For sack of example, here is a very simple HTML I am having trouble with running the DB Form Wizard on:

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

<body>
<form name="form1" method="post" action="">
<table width="75%" border="1">
<tr>
<td><input type="checkbox" name="checkbox" value="checkbox"></td>
</tr>
<tr>
<td><input type="checkbox" name="checkbox" value="checkbox"></td>
</tr>
</table>

</form>
</body>
</html>


Now, here is the table I created for this very simple 2 checkbox form:

Create table checkbox (
id int unsigned not null auto_increment primary key,
checkbox int (1),
checkbox_value varchar (100)
);


After running HTML through Wizard, I run the form and check a box and when save get the following error message:

Notice: Undefined variable: checkbox in C:\Program Files\Apache Group\Apache2\htdocs\Affirmative_Action\Forms\CheckBoxForm.php5 on line 60
Record has been added successfully. Click here to return homepage.

Here is the code for 57-60:

$sql="insert into checkbox
(checkbox,checkbox_value)
Values
('$checkbox','$checkbox_value')";

Please advise me regarding why I can't get this to work.

Thank you.
View user's profileFind all posts by jmaloneySend private message
For to mention the following


Joined: 09 Aug 2006
Posts: 18
Reply with quote
I forgot to mention that their is a blank database entry. I can tell because the id keeps incrementing.

Thank you.
View user's profileFind all posts by jmaloneySend private message
F7 debug produces following error


Joined: 09 Aug 2006
Posts: 18
Reply with quote
If I F7 debugger through I get this error:

Failed to map
c:\program files\nusphere\phped\include_lib\db_myutil.inc remote file to publishing account

And it occurs at this place in the code:

# you may want to change path to db_utils.inc
require_once $site["path"].'/include_lib/db_myutil.inc';
ensureConnectionAvailable();

Please help. I have other scripts that I created working OK with my MySQL that are doing insert, select, etc.
View user's profileFind all posts by jmaloneySend private message
Here is another test result


Joined: 09 Aug 2006
Posts: 18
Reply with quote
Here is another script I tried to test. I downloaded the newest update, and ran the following html through the Wizard:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<form method="post" action="path to script">
<input type="checkbox" id="colors[]" value="red" /> Red
<input type="checkbox" id="colors[]" value="blue" /> Blue
<input type="checkbox" id="colors[]" value="green" /> Green
<input type="checkbox" id="colors[]" value="yellow" /> Yellow
</form>

</body>
</html>


I created a table called colors with the following code:

Create table colors (
id int unsigned not null auto_increment primary key,
colors varchar (30)
);

After I run the Wizard, I only see one checkbox called colors. When I check the data input I see 1, and that's all. I am no longer getting the previous errors messages mentioned.

Can you please advise me why the Wizard is doing this and only creating one checkbox.

Thank you.
View user's profileFind all posts by jmaloneySend private message
Veteran

Joined: 24 Jan 2006
Posts: 311
Reply with quote
Hi, I am not sure I understand what you are trying to do. What do you mean by running html throughthe wizzard - DB Wizzard doesn't take any html input. Do you probably mena that you are runing this code with PhpED's Web server?
View user's profileFind all posts by yfaktorSend private message
Reply


Joined: 09 Aug 2006
Posts: 18
Reply with quote
I cute and paste HTML into a Nusphere PHP5 page and save.

Then, I run the DB Form Wizard, and then I go through the various Wizard Windows and answer the questions.

Can you please advise me further on how to get your Wizard to interpret a form with multiple checkboxes and to do the proper input into a MySQL table.

Thank you.
View user's profileFind all posts by jmaloneySend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8340
Reply with quote
Quote:
If I F7 debugger through I get this error:

Failed to map
c:\program files\nusphere\phped\include_lib\db_myutil.inc remote file to publishing account

And it occurs at this place in the code:

# you may want to change path to db_utils.inc
require_once $site["path"].'/include_lib/db_myutil.inc';
ensureConnectionAvailable();

Please help. I have other scripts that I created working OK with my MySQL that are doing insert, select, etc.


Open Project Properties window, select mapping tab,
add new entry and fill only Local Path and Remote Path. Both should contain
c:\program files\nusphere\phped\include_lib\

Alternatively, you may want to copy db_myutil.inc and the other files from c:\program files\nusphere\phped\include_lib\ to a directory under Apache Document Root.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8340
Reply with quote
Regarding DB Wizard.
Quote:
After running HTML through Wizard, I run the form and check a box and when save get the following error message:

Notice: Undefined variable: checkbox in C:\Program Files\Apache Group\Apache2\htdocs\Affirmative_Action\Forms\CheckBoxForm.php5 on line 60

It means that $checkbox variable was not posted from the form. Please make sure there a field with name "checkbox" in your form.
When submitted it first appears in the $_POST['checkbox'], then it enters $checkbox after this statement if(!empty($_POST)) extract($_POST);
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Problems with DB Form Wizard
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic