Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 12-17-2002, 07:37 PM   #16 (permalink)
Henry
Registered User
 
Join Date: Dec 2002
Location: Chicago
Posts: 13
Henry is on a distinguished road
I'm in (I think) so now to the table.

It seems that I finally got what you were saying, and submitting the survey seems to lead to the database (by the way, I also accidently added an 'e' at the beginning /us(e)r2/hsphere/...). So I'm trying to figure out how to get the values into the table.

It turns out that the person that designed this script runs a forum that can be found at http://www.eternalmart.com/cgi-bin/forum/list.php?f=2

As technobard was saying, there's a lot of script in this script, including 6 folders and six additional files that seem to be the main files. I figured out from this forum that the script is actually designed to allow you to build the database and the form through a server, but I didn't realize or need the extra help.

There's a line on the emform.php page that reads: $emsql = new sql_class($DbHost,$DbUser,$DbPadssword,$DbDatabase )
and I'm wondering if it may be as simple as adding $DbTable to the list?

What do you think?
Henry is offline   Reply With Quote
Old 12-18-2002, 07:08 AM   #17 (permalink)
Henry
Registered User
 
Join Date: Dec 2002
Location: Chicago
Posts: 13
Henry is on a distinguished road
I'm in (I think) so now to the table.

I think that I finally got what you were saying, because when I hit "submit this survey", I do not get any error messages. It seems to take me to the database.

I am assuming that I have to specify the table because right now when I hit submit for my form, I am taken to a blank page and the search area at the top of my browser has my domain name followed by a '?', then all of my field names and the values that I chose for each one. The info is not going anywhere. So I'm trying to figure out how to get the values into the table.

It turns out that the person that designed this script runs a forum that can be found at http://www.eternalmart.com/cgi-bin/forum/list.php?f=2

As technobard was saying, there's a lot of script in this script, including 6 folders and six additional files that seem to be the main files. I figured out from this forum that the script is actually designed to allow you to build the database and the form through a server, but I didn't realize or need the extra help.

There's a line on the emform.php page that reads: $emsql = new sql_class($DbHost,$DbUser,$DbPadssword,$DbDatabase
)
and I'm wondering if it may be as simple as adding $DbTable to the list? I'm reluctant to do that because I do not know where to put 'table configuration', like the database and directory configuration lines on the emform_config.php file. I guess what I'm asking is can I add a table configuration set of code to the emform_config.php file?

What do you think?
Henry is offline   Reply With Quote
Old 12-18-2002, 07:11 AM   #18 (permalink)
Henry
Registered User
 
Join Date: Dec 2002
Location: Chicago
Posts: 13
Henry is on a distinguished road
Sorry about the repetition

I didn't notice the 2nd page marker. Sorry about the repetition.
Henry is offline   Reply With Quote
Old 12-18-2002, 07:31 PM   #19 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,444
sde is on a distinguished road
i don't know the answer to that question .. i'm not familiar with those scripts. happy to see things are going a little better though =)

i don't know the answer to that question .. i'm not familiar with those scripts. happy to see things are going a little better though =)

sde is offline   Reply With Quote
Old 12-19-2002, 10:12 AM   #20 (permalink)
technobard
Centurion Nova Prime
 
technobard's Avatar
 
Join Date: May 2002
Location: Oak Park, IL (USA)
Posts: 285
technobard is on a distinguished road
Henry,

I'll modify one of my scripts and send it to you. I'll identify where you'll need to make modifications for your environment. The catch is it may be a while. It's a busy time. A lot of end of year crap at work going on, not to mention all the holiday fun.

Later.
technobard is offline   Reply With Quote
Old 12-23-2002, 07:07 PM   #21 (permalink)
Henry
Registered User
 
Join Date: Dec 2002
Location: Chicago
Posts: 13
Henry is on a distinguished road
new script

Merry Christmas, (And Happy Holidays) to everyone. I imagine that most of you will not get this post until after the 25th.

I tried to edit the guestbook script that you gave me, but I received this error message:
Parse error: parse error in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/survey.php on line 8

I tried to keep the script as simple as possibel. I have the info a the beginning:

<?php

$hostname = "";
$username = "";
$password = "";
$databasename = "";

$link = mysql connect ($hostname, $username, $password);
mysql select db ($ReligionSurvey, $link);

And I set the insert statement up like this:

$stmt = "insert into "my tabel name" (the names of the fileds separated by commas) value (the names of the values preceeded by '$'s)

Question: I noticed that your script had x's after each $fieldname, would that work with a mix of text fields and numeric fields?

Is leaving out the x's my problem?

The rest of the script goes:

mysql bd query ($databasename, $stmt);
unset ($avail);

header ("Location: survey.php");
exit();


?>

Did I leave something out?
Henry is offline   Reply With Quote
Old 12-24-2002, 08:48 PM   #22 (permalink)
technobard
Centurion Nova Prime
 
technobard's Avatar
 
Join Date: May 2002
Location: Oak Park, IL (USA)
Posts: 285
technobard is on a distinguished road
Hey, Henry.

I believe the printout I gave you was a bit off. I don't know if I mentioned that the underlines didn't print for some reason.
mysql connect should be mysql_connect. Likewise,
mysql select db should be mysql_select_db. Any other commands you see that appear to have spaces in them should be modified the same way.

As far as the field names go, they should match whatever you specified on the form.

Happy Holidays!
technobard is offline   Reply With Quote
Old 12-26-2002, 07:27 AM   #23 (permalink)
Henry
Registered User
 
Join Date: Dec 2002
Location: Chicago
Posts: 13
Henry is on a distinguished road
form processing script

O.K. This is what I have so far:

<?php
if ( $submit = "submit" ) { // assuming the value of your submit button is "submit".
$hostname = "";
$username = "";
$password = "";
$databasename = "";

$link = mysql_connect ($hostname, $username, $password);
mysql_select_db ($ReligionSurvey, $link);

$stmt = "insert into
"my tabel name" (the names of the fileds separated by commas) value (the names of the values preceeded by '$'s)

mysql_db_query ($databasename, $stmt);
unset ($avail);

header ("Location: survey.php");
exit();
} else {
echo "It seems you were brought to this page on accident, please return to "; ?>
<A HREF="http://url.to.your/form">the form</A> and try submitting properly.

The thing is, I'm still getting parse error messages. Any ideas?
Henry is offline   Reply With Quote
Old 12-26-2002, 08:22 AM   #24 (permalink)
technobard
Centurion Nova Prime
 
technobard's Avatar
 
Join Date: May 2002
Location: Oak Park, IL (USA)
Posts: 285
technobard is on a distinguished road
Hi, Henry.

Send me the php file as an attachment to my Fastmail account. I'll take a look this evening.
(CORRECTION: Make that my realbox account.)

Later.
technobard is offline   Reply With Quote
Old 12-26-2002, 01:56 PM   #25 (permalink)
Henry
Registered User
 
Join Date: Dec 2002
Location: Chicago
Posts: 13
Henry is on a distinguished road
email

You should have the script.

Thanks
Henry is offline   Reply With Quote
Old 12-30-2002, 06:54 AM   #26 (permalink)
Henry
Registered User
 
Join Date: Dec 2002
Location: Chicago
Posts: 13
Henry is on a distinguished road
parse error

I tried two alteratioins to the script, 1) placed insert statements on separate lines, 2) removewd thge underescores in the insert statements. but I still get errors. Is trhere any chance that the server expects every field to be filled? Would someone take another look at this script and point out some possible issues. Thanks.

<?php
if ($submit="submit") {//"submit"
$hostname = "";
$username = "";
$password = "";
$databasename = "";

$link = mysql_connect ($hostname, $username, $password);
mysql_select_db ($ReligionSurvey, $link);

$stmt = "insert_into_Results2003 (country, citizen, state, resident, community, age, gender, ethnicity, other_ethnicity)";
$stmt = "insert_into_Results2003 (religious_orientation, other_religious_orientation, student, student_status, employed)";
$stmt = "insert_into_Results2003 (occupation, faith_events, faith_events_attendance, other_faith_events_attendance)";
$stmt = "insert_into_Results2003 (faith_events_occurrence, faith_events_occurrence_dates)";
$stmt = "insert_into_Results2003 (place_of_worship, place_of_worship_name, live_near_place_of_worship, religious_holiday)";
$stmt = "insert_into_Results2003 (religious_symbols, religious_symbols_name, mothers_faith, fathers_faith, mother_same_faith)";
$stmt = "insert_into_Results2003 (father_same_faith, same_religion_as_growing_up, attended_religious_institution)";
$stmt = "insert_into_Results2003 (religious_institution_level, religious_institution_type, grandparents_faith)";
$stmt = "insert_into_Results2003 (religion_dictates_appearance, appearance_dictated_by_doctrine)";
$stmt = "insert_into_Results2003 (forbid_specific_clothing_women, forbid_specific_clothing_men, forbidden_appearance)";
$stmt = "insert_into_Results2003 (specific_consumption_forbidden, consumption_forbidden, community_religious_orientation)";
$stmt = "insert_into_Results2003 (other_community_religious_orientation, community_places_of_worship)";
$stmt = "insert_into_Results2003 (community_pow_affiliation, religious_symbols_in_community)";
$stmt = "insert_into_Results2003 (community_religious_symbol_affiliation, are_your_religious_holidays_observed_public_school s)";
$stmt = "insert_into_Results2003 (are_your_religious_holidays_observed_businesses)" ;
$stmt = "insert_into_Results2003 (are_your_religious_holidays_observed_local_govern ment, local_officials_same_religion)";
$stmt = "insert_into_Results2003 (state_officials_same_religion, national_officials_same_religion, community_attitude_beliefs)";
$stmt = "insert_into_Results2003 (community_attitude_pow, community_attitude_symbols, attitude_holidays_publicschools)";
$stmt = "insert_into_Results2003 (attituder_holidays_businesses, attitude_religious_holidays_localgovernment)";
$stmt = "insert_into_Results2003 (community_attitude_electedofficials, attitude_toward_religion_dominant_in_your_communit y)";
$stmt = "insert_into_Results2003 (publicschools_consider_dietary_needs, restaurants_cater_dietary_needs)";
$stmt = "insert_into_Results2003 (familiar_other_religions, familiar_other_religion_name, interested_other_religions)";
$stmt = "insert_into_Results2003 (interested_other_religion_name, attended_events_affiliated_religion)";
$stmt = "insert_into_Results2003 (attended_eventr_religion_name, consider_religion_political_candidates, broadcasts_religion)";
$stmt = "insert_into_Results2003 (reflect_ideals, offend_you_religious_reasons, broadcasts_religious_issues)";
$stmt = "insert_into_Results2003 (interest_religious_beliefs, community_pow_variety_religions)";
$stmt = "insert_into_Results2003 (community_recognition_religios_holidays, broadcasts_sensitive_variety_religions)";
$stmt = "insert_into_Results2003 (respondent_email, respondent_comments)";
$stmt = "insert_into_Results2003 values ('$country', '$citizen', '$state', '$resident', '$community', '$age', '$gender', '$ethnicity')";
$stmt = "insert_into_Results2003 values ('$other_ethnicity', '$religious_orientation', '$other_religious_orientation', '$student')";
$stmt = "insert_into_Results2003 values ('$student_status', '$employed', '$occupation', '$faith_events', '$faith_events_attendance')";
$stmt = "insert_into_Results2003 values ('$other_faith_events_attendance', '$faith_events_occurrence')";
$stmt = "insert_into_Results2003 values ('$faith_events_occurrence_dates', '$place_of_worship', '$place_of_worship_name')";
$stmt = "insert_into_Results2003 values ('$live_near_place_of_worship', '$religious_holiday', '$religious_symbols')";
$stmt = "insert_into_Results2003 values ('$religious_symbols_name', '$mothers_faith', '$fathers_faith', '$mother_same_faith')";
$stmt = "insert_into_Results2003 values ('$father_same_faith', '$same_religion_as_growing_up', '$attended_religious_institution')";
$stmt = "insert_into_Results2003 values ('$religious_institution_level', '$religious_institution_type', '$grandparents_faith')";
$stmt = "insert_into_Results2003 values ('$religion_dictates_appearance', '$appearance_dictated_by_doctrine')";
$stmt = "insert_into_Results2003 values ('$forbid_specific_clothing_women', '$forbid_specific_clothing_men')";
$stmt = "insert_into_Results2003 values ('$forbidden_appearance', '$specific_consumption_forbidden', '$consumption_forbidden')";
$stmt = "insert_into_Results2003 values ('$community_religious_orientation', '$other_community_religious_orientation')";
$stmt = "insert_into_Results2003 values ('$community_places_of_worship', '$community_pow_affiliation')";
$stmt = "insert_into_Results2003 values ('$religious_symbols_in_community', '$community_religious_symbol_affiliation')";
$stmt = "insert_into_Results2003 values ('$are_your_religious_holidays_observed_public_sch ools')";
$stmt = "insert_into_Results2003 values ('$are_your_religious_holidays_observed_businesses ')";
$stmt = "insert_into_Results2003 values ('$are_your_religious_holidays_observed_local_gove rnment')";
$stmt = "insert_into_Results2003 values ('$local_officials_same_religion', '$state_officials_same_religion')";
$stmt = "insert_into_Results2003 values ('$national_officials_same_religion', '$community_attitude_beliefs')";
$stmt = "insert_into_Results2003 values ('$community_attitude_pow', '$community_attitude_symbols')";
$stmt = "insert_into_Results2003 values ('$attitude_holidays_publicschools', '$attituder_holidays_businesses')";
$stmt = "insert_into_Results2003 values ('$attitude_religious_holidays_localgovernment', '$community_attitude_electedofficials')";
$stmt = "insert_into_Results2003 values ('$attitude_toward_religion_dominant_in_your_commu nity')";
$stmt = "insert_into_Results2003 values ('$publicschools_consider_dietary_needs', '$restaurants_cater_dietary_needs')";
$stmt = "insert_into_Results2003 values ('$familiar_other_religions', '$familiar_other_religion_name', '$interested_other_religions')";
$stmt = "insert_into_Results2003 values ('$interested_other_religion_name', '$attended_events_affiliated_religion')";
$stmt = "insert_into_Results2003 values ('$attended_eventr_religion_name', '$consider_religion_political_candidates')";
$stmt = "insert_into_Results2003 values ('$broadcasts_religion', '$reflect_ideals, offend_you_religious_reasons')";
$stmt = "insert_into_Results2003 values ('$broadcasts_religious_issues, interest_religious_beliefs')";
$stmt = "insert_into_Results2003 values ('$community_pow_variety_religions', '$community_recognition_religios_holidays')";
$stmt = "insert_into_Results2003 values ('$broadcasts_sensitive_variety_religions, $respondent_email', '$respondent_comments')";

mysql_bd_query ($ReligionSurvey, $stmt);
unset ($avail);

header ("location: survey.php");
exit();
} else {
echo "It seems that you were brought to this page by accident, please return to"; ?>
<A HREF="http://thirdunitarianchurch.org/Community%20Religious%20Climate%20Survey.html">Rel igious Climate Survey</A>
Henry is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
running a script at designated time tzarin PHP 5 05-12-2004 07:11 PM
PHP as CGI?? bdl PHP 8 05-08-2003 08:29 AM
cgi not working on a new script sde PHP 3 05-20-2002 08:29 PM


All times are GMT -8. The time now is 11:22 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting